Commit 5ee5050
committed
fix(Tactic/NormNum): do not re-enter
This fixes a recursion error in
```lean4
import Mathlib.SetTheory.Cardinal.Basic
import Mathlib.Tactic.NormNum.Core
theorem foos.{u} (α β : Type u) : Cardinal.mk α = Cardinal.mk β → α = β := by
norm_num [Cardinal.mk_eq_aleph0]
```
which is quite willing to be promoted to a stack overflow with a moderate recursion depth limit.
It's not entirely clear to me if `dischargeGround` is the right discharger to use here, but no tests fail because of that choice.
Note this change breaks the following proof:
```lean4
import Mathlib.Tactic.NormNum
theorem foo (x y : ℚ)
(h₀ : x > 0 ∧ y > 0)
(h₁ : x < 1 ∧ y < 1) :
0 ≤ x / (1 - x) + y / (1 - y) := by
norm_num [*, div_pos, add_pos, le_of_lt]
```
The reason is that previously `norm_num` was `simp` plus _two_ things:
* Numeral normalization.
* Hackily overriding `maxDischargeDepth` to exceed maxRecDepthsimp from the very outside (#36841)1 parent 2da3b35 commit 5ee5050
2 files changed
+20
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
239 | 237 | | |
240 | 238 | | |
241 | 239 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
259 | | - | |
| 259 | + | |
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
| |||
0 commit comments