lean4-htt/tests/elab/simp4.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

61 lines
1.5 KiB
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.

opaque f : Nat → Nat
opaque q : Nat → Prop
opaque r : Nat → Prop
@[simp] axiom ax1 (p : Prop) : (p ∧ True) ↔ p
@[simp] axiom ax2 (x : Nat) : q (f x)
@[simp] axiom ax3 (x : Nat) : ¬ r (f x)
@[simp] axiom ax4 (p : Prop) : (p False) ↔ p
theorem ex1 (x : Nat) (h : q x) : q x ∧ q (f x) := by
simp [h]
theorem ex2 (x : Nat) : q (f x) r (f x) := by
simp
@[simp] axiom ax5 (x : Nat) : 0 + x = x
theorem ex3 (h : 0 + x = y) : f x = f y := by
simp at h
simp [h]
theorem ex4 (x y z : Nat) (h : (x, z).1 = y) : f x = f y := by
simp at h
simp [h]
theorem ex5
(f : Nat → Nat → Nat)
(g : Nat → Nat)
(h₁ : ∀ x, f x x = x)
(h₂ : ∀ x, g (g x) = x)
: f (g (g x)) (f x x) = x :=
by simp [h₁, h₂]
@[simp] axiom ax6 (x : Nat) : x + 0 = x
theorem ex6
(f : Nat → Nat)
(x y : Nat)
: (fun (h : y = 0) => y + x) = (fun _ => x + 0) := by
simp (config := { contextual := true })
theorem ex7 (x : Nat) : (let y := x + 0; y + y) = x + x := by
simp
@[simp] theorem impTrue (p : Sort u) : (p → True) = True :=
propext <| Iff.intro (fun _ => trivial) (fun _ _ => trivial)
theorem ex8 (y x : Nat) : y = 0 → x + y = 0 → x = 0 := by
simp (config := { contextual := true })
theorem ex9 (y x : Nat) : y = 0 → x + y = 0 → x = 0 := by
fail_if_success simp [-Nat.add_eq_zero_iff]
intro h₁ h₂
simp [h₁] at h₂
simp [h₂]
theorem ex10 (y x : Nat) : y = 0 → x + 0 = 0 → x = 0 := by
simp
theorem ex11 : ∀ x : Nat, 0 + x + 0 = x := by
simp