Skip to content

Verify front-end declaration checking - #28

Open
kim-em wants to merge 4 commits into
digama0:masterfrom
kim-em:verify-environment-frontend
Open

Verify front-end declaration checking#28
kim-em wants to merge 4 commits into
digama0:masterfrom
kim-em:verify-environment-frontend

Conversation

@kim-em

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

Copy link
Copy Markdown
Contributor

Adds the verified environment model and proves preservation across declaration checking and front-end environment extension.

Coverage

Declaration path Status
Declaration headers and axioms Proved
Theorems Proved
Opaque declarations Header and body checker proved; environment model retains the checked header because opaque bodies add no definitional equality
Nonrecursive safe and partial definitions Proved
Primitive recognition One explicit front-end boundary in Environment/Boundaries.lean
Recursive unsafe definitions Excluded by Declaration.IsModelled; the current relation cannot represent self-reference
Mutual definitions Excluded by Declaration.IsModelled; the current relation cannot represent mutually recursive bodies
Inductive declarations Excluded by Declaration.IsModelled until AddInduct has a constructive model
Quotient initialization Vacuous until inductive environments are modeled

The preservation theorem is intentionally stated only for declaration forms represented by the current model; it does not assume false extension properties for recursive or inductive declarations.

The runtime parity fixes remain in this PR. Synthetic tests compare kernel and lean4lean behavior for mutual declarations, duplicate names, primitives, and partial definitions; the existing DeclFVar suite covers closure rejection.

Suggested review order

  1. fix: match kernel declaration checks — runtime parity and focused tests.
  2. refactor: model verified environment entries faithfully — environment relation and supporting lemmas.
  3. verify declaration checker correctness — constructive checker proofs and the isolated primitive-recognition boundary.
  4. verify front-end environment extension and dispatch — extension machinery and the final model-scoped declaration theorem.

🤖 prepared with Codex

@kim-em
kim-em marked this pull request as ready for review August 3, 2026 22:38
@kim-em
kim-em force-pushed the verify-environment-frontend branch from 36e7e1c to 68c8780 Compare August 3, 2026 22:43
@kim-em
kim-em force-pushed the verify-environment-frontend branch from 68c8780 to f83b64f Compare August 4, 2026 01:28
@kim-em
kim-em force-pushed the verify-environment-frontend branch from 5bd5d86 to 90e17a5 Compare August 4, 2026 02:31
@kim-em
kim-em force-pushed the verify-environment-frontend branch from 90e17a5 to 352e9ee Compare August 4, 2026 02:54
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.

1 participant