-
Notifications
You must be signed in to change notification settings - Fork 0
/
concrete-colineales.agda
212 lines (193 loc) · 7.01 KB
/
concrete-colineales.agda
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
-----------------------------------------------------------------------
-- Definitions of concrete colineales. --
-----------------------------------------------------------------------
module concrete-colineales where
open import prelude
open import colineale
-----------------------------------------------------------------------
-- The lineale 3 --
-----------------------------------------------------------------------
data Three : Set where
zero : Three
half : Three
one : Three
_≤3_ : Three → Three → Set
half ≤3 zero = ⊥
one ≤3 zero = ⊥
one ≤3 half = ⊥
_ ≤3 _ = ⊤
isProset3 : Proset Three
isProset3 = MkProset _≤3_ (λ {a} → aux₁ {a}) (λ{a b c} → aux₂ {a}{b}{c})
where
aux₁ : {a : Three} → a ≤3 a
aux₁ {zero} = triv
aux₁ {half} = triv
aux₁ {one} = triv
aux₂ : {a b c : Three} → a ≤3 b → b ≤3 c → a ≤3 c
aux₂ {zero} {zero} {zero} p₁ p₂ = triv
aux₂ {zero} {zero} {half} p₁ p₂ = triv
aux₂ {zero} {zero} {one} p₁ p₂ = triv
aux₂ {zero} {half} {zero} p₁ p₂ = triv
aux₂ {zero} {half} {half} p₁ p₂ = triv
aux₂ {zero} {half} {one} p₁ p₂ = triv
aux₂ {zero} {one} {zero} p₁ p₂ = triv
aux₂ {zero} {one} {half} p₁ p₂ = triv
aux₂ {zero} {one} {one} p₁ p₂ = triv
aux₂ {half} {zero} {zero} p₁ p₂ = p₁
aux₂ {half} {zero} {half} p₁ p₂ = triv
aux₂ {half} {zero} {one} p₁ p₂ = triv
aux₂ {half} {half} {zero} p₁ p₂ = p₂
aux₂ {half} {half} {half} p₁ p₂ = triv
aux₂ {half} {half} {one} p₁ p₂ = triv
aux₂ {half} {one} {zero} p₁ p₂ = p₂
aux₂ {half} {one} {half} p₁ p₂ = triv
aux₂ {half} {one} {one} p₁ p₂ = triv
aux₂ {one} {zero} {zero} p₁ p₂ = p₁
aux₂ {one} {zero} {half} p₁ p₂ = p₁
aux₂ {one} {zero} {one} p₁ p₂ = triv
aux₂ {one} {half} {zero} p₁ p₂ = p₂
aux₂ {one} {half} {half} p₁ p₂ = p₁
aux₂ {one} {half} {one} p₁ p₂ = p₂
aux₂ {one} {one} {zero} p₁ p₂ = p₂
aux₂ {one} {one} {half} p₁ p₂ = p₂
aux₂ {one} {one} {one} p₁ p₂ = triv
-- Now we define the three element proper colineale; co-intuitionistic and
-- linear:
_⊕3_ : Three → Three → Three
zero ⊕3 zero = zero
zero ⊕3 one = one
one ⊕3 zero = one
one ⊕3 one = one
zero ⊕3 half = zero
half ⊕3 zero = zero
half ⊕3 half = half
half ⊕3 one = one
one ⊕3 half = one
symm3 : {a b : Three} → a ⊕3 b ≡ b ⊕3 a
symm3 {zero} {zero} = refl
symm3 {zero} {half} = refl
symm3 {zero} {one} = refl
symm3 {half} {zero} = refl
symm3 {half} {half} = refl
symm3 {half} {one} = refl
symm3 {one} {zero} = refl
symm3 {one} {half} = refl
symm3 {one} {one} = refl
isMonProset3 : MonProset Three
isMonProset3 = MkMonProset _⊕3_ half isProset3 (λ {a b c} → assoc3 {a}{b}{c}) left-ident3 right-ident3 (λ {a b} → symm3 {a}{b}) (λ {a b} → comp3 {a}{b})
where
assoc3 : {a b c : Three} → a ⊕3 (b ⊕3 c) ≡ (a ⊕3 b) ⊕3 c
assoc3 {zero} {zero} {zero} = refl
assoc3 {zero} {zero} {half} = refl
assoc3 {zero} {zero} {one} = refl
assoc3 {zero} {half} {zero} = refl
assoc3 {zero} {half} {half} = refl
assoc3 {zero} {half} {one} = refl
assoc3 {zero} {one} {zero} = refl
assoc3 {zero} {one} {half} = refl
assoc3 {zero} {one} {one} = refl
assoc3 {half} {zero} {zero} = refl
assoc3 {half} {zero} {half} = refl
assoc3 {half} {zero} {one} = refl
assoc3 {half} {half} {zero} = refl
assoc3 {half} {half} {half} = refl
assoc3 {half} {half} {one} = refl
assoc3 {half} {one} {zero} = refl
assoc3 {half} {one} {half} = refl
assoc3 {half} {one} {one} = refl
assoc3 {one} {zero} {zero} = refl
assoc3 {one} {zero} {half} = refl
assoc3 {one} {zero} {one} = refl
assoc3 {one} {half} {zero} = refl
assoc3 {one} {half} {half} = refl
assoc3 {one} {half} {one} = refl
assoc3 {one} {one} {zero} = refl
assoc3 {one} {one} {half} = refl
assoc3 {one} {one} {one} = refl
left-ident3 : {a : Three} → half ⊕3 a ≡ a
left-ident3 {zero} = refl
left-ident3 {half} = refl
left-ident3 {one} = refl
right-ident3 : {a : Three} → a ⊕3 half ≡ a
right-ident3 {zero} = refl
right-ident3 {half} = refl
right-ident3 {one} = refl
comp3 : {a b : Three} → a ≤3 b → {c : Three} → (a ⊕3 c) ≤3 (b ⊕3 c)
comp3 {zero} {zero} x {zero} = triv
comp3 {zero} {zero} x {half} = triv
comp3 {zero} {zero} x {one} = triv
comp3 {zero} {half} x {zero} = triv
comp3 {zero} {half} x {half} = triv
comp3 {zero} {half} x {one} = triv
comp3 {zero} {one} x {zero} = triv
comp3 {zero} {one} x {half} = triv
comp3 {zero} {one} x {one} = triv
comp3 {half} {zero} x {zero} = triv
comp3 {half} {zero} x {half} = x
comp3 {half} {zero} x {one} = triv
comp3 {half} {half} x {zero} = triv
comp3 {half} {half} x {half} = triv
comp3 {half} {half} x {one} = triv
comp3 {half} {one} x {zero} = triv
comp3 {half} {one} x {half} = triv
comp3 {half} {one} x {one} = triv
comp3 {one} {zero} x {zero} = x
comp3 {one} {zero} x {half} = x
comp3 {one} {zero} x {one} = triv
comp3 {one} {half} x {zero} = x
comp3 {one} {half} x {half} = x
comp3 {one} {half} x {one} = triv
comp3 {one} {one} x {zero} = triv
comp3 {one} {one} x {half} = triv
comp3 {one} {one} x {one} = triv
_-_ : Three → Three → Three
zero - zero = zero
zero - one = one
one - zero = zero
one - one = zero
half - zero = one
zero - half = one
half - one = one
half - half = half
one - half = one
isColineale3 : Colineale Three
isColineale3 = MkColineale isMonProset3 _-_ aux₁ (λ {a b c} → aux₂ {a}{b}{c})
where
aux₁ : (a b : Three) → b ≤3 (a ⊕3 (a - b))
aux₁ zero zero = triv
aux₁ zero half = triv
aux₁ zero one = triv
aux₁ half zero = triv
aux₁ half half = triv
aux₁ half one = triv
aux₁ one zero = triv
aux₁ one half = triv
aux₁ one one = triv
aux₂ : {a b c : Three} → (b - c) ≤3 a → c ≤3 (a ⊕3 b)
aux₂ {zero} {zero} {zero} x = triv
aux₂ {zero} {zero} {half} x = x
aux₂ {zero} {zero} {one} x = x
aux₂ {zero} {half} {zero} x = triv
aux₂ {zero} {half} {half} x = x
aux₂ {zero} {half} {one} x = x
aux₂ {zero} {one} {zero} x = triv
aux₂ {zero} {one} {half} x = triv
aux₂ {zero} {one} {one} x = triv
aux₂ {half} {zero} {zero} x = triv
aux₂ {half} {zero} {half} x = x
aux₂ {half} {zero} {one} x = x
aux₂ {half} {half} {zero} x = triv
aux₂ {half} {half} {half} x = triv
aux₂ {half} {half} {one} x = x
aux₂ {half} {one} {zero} x = triv
aux₂ {half} {one} {half} x = triv
aux₂ {half} {one} {one} x = triv
aux₂ {one} {zero} {zero} x = triv
aux₂ {one} {zero} {half} x = triv
aux₂ {one} {zero} {one} x = triv
aux₂ {one} {half} {zero} x = triv
aux₂ {one} {half} {half} x = triv
aux₂ {one} {half} {one} x = triv
aux₂ {one} {one} {zero} x = triv
aux₂ {one} {one} {half} x = triv
aux₂ {one} {one} {one} x = triv