lean4-htt/tests/elab/simp_all.lean
Garmelon 08eb78a5b2
chore: switch to new test/bench suite (#12590)
This PR sets up the new integrated test/bench suite. It then migrates
all benchmarks and some related tests to the new suite. There's also
some documentation and some linting.

For now, a lot of the old tests are left alone so this PR doesn't become
even larger than it already is. Eventually, all tests should be migrated
to the new suite though so there isn't a confusing mix of two systems.
2026-02-25 13:51:53 +00:00

33 lines
905 B
Text

def f (x : Nat) := x
theorem ex1 (h₁ : a = 0) (h₂ : a + b = 0) : f (b + c) = c := by
simp_all
simp [f]
theorem ex2 (h₁ : a = 0) (h₂ : a + b = 0) : f (b + c) = c := by
simp_all [f]
theorem ex3 (h₁ : a = 0) (h₂ : a + b = 0) : f (b + c) = c := by
simp_all only [f]
rw [Nat.zero_add] at h₂
simp [h₂]
theorem ex4 (h₁ : a = f a) (h₂ : b + 0 = 0) : f b = 0 := by
simp_all (config := { decide := true }) [-h₁]
theorem ex5 (h₁ : a = f a) (h₂ : b + 0 = 0) : f (b + a) = a := by
simp_all [-h₁, f]
/-!
Prior to lean4#2334, `simp_all` would unnecessarily reorder hypotheses,
even when it did not do any simplification.
See lean4#2402.
This test verifies that the last hypothesis stays in the last position
through the `simp_all`.
-/
example : ∀ {A : Prop} (_ : A) (_ : W), W := by
intros
simp_all (config := { failIfUnchanged := false })
rename_i w
exact w