Skip to content

Prove Expr cached flag correctness - #19

Merged
digama0 merged 2 commits into
digama0:masterfrom
kim-em:prove-expr-hasfvar-cache
Aug 1, 2026
Merged

Prove Expr cached flag correctness#19
digama0 merged 2 commits into
digama0:masterfrom
kim-em:prove-expr-hasfvar-cache

Conversation

@kim-em

@kim-em kim-em commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Replaces the four Expr cached-flag axioms with proofs from mkData_eq and mkAppData_eq.

🤖 prepared with Codex

kim-em and others added 2 commits August 1, 2026 13:10
Now that the four Expr cached-flag axioms are theorems, they and their
supporting lemmas belong in Verify/Expr.lean; Axioms.lean goes back to
holding only genuine axioms and the definitions needed to state them.
The block lands before the Literal namespace because
Literal.toConstructor_hasLevelParam uses Expr.hasLevelParam'.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@digama0
digama0 merged commit 4a75b71 into digama0:master Aug 1, 2026
digama0 added a commit that referenced this pull request Aug 2, 2026
* prove Expr cached flag correctness

* move proved cached-flag lemmas out of Axioms.lean

Now that the four Expr cached-flag axioms are theorems, they and their
supporting lemmas belong in Verify/Expr.lean; Axioms.lean goes back to
holding only genuine axioms and the definitions needed to state them.
The block lands before the Literal namespace because
Literal.toConstructor_hasLevelParam uses Expr.hasLevelParam'.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Mario Carneiro <di.gama@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
kim-em added a commit to kim-em/lean4lean that referenced this pull request Aug 3, 2026
Replace the `Level.hasParam_eq` and `Level.hasMVar_eq` axioms with proofs
derived from `Level.mkData_eq`, and move them and the structural
`hasParam'`/`hasMVar'` definitions out of `Verify/Axioms.lean` into
`Verify/Level.lean`, as was done for the Expr cached flags in digama0#19.

This also fixes the overflow branch of the `Level.mkData'` model, which
was jointly inconsistent with the two flag equalities: see the new
docstring.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y5K6isCtnCB86J8fRbVTKS
kim-em added a commit to kim-em/lean4lean that referenced this pull request Aug 4, 2026
Replace the `Level.hasParam_eq` and `Level.hasMVar_eq` axioms with proofs
derived from `Level.mkData_eq`, and move them and the structural
`hasParam'`/`hasMVar'` definitions out of `Verify/Axioms.lean` into
`Verify/Level.lean`, as was done for the Expr cached flags in digama0#19.

This also fixes the overflow branch of the `Level.mkData'` model, which
was jointly inconsistent with the two flag equalities: see the new
docstring.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y5K6isCtnCB86J8fRbVTKS
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