experiment: normalize instances in inferInstanceAs#12895
experiment: normalize instances in inferInstanceAs#12895Kha wants to merge 33 commits intoleanprover:nightly-with-mathlibfrom
inferInstanceAs#12895Conversation
|
!bench |
|
Benchmark results for 19f2533 against e804829 are in. Significant changes detected! @Kha
Large changes (151🟥) Too many entries to display here. View the full report on radar instead. Medium changes (2✅, 243🟥) Too many entries to display here. View the full report on radar instead. Small changes (13✅, 471🟥) Too many entries to display here. View the full report on radar instead. |
|
Reference manual CI status:
|
|
Mathlib CI status (docs):
|
|
!bench |
|
Benchmark results for ed712ff against e804829 are in. There are no significant changes. @Kha
Small changes (11✅, 3🟥)
|
|
Mathlib CI status (docs):
|
|
I think it would be a bad idea to replace all instances with their synthesized instance, because it would lead to very confusing behaviour. You would get the following: I'm not saying it is a good idea to write multiple instances of |
|
Yes I limited the normalization to |
|
Mathlib CI status (docs):
|
|
Mathlib CI status (docs):
|
inferInstanceAs
|
!bench |
|
Benchmark results for ed712ff against e804829 are in. There are no significant changes. @Kha
Small changes (11✅, 3🟥)
|
|
Mathlib CI status (docs):
|
Add three new options (all defaulting to false) for wrapping constructor fields in auxiliary definitions to fix their types: - instance.normalForm.wrapFields.proofs: wraps proof fields via mkAuxTheorem - instance.normalForm.wrapFields.instances: wraps instance fields via mkAuxDefinition marked implicit_reducible - instance.normalForm.wrapFields.data: wraps data fields via mkAuxDefinition Also wrap the normalizeInstance call in withNewMCtxDepth to prevent isDefEq side effects from leaking, matching the Mathlib fast_instance% pattern. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
84ed9ed to
5026406
Compare
|
Mathlib CI status (docs):
|
|
Mathlib CI status (docs):
|
…alizeInstance This PR passes `compile := false` when creating auxiliary definitions inside `normalizeInstance` if the surrounding declaration is noncomputable or we are in a noncomputable section, preventing spurious "Failed to find LCNF signature" errors. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Auxiliary definitions created by normalizeInstance in inferInstanceAs now propagate sorry warnings from the instances they wrap. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Mathlib CI status (docs):
|
|
Superseded by #12897 |
Experiment based on leanprover-community/mathlib4#36420