lean4-htt/tests/lean/run/simp_failIfUnchanged.lean
2023-08-13 09:49:25 -07:00

30 lines
879 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

example (h : False) : False := by
fail_if_success
simp (config := { failIfUnchanged := true })
cases h
example (h : (a :: [b]).length = 3) : False := by
fail_if_success
simp (config := { failIfUnchanged := true }) only at h
simp (config := { failIfUnchanged := false }) only at h
simp (config := { failIfUnchanged := true }) at h
example (h : False) : False := by
fail_if_success
dsimp (config := { failIfUnchanged := true })
cases h
example (_h : 37 = 37) (w : Nonempty False) : False False := by
-- removes `_h` and simplifies the goal
simp_all (config := { failIfUnchanged := true })
-- Now should fail, because it can't do anything.
fail_if_success
simp_all (config := { failIfUnchanged := true })
cases w with
| intro w => cases w
example (h : False) : 7 = 8 := by
simp (config := { failIfUnchanged := true })
cases h