lean4-htt/tests/lean/run/simpArithCacheIssue.lean
Joachim Breitner 0e49576fe4
feat: guard_msgs to treat trace messages separate (#8267)
This PR makes `#guard_msgs` to treat `trace` messages separate from
`info`, `warning` and `error`. It also introduce the ability to say
`#guard_msgs (pass info`, like `(drop info)` so far, and also adds
`(check info)` as the explicit form of `(info)`, for completeness.

Fixes #8266
2025-05-09 05:44:34 +00:00

25 lines
510 B
Text

/--
trace: 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]