lean4-htt/tests/lean/induction_tac1.lean
Leonardo de Moura d3c340a30c feat(library/init/meta): improve induction tactic interface
It uses .rec recursor when it is not specified
2017-02-17 10:58:51 -08:00

31 lines
608 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 H [`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 n [`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 n [],
trace_state,
intro `H1, contradiction,
intros, reflexivity