2014-09-28 19:20:42 +00:00
|
|
|
import logic data.prod priority
|
|
|
|
open priority
|
|
|
|
set_option pp.notation false
|
|
|
|
|
2014-10-08 01:02:15 +00:00
|
|
|
inductive C [class] (A : Type) :=
|
2014-09-28 19:20:42 +00:00
|
|
|
mk : A → C A
|
|
|
|
|
|
|
|
definition val {A : Type} (c : C A) : A :=
|
|
|
|
C.rec (λa, a) c
|
|
|
|
|
2014-10-02 23:20:52 +00:00
|
|
|
constant magic (A : Type) : A
|
2014-09-28 19:20:42 +00: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
|