test: add new induction tactic tests
This commit is contained in:
parent
605edd05ae
commit
2be69f1d56
1 changed files with 51 additions and 0 deletions
51
tests/lean/run/induction1.lean
Normal file
51
tests/lean/run/induction1.lean
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
@[recursor 4]
|
||||
def Or.elim2 {p q r : Prop} (major : p ∨ q) (left : p → r) (right : q → r) : r :=
|
||||
Or.elim major left right
|
||||
|
||||
new_frontend
|
||||
|
||||
theorem tst0 {p q : Prop } (h : p ∨ q) : q ∨ p :=
|
||||
begin
|
||||
induction h;
|
||||
{ apply Or.inr; assumption };
|
||||
{ apply Or.inl; assumption }
|
||||
end
|
||||
|
||||
theorem tst1 {p q : Prop } (h : p ∨ q) : q ∨ p :=
|
||||
begin
|
||||
induction h with
|
||||
| inr h2 => Or.inl h2
|
||||
| inl h1 => Or.inr h1
|
||||
end
|
||||
|
||||
theorem tst2 {p q : Prop } (h : p ∨ q) : q ∨ p :=
|
||||
begin
|
||||
induction h using elim2 with
|
||||
| left _ => Or.inr $ by assumption
|
||||
| right _ => Or.inl $ by assumption
|
||||
end
|
||||
|
||||
theorem tst3 {p q : Prop } (h : p ∨ q) : q ∨ p :=
|
||||
begin
|
||||
induction h using elim2 with
|
||||
| right h => Or.inl h
|
||||
| left h => Or.inr h
|
||||
end
|
||||
|
||||
theorem tst4 {p q : Prop } (h : p ∨ q) : q ∨ p :=
|
||||
begin
|
||||
induction h using elim2 with
|
||||
| right h => ?myright
|
||||
| left h => ?myleft;
|
||||
case myleft { exact Or.inr h };
|
||||
case myright { exact Or.inl h };
|
||||
end
|
||||
|
||||
theorem tst5 {p q : Prop } (h : p ∨ q) : q ∨ p :=
|
||||
begin
|
||||
induction h using elim2 with
|
||||
| right h => Or.inl ?myright
|
||||
| left h => Or.inr ?myleft;
|
||||
case myleft assumption;
|
||||
case myright exact h;
|
||||
end
|
||||
Loading…
Add table
Reference in a new issue