lean4-htt/tests/lean/simpZetaFalse.lean
Leonardo de Moura e53952f167 chore: fix tests
2023-11-09 04:06:30 -08:00

28 lines
959 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.

opaque f : Nat → Nat
axiom f_eq (x : Nat) : f (f x) = x
theorem ex1 (x : Nat) (h : f (f x) = x) : (let 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 let_congr
theorem ex2 (x z : Nat) (h : f (f x) = x) (h' : z = x) : (let y := f (f x); y) = z := by
simp (config := { zeta := false }) only [h]
trace_state
simp [h']
#print ex2 -- uses let_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) : (let 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 let_body_congr