Prove EvalExpressionIsDefined by adding definedness propagation to WellFormedCoreEvalCong#454
Merged
tautschnig merged 8 commits intomainfrom Feb 24, 2026
Merged
Conversation
…llFormedCoreEvalCong Add five new fields to WellFormedCoreEvalCong (absdef, appdef, eqdef, quantdef, itedef) asserting that if a compound expression is defined, its subexpressions are also defined. This enables proving all five remaining cases (abs, quant, app, ite, eq) of EvalExpressionIsDefined by structural induction. Kiro spent 21 minutes on this proof.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR strengthens the core expression evaluator well-formedness assumptions to include definedness propagation for compound expressions, enabling completion of the remaining structural-induction cases in EvalExpressionIsDefined.
Changes:
- Extend
WellFormedCoreEvalCongwith five new fields (absdef,appdef,eqdef,quantdef,itedef) capturing that definedness of a compound expression implies definedness of its subexpressions. - Complete the previously-sorry cases (
abs,quant,app,ite,eq) inEvalExpressionIsDefinedusing those propagation fields.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| Strata/Languages/Core/StatementSemantics.lean | Adds definedness-propagation assumptions to WellFormedCoreEvalCong. |
| Strata/Languages/Core/StatementSemanticsProps.lean | Finishes EvalExpressionIsDefined proof by structural induction using the new propagation fields. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…alCong and update field access paths - WellFormedCoreEvalDefinedness was defined after WellFormedCoreEvalCong but referenced inside it, causing a forward-reference error. Move it before WellFormedCoreEvalCong so it is in scope. - Update StatementSemanticsProps.lean to access definedness fields through the new nested path (e.g. Hwfc.definedness.absdef instead of Hwfc.absdef). - Rename abscongr binders from (ty m) to (m ty) to match the .abs constructor argument order (m: Metadata, ty: Option TypeType), consistent with absdef and other fields.
joscoh
reviewed
Feb 20, 2026
The structure bundling WellFormedCoreEvalCong and WellFormedCoreEvalDefinedness was defined but never referenced anywhere in the codebase. All call sites use the component types directly.
Replace manual rcases/exact case-splitting with grind in the quant, app, ite, and eq cases. After the definedness hypothesis is introduced, grind handles the disjunction and hypothesis application automatically.
…sionIsDefined-proof
joscoh
approved these changes
Feb 23, 2026
atomb
approved these changes
Feb 24, 2026
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.
Add five new fields to WellFormedCoreEvalCong (absdef, appdef, eqdef, quantdef, itedef) asserting that if a compound expression is defined, its subexpressions are also defined. This enables proving all five remaining cases (abs, quant, app, ite, eq) of EvalExpressionIsDefined by structural induction.
Kiro spent 21 minutes on this proof.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.