lean4-htt/tests/lean/change2.lean
2016-07-29 13:03:23 -07:00

17 lines
457 B
Text

open tactic nat expr option
definition succ_eq_add [defeq] (n : nat) : succ n = n + 0 + 1 :=
rfl
example (a b : nat) : a = b → succ (succ a) = succ (b + 1) :=
by do intro `Heq,
get_local `a >>= subst,
trace_state,
dsimp,
trace "---- after dsimp ----",
trace_state,
t ← target,
match is_eq t with
| some (lhs, rhs) := do pr ← mk_app `eq.refl [lhs], exact pr
| none := failed
end