Repository navigation
feat: eta-expand partial structure constructors - #15373
Conversation
|
downstream |
|
I ran some analysis on this PR and found a potential regression. With this change, Lean accept an invalid proof when a function type uses a reducible alias. Specifically, the supplied value proves ∀ f, f = f, while the declared type requires ∀ f, f = Box.mk. More details here: Proposed regression (still needs some work to make it mergable): (FYI: this analysis was run using OpenAI Daybreak Blue) |
|
Thanks for the analysis! The code was indeed missing a |
|
changelog-language |
|
The adaptation PR for this PR is leanprover/downstream-lean4#118. |
…264) Tests for the eta-related changes planned in leanprover/lean4#14977: * corner-cases/eta-struct-major-no-whnf: structure eta on a recursor major before reducing it (leanprover/lean4#15351) * corner-cases/eta-struct-major-and: structure eta on a major in `Prop`, like `And` (leanprover/lean4#15371, leanprover/lean4#3213) * corner-cases/eta-struct-major-and-no-whnf: both together, with a non-normalizing proof as major * corner-cases/eta-unit-like-{pi,struct,proof-field,nested}: the extended unit-like criterion (leanprover/lean4#15372, leanprover/lean4#2258) * corner-cases/eta-rec-struct: eta-expansion of a structure recursor missing its major (leanprover/lean4#15374) * bugs/eta-ctor-alias: a soundness bug in a draft of leanprover/lean4#15373 and point the existing corner-cases/eta-ctor and corner-cases/eta-rule-k at leanprover/lean4#15373 and leanprover/lean4#15374. Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
…ctor This PR regenerates InLean from con-leche, which now has the two η rules of #15372 and #15373, verified: a type is unit-like when its head normal form is a function type into a unit-like type or a structure whose fields are all proofs or unit-like (`unitLikeLoopI`), and a partially applied structure constructor is compared with the other side after both are applied to fresh variables up to the full application (`structEtaExpandI`). `elab/2258`, `elab/match4`, `elab/13371` and `elab/12520_1` now pass. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This PR eta-expands partial constructor applications.
Related to #14977
First part of #12520