Commit 9f0aee2
committed
fix(RingNF): use
This PR was originally meant as a performance improvement, but now serves as a bug fix. The `cleanup` function used by `ring_nf` used to be non-confluent due to using both `add_assoc_rev` and `add_neg`, and it would apply them in the wrong order. This PR fixes that problem by putting `add_assoc_rev` in the pre-simp-set, and keeping `add_neg` in the post-simp-set. This affects a few proofs that needed to be fixed.
When applied to big expressions, associativity lemmas are more efficient as pre lemmas than as post lemmas: as post lemmas, the number of needed rewrites is quadratic instead of linear. This PR applies this idea to the `ring_nf` cleanup function.assoc as a pre lemma (leanprover-community#36947)1 parent 0e301e8 commit 9f0aee2
5 files changed
Lines changed: 19 additions & 11 deletions
File tree
- MathlibTest
- Mathlib
- Analysis/SpecialFunctions
- GroupTheory/SpecificGroups
- NumberTheory/LSeries
- Tactic/Ring
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
411 | 411 | | |
412 | 412 | | |
413 | 413 | | |
414 | | - | |
415 | 414 | | |
416 | 415 | | |
417 | 416 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
101 | 99 | | |
102 | 100 | | |
103 | 101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
170 | | - | |
| 169 | + | |
171 | 170 | | |
172 | 171 | | |
173 | 172 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
118 | | - | |
| 117 | + | |
| 118 | + | |
119 | 119 | | |
120 | | - | |
| 120 | + | |
| 121 | + | |
121 | 122 | | |
122 | 123 | | |
123 | 124 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
0 commit comments