2014-11-30 21:16:01 -08:00
|
|
|
import logic data.prod
|
2014-09-28 12:20:42 -07:00
|
|
|
set_option pp.notation false
|
|
|
|
|
2014-10-07 18:02:15 -07:00
|
|
|
inductive C [class] (A : Type) :=
|
2014-09-28 12:20:42 -07:00
|
|
|
mk : A → C A
|
|
|
|
|
|
|
|
definition val {A : Type} (c : C A) : A :=
|
|
|
|
C.rec (λa, a) c
|
|
|
|
|
2014-10-02 16:20:52 -07:00
|
|
|
constant magic (A : Type) : A
|
2014-09-28 12:20:42 -07:00
|
|
|
definition C_magic [instance] [priority max] (A : Type) : C A :=
|
|
|
|
C.mk (magic A)
|
|
|
|
|
|
|
|
definition C_prop [instance] : C Prop :=
|
|
|
|
C.mk true
|
|
|
|
|
|
|
|
definition C_prod [instance] {A B : Type} (Ha : C A) (Hb : C B) : C (prod A B) :=
|
|
|
|
C.mk (pair (val Ha) (val Hb))
|
|
|
|
|
|
|
|
-- C_magic will be used because it has max priority
|
|
|
|
definition test : C (prod Prop Prop) := _
|
|
|
|
|
|
|
|
eval test
|