Skip to content

fix(lean): make lake build actually compile and pass + gitignore build artifacts - #23

Merged
Kairose-master merged 2 commits into
mainfrom
claude/lean-ci-fix-main
Aug 30, 2026
Merged

fix(lean): make lake build actually compile and pass + gitignore build artifacts#23
Kairose-master merged 2 commits into
mainfrom
claude/lean-ci-fix-main

Conversation

@Kairose-master

Copy link
Copy Markdown
Owner

Summary

Same CI investigation as #22 (already merged on feature/gemini-proposal), applied to main. Note main's core/lean/Core.lean is a different (single-file) revision of the design than the one on feature/gemini-proposal, so the fixes here are specific to this version, not a copy-paste of #22.

lake build (CI's proof-check step) was failing to compile Core.lean against the pinned mathlib (v4.21.0-rc2):

  • EpsFunctor.comp_ok: composition order was backwards (g ≫ f when f : A ⟶ B, g : B ⟶ C₁ don't compose that way) — swapped to f ≫ g, matching functoriality.
  • EpsFunctor's distortion metric d was typed over morphisms of C (the source category) instead of D (the target category) — only accidentally type-checked in IdFunctor because C = D = UnitCat there. Retyped it over D, matching what comp_ok actually measures.
  • IdFunctor's EpsFunctor (d := PhaseDist) 0 left C/D as stuck metavariables during typeclass search; made them explicit via @EpsFunctor UnitCat UnitCat _ _ PhaseDist 0.
  • IdFunctor's comp_ok proof: simp [PhaseDist] couldn't unfold the HasPhase instance's constant-0 phase field on its own; replaced with show |(0:ℝ) - 0| ≤ (0:ℝ) (defeq, since the instance always returns 0) followed by norm_num.

Also adds .gitignore for build artifacts (parser/target/, core/lean/.lake/, core/lean/AutoGen/) — the repo had none, so reproducing CI locally left them as untracked output.

Test plan

  • Ran lake update && lake build locally on this branch — clean build (one harmless unused-variable warning only).

Known remaining gap (out of scope here)

CatPrism_examples.lean references verify_comp (no such tactic exists anywhere in this branch's Lean project) and names like Example1.ProjectionFunctor/GroupCat that aren't defined. It's not a CI default target so it doesn't block this fix, but it doesn't actually build. Left for a follow-up.


Generated by Claude Code

claude added 2 commits August 18, 2026 06:25
The repo had no .gitignore, so reproducing CI locally (cargo build,
lake update, lake build) left untracked build output at the top of
git status: parser/target/ (Rust), core/lean/.lake/ (Lean/mathlib
build cache, ~5.7GB), core/lean/AutoGen/ (generated Lean files from
the .cat pipeline), and lake-manifest.json.
`lake build` (CI's proof-check step) was failing to compile Core.lean
against the pinned mathlib (v4.21.0-rc2):

- EpsFunctor.comp_ok: composition order was backwards (`g ≫ f` when
  f : A ⟶ B, g : B ⟶ C₁ don't compose that way) - swapped to `f ≫ g`,
  matching functoriality.
- EpsFunctor's distortion metric `d` was typed over morphisms of `C`
  (the source category) instead of `D` (the target category) - only
  accidentally type-checked in IdFunctor because C = D = UnitCat there.
  Retyped it over D, matching what comp_ok actually measures.
- IdFunctor's `EpsFunctor (d := PhaseDist) 0` left C/D as stuck
  metavariables during typeclass search; made them explicit via
  `@EpsFunctor UnitCat UnitCat _ _ PhaseDist 0`.
- IdFunctor's comp_ok proof: `simp [PhaseDist]` couldn't unfold the
  HasPhase instance's constant-0 `phase` field on its own; replaced
  with `show |(0:ℝ) - 0| ≤ (0:ℝ)` (defeq, since the instance always
  returns 0) followed by `norm_num`.

Also adds .gitignore for build artifacts (parser/target/,
core/lean/.lake/, core/lean/AutoGen/) - the repo had none, so
reproducing CI locally left them as untracked output.

Verified with a clean `lake update && lake build` locally - green.
@Kairose-master
Kairose-master merged commit 10b5ea6 into main Aug 30, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants