315
|
1 open import Level
|
|
2 open import Relation.Binary.PropositionalEquality
|
|
3
|
|
4 module system-f {l : Level} where
|
|
5
|
|
6 postulate A : Set
|
|
7 postulate B : Set
|
|
8
|
|
9 data _∨_ (A B : Set) : Set where
|
|
10 or1 : A -> A ∨ B
|
|
11 or2 : B -> A ∨ B
|
|
12
|
|
13 lemma01 : A -> A ∨ B
|
|
14 lemma01 a = or1 a
|
|
15
|
|
16 lemma02 : B -> A ∨ B
|
|
17 lemma02 b = or2 b
|
|
18
|
|
19 lemma03 : {C : Set} -> (A ∨ B) -> (A -> C) -> (B -> C) -> C
|
|
20 lemma03 (or1 a) ac bc = ac a
|
|
21 lemma03 (or2 b) ac bc = bc b
|
|
22
|
|
23 postulate U : Set l
|
|
24 postulate V : Set l
|
|
25
|
|
26
|
|
27 Bool = {X : Set l} -> X -> X -> X
|
|
28
|
|
29 T : Bool
|
|
30 T = \{X : Set l} -> \(x y : X) -> x
|
|
31
|
|
32 F : Bool
|
|
33 F = \{X : Set l} -> \(x y : X) -> y
|
|
34
|
|
35 D : {U : Set l} -> U -> U -> Bool -> U
|
|
36 D {U} u v t = t {U} u v
|
|
37
|
|
38 lemma04 : {u v : U} -> D u v T ≡ u
|
|
39 lemma04 = refl
|
|
40
|
|
41 lemma05 : {u v : U} -> D u v F ≡ v
|
|
42 lemma05 = refl
|
|
43
|
321
|
44 _×_ : {l : Level} -> Set l -> Set l -> Set (suc l)
|
|
45 _×_ {l} U V = {X : Set l} -> (U -> V -> X) -> X
|
315
|
46
|
321
|
47 <_,_> : {l : Level} {U V : Set l} -> U -> V -> (U × V)
|
|
48 <_,_> {l} {U} {V} u v = \{X} -> \(x : U -> V -> X) -> x u v
|
315
|
49
|
321
|
50 π1 : {l : Level} {U V : Set l} -> (U × V) -> U
|
|
51 π1 {l} {U} {V} t = t {U} (\(x : U) -> \(y : V) -> x)
|
315
|
52
|
321
|
53 π2 : {l : Level} {U V : Set l} -> (U × V) -> V
|
|
54 π2 {l} {U} {V} t = t {V} (\(x : U) -> \(y : V) -> y)
|
315
|
55
|
|
56 lemma06 : {U V : Set l } -> {u : U } -> {v : V} -> π1 ( < u , v > ) ≡ u
|
|
57 lemma06 = refl
|
|
58
|
|
59 lemma07 : {U V : Set l } -> {u : U } -> {v : V} -> π2 ( < u , v > ) ≡ v
|
|
60 lemma07 = refl
|
|
61
|
|
62 hoge : {U V : Set l} -> U -> V -> (U × V)
|
|
63 hoge u v = < u , v >
|
|
64
|
|
65 -- lemma08 : (t : U × V) -> < π1 t , π2 t > ≡ t
|
|
66 -- lemma08 t = {!!}
|
316
|
67
|
|
68 -- Emp definision is still wrong...
|
|
69
|
321
|
70 Emp : ∀{l : Level} {X : Set l} -> Set l
|
320
|
71 Emp {l} = \{X : Set l} -> X
|
316
|
72
|
321
|
73 ε : {l : Level} {U : Set l} -> Emp -> Emp
|
|
74 ε {l} {U} t = t {l} {U}
|
316
|
75
|
321
|
76 lemma09 : {l : Level} {U : Set l} -> (t : Emp) -> ε U (ε Emp t) ≡ ε U t
|
|
77 lemma09 t = refl
|
|
78
|
|
79 lemma10 : {l : Level} {U V X : Set l} -> (t : Emp ) -> (U × V)
|
|
80 lemma10 {l} {U} {V} t = ε (U × V) t
|
316
|
81
|
321
|
82 lemma100 : {l : Level} {U V X : Set l} -> (t : Emp ) -> Emp
|
|
83 lemma100 {l} {U} {V} t = ε U t
|
|
84
|
|
85 lemma101 : {l k : Level} {U V : Set l} -> (t : Emp ) -> π1 (ε (U × V) t) ≡ ε U t
|
|
86 lemma101 t = refl
|
319
|
87
|
321
|
88 lemma102 : {l k : Level} {U V : Set l} -> (t : Emp ) -> π2 (ε (U × V) t) ≡ ε V t
|
|
89 lemma102 t = refl
|
|
90
|
|
91 lemma103 : {l : Level} {U V : Set l} -> (u : U) -> (t : Emp) -> ε (U -> V) u ≡ ε V t
|
|
92 lemma103 u t = refl
|
316
|
93
|
|
94 _+_ : Set l -> Set l -> Set (suc l)
|
|
95 U + V = {X : Set l} -> ( U -> X ) -> (V -> X) -> X
|
|
96
|
|
97 ι1 : {U V : Set l} -> U -> U + V
|
|
98 ι1 {U} {V} u = \{X} -> \(x : U -> X) -> \(y : V -> X ) -> x u
|
|
99
|
|
100 ι2 : {U V : Set l} -> V -> U + V
|
|
101 ι2 {U} {V} v = \{X} -> \(x : U -> X) -> \(y : V -> X ) -> y v
|
|
102
|
317
|
103 δ : { U V R S : Set l } -> (R -> U) -> (S -> U) -> ( R + S ) -> U
|
|
104 δ {U} {V} {R} {S} u v t = t {U} (\(x : R) -> u x) ( \(y : S) -> v y)
|
316
|
105
|
317
|
106 lemma11 : { U V R S : Set l } -> (u : R -> U ) (v : S -> U ) -> (r : R) -> δ {U} {V} {R} {S} u v ( ι1 r ) ≡ u r
|
316
|
107 lemma11 u v r = refl
|
|
108
|
317
|
109 lemma12 : { U V R S : Set l } -> (u : R -> U ) (v : S -> U ) -> (s : S) -> δ {U} {V} {R} {S} u v ( ι2 s ) ≡ v s
|
316
|
110 lemma12 u v s = refl
|
|
111
|
|
112
|
|
113
|
|
114
|
|
115
|
|
116
|
|
117
|
|
118
|
|
119
|
|
120
|
|
121
|
|
122
|
|
123
|