lean4-htt/tests/lean/run/conv2.lean
Leonardo de Moura b2f34bdedd feat: improve congr conv tactic
It has better support for proof irrelevant and `[Decidable p]` arguments
2022-08-02 04:26:34 -07:00

24 lines
510 B
Text

opaque f (a : Nat) (h : a > 0) : Nat
example (h : a = b) : f (a + 1) (by simp_arith) = f (1 + b) (by simp_arith) := by
conv => lhs; congr; rw [h]
conv => lhs; congr; rw [Nat.add_comm]
opaque g (p : Prop) [Decidable p] (a : Nat) (h : a > 0) : Nat
example (h : a = b) : g True (a + 1) (by simp_arith) = g (1+1=2) (1 + b) (by simp_arith) := by
conv =>
lhs
congr
. rfl
. rw [h]
conv =>
lhs
congr
. rfl
. rw [Nat.add_comm]
conv =>
rhs
congr
. simp
. rfl