proofs(lean4): close ET-2 — L1 conversion is decidable#24
Merged
Conversation
Completes the MECH-1 milestone that Conversion.lean recorded as open.
Purely additive: four new modules under Systemet/L1/, plus append-only
entries in Systemet.lean, MANIFEST and Audit.lean. Syntax/Normal/Hsub/
Conversion.lean are untouched.
Landed (all statements verbatim from the ET-2 ledger entry):
SubstLemmas.lean substitution/weakening exchange family, incl.
nf_substTy — normalization commutes with hereditary
substitution (the beta case's whole content)
Soundness.lean soundness : DefEq t (embNf (nf t))
Completeness.lean completeness : DefEq t u -> nf t = nf u
defEq_iff_nf : DefEq t u <-> nf t = nf u
Decidable.lean decEqNf / decEqSp (hand-rolled mutual DecidableEq --
`deriving` does not work across the Nf/Sp pair)
decDefEq : (t u : Ty G k) -> Decidable (DefEq t u)
Method: exchange coordinates (swp/remSwap) with an Eq.rec cast toolkit
whose push lemmas are all `by subst h; rfl`, so definitional proof
irrelevance makes diagonal casts vanish. The subst/subst exchange needs a
SUM measure (kindSize k + kindSize b, tag, size) because the miss-then-hit
case folds appSp at the second kind.
Evidence (measured, not asserted):
clean rebuild from scratch Build completed successfully (16 jobs)
scripts/check-proofs.sh PASS, 20/20 headline items in trusted base
scripts/scan-dangerous.sh PASS
scripts/check-proof-status PASS after the doc update below
#print axioms on soundness, completeness, defEq_iff_nf, decDefEq,
decEqNf, decEqSp, nf_substTy -> [propext, Quot.sound] only; no
sorryAx, no user axioms, no Classical.choice.
Scope, stated honestly: DefEq here is beta + equivalence + congruence.
eta is NOT included and remains an OPEN row, so ET-3 is unaffected --
its eta and model directions stay open. PROOF-STATUS.adoc moves ET-2 to
proven *for the L1 core calculus* under the file's existing core-vs-full-
theory caveat, and the now-satisfied "ET-2 (finish)" OPEN row is removed.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
hyperpolymath
marked this pull request as ready for review
July 22, 2026 08:41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Closes obligation ET-2 (decidability of L1 conversion) for the mechanized core calculus. This was the upstream blocker sitting under ET-14 / Phase 6.
Stacking and provenance
proofs/lean4-l1-l2, notmain. That branch is pushed but has no PR of its own; this stacks on it so the mechanization lands as one reviewable lineage. Retarget tomainifproofs/lean4-l1-l2merges first.lake buildas the judge). Two attempts reached full closure; this is the stronger one (38 theorems, faithful Keller–Altenkirch decomposition). Attempt artefacts were written to a scratch directory and applied here by hand — the campaign's own verify and adversarial-review stages were cut short by a monthly spend limit, so every check below was re-run manually rather than taken on an agent's word.What landed
Purely additive —
Syntax/Normal/Hsub/Conversion.leanare byte-identical; the only edits to existing files are append-only registry entries (18 insertions, 0 deletions).Systemet/L1/SubstLemmas.leannf_substTy— normalization commutes with hereditary substitution (the whole content of the beta case)Systemet/L1/Soundness.leansoundness : DefEq t (embNf (nf t))Systemet/L1/Completeness.leancompleteness : DefEq t u → nf t = nf u;defEq_iff_nf : DefEq t u ↔ nf t = nf uSystemet/L1/Decidable.leandecEqNf/decEqSp(hand-rolled mutualDecidableEq—derivingdoes not work across theNf/Sppair);decDefEq : (t u : Ty Γ k) → Decidable (DefEq t u)File layout matches the slots the ET-2 ledger entry already named.
Evidence (measured)
rm -rf .lake/build: Build completed successfully (16 jobs)scripts/check-proofs.sh lean4— PASS, audit reports 20/20 headline items within the trusted basescripts/scan-dangerous.sh— PASSscripts/check-proof-status.sh— PASS (exit 0) after thePROOF-STATUS.adocupdate#print axiomsonsoundness,completeness,defEq_iff_nf,decDefEq,decEqNf,decEqSp,nf_substTy→[propext, Quot.sound]only. NosorryAx, no user axioms, and not evenClassical.choice.DefEq/nf: none — the new theorems quantify over the originals fromConversion.lean, with generalΓandkand no added hypotheses.Scope — what this does not claim
DefEqhere is β + equivalence + congruence. η is not included, and remains an OPEN row. ET-3 is unaffected — its η and model directions stay open.PROOF-STATUS.adocmarks ET-2 proven for the L1 core calculus, under the caveat that file already carries about core-vs-full-theory claims, and drops the now-satisfied "ET-2 (finish)" OPEN row.ET-14 (TEA erasure) is untouched and remains the headline open problem. The campaign's TEA design track produced nothing — all three panelists and the judge died on the spend limit — so the ET-16 / L0 lowering ADR is still owner-gated and unstarted.
🤖 Generated with Claude Code