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

31 lines
691 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.

open tactic
example (p q : Prop) : p q → q p :=
by do
H ← intro `H,
induction_core semireducible H `or.rec [`Hp, `Hq],
trace_state,
constructor_idx 2, assumption,
constructor_idx 1, assumption
print "-----"
open nat
example (n : ) : n = 0 n = succ (pred n) :=
by do
n ← get_local `n,
induction_core semireducible n `nat.rec [`n', `Hind],
trace_state,
constructor_idx 1, reflexivity,
constructor_idx 2, reflexivity,
return ()
print "-----"
example (n : ) (H : n ≠ 0) : n > 0 → n = succ (pred n) :=
by do
n ← get_local `n,
induction_core semireducible n `nat.rec [],
trace_state,
intro `H1, contradiction,
intros, reflexivity