lean4-htt/tests/lean/run/793.lean
Leonardo de Moura cf36ac986d
perf: optimize simp congruence proofs (#11892)
This PR optimizes the construction on congruence proofs in `simp`.
It uses some of the ideas used in `Sym.simp`.
2026-01-04 19:37:21 +00:00

16 lines
431 B
Text

macro "foo" x:ident : command =>
`(structure Foo where
val : Nat
prop : val = 42
def f (x : Foo) := x.val
def g : Foo := { val := 42, prop := by decide }
theorem $x:ident (x : Foo) : f x = 42 := by simp [f, x.prop] )
foo test
/--
info: theorem test : ∀ (x : Foo✝), f✝ x = 42 :=
fun x => of_eq_true (Eq.trans (congrFun' (congrArg Eq (Foo.prop✝ x)) 42) (eq_self 42))
-/
#guard_msgs in
#print test