Commit 6490098
committed
feat(gcongr): use mdata instead of template (#30739)
This PR changes the implementation of `gcongr` patterns. Instead of carrying around another expression of the same shape, we put a metadata annotation in the actual goal, in order to keep track of where we want to apply more `gcongr` lemmas.
This makes the implementation neater, and this is a necessary step towards supporting more operations in `gcongr`, such as those from the `congr!` tactic.
This also means that the pattern given to the `gcongr` tactic is checked to be fully correct. This helped fix one pattern in mathlib that was `∑ _ : α, ?_`, but should have been `∑ _ : β, ?_`.
Another change that this PR makes is that if the goal relation is `a → b`, then we run reducible `whnf` on `a` and `b` before getting the two sides of the relation. This means that `x > y` is reduced to `y < x`. This is needed because this refactor now is keeping track of which side is which side, and to do this consistently, we need `x > y` to be swapped into `y < x`.1 parent 056b907 commit 6490098
File tree
6 files changed
+163
-163
lines changed- MathlibTest
- GCongr
- Mathlib
- NumberTheory
- Order
- Tactic
- GCongr
- GRewrite
6 files changed
+163
-163
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
198 | | - | |
199 | | - | |
200 | 198 | | |
201 | 199 | | |
202 | 200 | | |
| |||
0 commit comments