Commit 32616be
committed
feat: make
The `generalize_proofs` tactic had a bug where it would not generalize proofs that appeared under binders correctly, creating terms with fvars from the wrong context. The tactic has been refactored, and it now abstracts the proofs (universally quantifying all the bound variables that appear in the proof) before lifting them to the local context.
This feature can be controlled with the `abstract` option. Using `generalize_proofs (config := { abstract := false })` turns off proof abstraction and leaves alone those proofs that refer to bound variables.
Other new features:
- `generalize_proofs at h` for a let-bound local hypothesis `h` will clear its value.
- `generalize_proofs at h` for a duplicate proposition will eliminate `h` from the local context.
- Proofs are recursively generalized for each new local hypothesis. This can be turned off with `generalize_proofs (config := { maxDepth := 0 })`.
- `generalize_proofs at h` will no longer generalize proofs from the goal.
- The type of the generalized proof is carefully computed by propagating expected types, rather than by using `inferType`. This gives local hypotheses in more useful forms.
(This PR serves as a followup to [this comment](#447 (comment)).)generalize_proofs handle proofs under binders (#12472)1 parent 0e05cbe commit 32616be
File tree
7 files changed
+592
-142
lines changed- Mathlib
- AlgebraicGeometry/Morphisms
- Algebra/Category/GroupCat
- Combinatorics/SimpleGraph
- Data
- NumberTheory/Cyclotomic
- Tactic
- test
7 files changed
+592
-142
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
520 | 520 | | |
521 | 521 | | |
522 | 522 | | |
523 | | - | |
524 | | - | |
525 | | - | |
| 523 | + | |
526 | 524 | | |
527 | 525 | | |
528 | 526 | | |
529 | 527 | | |
530 | 528 | | |
531 | 529 | | |
532 | | - | |
533 | | - | |
534 | | - | |
| 530 | + | |
535 | 531 | | |
536 | 532 | | |
537 | 533 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
| 150 | + | |
| 151 | + | |
151 | 152 | | |
152 | 153 | | |
153 | 154 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
328 | 328 | | |
329 | 329 | | |
330 | 330 | | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
336 | 334 | | |
337 | 335 | | |
338 | 336 | | |
| |||
341 | 339 | | |
342 | 340 | | |
343 | 341 | | |
344 | | - | |
345 | | - | |
346 | | - | |
| 342 | + | |
| 343 | + | |
347 | 344 | | |
348 | 345 | | |
349 | 346 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
| 59 | + | |
63 | 60 | | |
64 | 61 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
| 62 | + | |
69 | 63 | | |
70 | 64 | | |
71 | 65 | | |
| |||
154 | 148 | | |
155 | 149 | | |
156 | 150 | | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
164 | 156 | | |
165 | 157 | | |
166 | 158 | | |
| |||
0 commit comments