2014-08-25 02:58:48 +00:00
|
|
|
|
import logic data.prod
|
2014-09-04 23:36:06 +00:00
|
|
|
|
open tactic prod
|
2014-07-14 01:53:02 +00:00
|
|
|
|
|
2014-10-08 01:02:15 +00:00
|
|
|
|
inductive inh [class] (A : Type) : Prop :=
|
2014-09-04 23:36:06 +00:00
|
|
|
|
intro : A -> inh A
|
2014-07-14 01:53:02 +00:00
|
|
|
|
|
2015-01-25 04:23:21 +00:00
|
|
|
|
attribute inh.intro [instance]
|
2014-07-14 01:53:02 +00:00
|
|
|
|
|
2014-07-22 16:43:18 +00:00
|
|
|
|
theorem inh_elim {A : Type} {B : Prop} (H1 : inh A) (H2 : A → B) : B
|
2014-09-04 22:03:59 +00:00
|
|
|
|
:= inh.rec H2 H1
|
2014-07-14 01:53:02 +00:00
|
|
|
|
|
2014-09-26 02:46:08 +00:00
|
|
|
|
theorem inh_exists {A : Type} {P : A → Prop} (H : ∃x, P x) : inh A
|
2014-09-04 23:36:06 +00:00
|
|
|
|
:= obtain w Hw, from H, inh.intro w
|
2014-07-14 01:53:02 +00:00
|
|
|
|
|
2014-07-22 16:43:18 +00:00
|
|
|
|
theorem inh_bool [instance] : inh Prop
|
2014-09-04 23:36:06 +00:00
|
|
|
|
:= inh.intro true
|
2014-07-14 01:53:02 +00:00
|
|
|
|
|
2015-02-25 00:10:16 +00:00
|
|
|
|
theorem inh_fun [instance] {A B : Type} [H : inh B] : inh (A → B)
|
2014-09-04 23:36:06 +00:00
|
|
|
|
:= inh.rec (λb, inh.intro (λa : A, b)) H
|
2014-07-14 01:53:02 +00:00
|
|
|
|
|
2015-02-25 00:10:16 +00:00
|
|
|
|
theorem pair_inh [instance] {A : Type} {B : Type} [H1 : inh A] [H2 : inh B] : inh (prod A B)
|
2014-09-04 23:36:06 +00:00
|
|
|
|
:= inh_elim H1 (λa, inh_elim H2 (λb, inh.intro (pair a b)))
|
2014-07-14 01:53:02 +00:00
|
|
|
|
|
|
|
|
|
definition assump := eassumption
|
|
|
|
|
tactic_hint assump
|
|
|
|
|
|
|
|
|
|
theorem tst {A B : Type} (H : inh B) : inh (A → B → B)
|
2015-12-08 22:58:08 +00:00
|
|
|
|
set_option trace.class_instances true
|
2014-07-14 01:53:02 +00:00
|
|
|
|
|
2014-09-26 02:46:08 +00:00
|
|
|
|
theorem T1 {A B C D : Type} {P : C → Prop} (a : A) (H1 : inh B) (H2 : ∃x, P x) : inh ((A → A) × B × (D → C) × Prop) :=
|
|
|
|
|
have h1 [visible] : inh A, from inh.intro a,
|
|
|
|
|
have h2 [visible] : inh C, from inh_exists H2,
|
|
|
|
|
_
|
2014-07-14 01:53:02 +00:00
|
|
|
|
|
2015-05-09 03:54:16 +00:00
|
|
|
|
reveal T1
|
2014-07-14 01:53:02 +00:00
|
|
|
|
(*
|
|
|
|
|
print(get_env():find("T1"):value())
|
2014-09-03 23:00:38 +00:00
|
|
|
|
*)
|