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

35 lines
1.2 KiB
Text
Raw Permalink 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
axiom f_eq (x : Nat) : f (f x) = x
theorem ex0 (x : Nat) (h : f (f x) = x) : (have y := 0 + x*x; if f (f x) = x then 1 else y + 1) = 1 := by
simp (config := { zeta := false }) only [h, Nat.zero_add]
trace_state
simp
#print ex0 -- uses have_congr
theorem ex1 (x : Nat) (h : f (f x) = x) : (have y := x*x; if f (f x) = x then 1 else y + 1) = 1 := by
simp (config := { zeta := false }) only [h]
trace_state
simp
#print ex1 -- uses have_body_congr
theorem ex2 (x z : Nat) (h : f (f x) = x) (h' : z = x) : (have y := f (f x); y) = z := by
simp (config := { zeta := false }) only [h]
trace_state
simp [h']
#print ex2 -- uses have_val_congr
theorem ex3 (x z : Nat) : (let α := Nat; (fun x : α => 0 + x)) = id := by
simp (config := { zeta := false, failIfUnchanged := false })
trace_state -- should not simplify let body since `fun α : Nat => fun x : α => 0 + x` is not type correct
simp (config := { unfoldPartialApp := true }) [id]
theorem ex4 (p : Prop) (h : p) : (have n := 10; fun x : { z : Nat // z < n } => x = x) = fun z => p := by
simp (config := { zeta := false })
trace_state
simp [h]
#print ex4 -- uses have_body_congr