lean4-htt/tests/lean/run/simpArithCacheIssue.lean
Leonardo de Moura 2a67a49f31
chore: simp_arith has been deprecated (#7043)
This PR deprecates the tactics `simp_arith`, `simp_arith!`,
`simp_all_arith` and `simp_all_arith!`. Users can just use the `+arith`
option.
2025-02-12 03:55:45 +00:00

25 lines
509 B
Text

/--
info: x y : Nat
h : y = 0
⊢ id (2 * x + y) = id (2 * x)
-/
#guard_msgs in
example (x y : Nat) (h : y = 0) : id ((x + x) + y) = id (x + x) := by
simp +arith only
/-
This is a test for a `simp` cache issue where the following incorrect goal was being
produced.
```
... |- id (2*x + y) = id (x + x)
```
instead of
```
... |- id (2*x + y) = id (2*x)
```
-/
trace_state
simp [h]
example (x y : Nat) (h : y = 0) : id (x + x) = id ((x + x) + y) := by
simp +arith only
simp [h]