lean4-htt/tests/lean/run/injection1.lean
2017-03-09 18:41:19 -08:00

39 lines
795 B
Text

open nat tactic
inductive vec (A : Type) : nat → Type
| nil : vec nat.zero
| cons : ∀ {n}, A → vec n → vec (succ n)
example (n : nat) (v w : vec nat n) (a b : nat) : vec.cons a v = vec.cons b w → a = b :=
by do
intro `H,
H ← get_local `H,
injection H,
trace_state,
assumption
example (n : nat) (v w : vec nat n) (a b : nat) : vec.cons a v = vec.cons b w → v = w :=
by do
intro `H,
H ← get_local `H,
injection H,
trace_state,
assumption
#print "----------------"
example (a b : nat) : succ a = succ b → a = b :=
by do
intro `H,
H ← get_local `H,
injection H,
trace_state,
assumption
example (a b c d : nat) : (a, b) = (c, d) → a = c :=
by do
intro `H,
H ← get_local `H,
injection_with H [`H1, `H2],
H1 ← get_local `H1,
exact H1