2014-11-07 16:21:42 +00:00
|
|
|
import logic data.num
|
2014-09-03 23:00:38 +00:00
|
|
|
open tactic inhabited
|
2014-07-08 22:04:52 +00:00
|
|
|
|
2014-09-04 22:03:59 +00:00
|
|
|
namespace foo
|
2014-07-10 12:12:53 +00:00
|
|
|
inductive sum (A : Type) (B : Type) : Type :=
|
2015-02-26 01:00:10 +00:00
|
|
|
| inl : A → sum A B
|
|
|
|
| inr : B → sum A B
|
2014-07-08 22:04:52 +00:00
|
|
|
|
|
|
|
theorem inl_inhabited {A : Type} (B : Type) (H : inhabited A) : inhabited (sum A B)
|
2014-09-04 23:36:06 +00:00
|
|
|
:= inhabited.destruct H (λ a, inhabited.mk (sum.inl B a))
|
2014-07-08 22:04:52 +00:00
|
|
|
|
|
|
|
theorem inr_inhabited (A : Type) {B : Type} (H : inhabited B) : inhabited (sum A B)
|
2014-09-04 23:36:06 +00:00
|
|
|
:= inhabited.destruct H (λ b, inhabited.mk (sum.inr A b))
|
2014-07-08 22:04:52 +00:00
|
|
|
|
2015-04-06 16:24:09 +00:00
|
|
|
definition my_tac := fixpoint (λ t, ( apply @inl_inhabited; t
|
2014-07-08 22:04:52 +00:00
|
|
|
| apply @inr_inhabited; t
|
2014-09-15 17:31:03 +00:00
|
|
|
| apply @num.is_inhabited
|
2015-04-06 16:24:09 +00:00
|
|
|
))
|
2014-07-08 22:04:52 +00:00
|
|
|
|
2014-10-07 16:44:01 +00:00
|
|
|
tactic_hint my_tac
|
2014-07-08 22:04:52 +00:00
|
|
|
|
2014-09-04 23:36:06 +00:00
|
|
|
theorem T : inhabited (sum false num)
|
2014-09-04 22:03:59 +00:00
|
|
|
|
|
|
|
end foo
|