lean4-htt/tests/lean/run/5064.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

27 lines
579 B
Text

/-!
# Make sure `injection` tactic can handle `0 = n + 1`
https://github.com/leanprover/lean4/issues/5064
-/
/-!
Motivating example from #5064.
This failed when generating the splitter theorem for `thingy`.
-/
def thingy : List (Nat ⊕ Nat) → List Bool
| Sum.inr (_n + 2) :: l => thingy l
| _ => []
termination_by l => l.length
/-- trace: ⊢ [] = [] -/
#guard_msgs in
theorem thingy_empty : thingy [] = [] := by
unfold thingy
trace_state
rfl
/-!
Test using `injection` directly.
-/
example (n : Nat) (h : 0 = n + 1) : False := by
with_reducible injection h