2014-11-07 08:21:42 -08:00
|
|
|
import logic data.num
|
2014-09-03 16:00:38 -07:00
|
|
|
open tactic inhabited
|
2014-07-08 18:21:22 -07:00
|
|
|
|
2014-09-04 15:03:59 -07:00
|
|
|
namespace foo
|
2014-07-10 13:12:53 +01:00
|
|
|
inductive sum (A : Type) (B : Type) : Type :=
|
2015-02-25 17:00:10 -08:00
|
|
|
| inl : A → sum A B
|
|
|
|
| inr : B → sum A B
|
2014-07-08 18:21:22 -07:00
|
|
|
|
|
|
|
theorem inl_inhabited {A : Type} (B : Type) (H : inhabited A) : inhabited (sum A B)
|
2014-09-04 16:36:06 -07:00
|
|
|
:= inhabited.destruct H (λ a, inhabited.mk (sum.inl B a))
|
2014-07-08 18:21:22 -07:00
|
|
|
|
|
|
|
theorem inr_inhabited (A : Type) {B : Type} (H : inhabited B) : inhabited (sum A B)
|
2014-09-04 16:36:06 -07:00
|
|
|
:= inhabited.destruct H (λ b, inhabited.mk (sum.inr A b))
|
2014-07-08 18:21:22 -07:00
|
|
|
|
2014-10-20 17:10:16 -07:00
|
|
|
infixl `..`:10 := append
|
2014-07-08 18:21:22 -07:00
|
|
|
|
2015-04-27 17:46:13 -07:00
|
|
|
notation `(` h `|` r:(foldl `|` (e r, tactic.or_else r e) h) `)` := r
|
|
|
|
infixl `;`:15 := tactic.and_then
|
|
|
|
|
2014-07-08 18:21:22 -07:00
|
|
|
definition my_tac := repeat (trace "iteration"; state;
|
|
|
|
( apply @inl_inhabited; trace "used inl"
|
|
|
|
.. apply @inr_inhabited; trace "used inr"
|
2014-09-15 10:31:03 -07:00
|
|
|
.. apply @num.is_inhabited; trace "used num")) ; now
|
2014-07-08 18:21:22 -07:00
|
|
|
|
|
|
|
|
2014-10-07 09:44:01 -07:00
|
|
|
tactic_hint my_tac
|
2014-07-08 18:21:22 -07:00
|
|
|
|
2014-09-04 16:36:06 -07:00
|
|
|
theorem T : inhabited (sum false num)
|
2014-09-04 15:03:59 -07:00
|
|
|
|
|
|
|
end foo
|