/
setquot.ctt
371 lines (295 loc) · 20.2 KB
/
setquot.ctt
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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
-- Formalization of (impredicative) set quotients
module setquot where
import bool
import sigma
import pi
import univalence
subtypeEquality (A : U) (B : A -> U) (pB : (x : A) -> prop (B x))
(s t : (x : A) * B x) : Path A s.1 t.1 -> Path (Sigma A B) s t =
trans (Path A s.1 t.1) (Path (Sigma A B) s t) rem
where
rem : Path U (Path A s.1 t.1) (Path (Sigma A B) s t) =
<i> lemSigProp A B pB s t @ -i
-- (* Propositions *)
hProp : U = (X : U) * prop X
ishinh_UU (X : U) : U = (P : hProp) -> ((X -> P.1) -> P.1)
propishinh (X : U) : prop (ishinh_UU X) =
propPi hProp (\(P : hProp) -> ((X -> P.1) -> P.1)) rem1
where
rem1 (P : hProp) : prop ((X -> P.1) -> P.1) =
propPi (X -> P.1) (\(_ : X -> P.1) -> P.1) (\(f : X -> P.1) -> P.2)
ishinh (X : U) : hProp = (ishinh_UU X,propishinh X)
hinhpr (X : U) : X -> (ishinh X).1 =
\(x : X) (P : hProp) (f : X -> P.1) -> f x
hinhuniv (X : U) (P : hProp) (f : X -> P.1) (inhX : (ishinh X).1) : P.1 =
inhX P f
hdisj (P Q : U) : hProp = ishinh (or P Q)
hdisj_in1 (P Q : U) (X : P) : (hdisj P Q).1 = hinhpr (or P Q) (inl X)
hdisj_in2 (P Q : U) (X : Q) : (hdisj P Q).1 = hinhpr (or P Q) (inr X)
-- Direct proof that logical equivalence is equiv for props
isEquivprop (A B : U) (f : A -> B) (g : B -> A) (pA : prop A) (pB : prop B) : isEquiv A B f = rem
where
rem (y : B) : isContr (fiber A B f y) = (s,t)
where
s : fiber A B f y = (g y,pB y (f (g y)))
t (w : fiber A B f y) : Path ((x : A) * Path B y (f x)) s w =
subtypeEquality A (\(x : A) -> Path B y (f x)) pb s w r1
where
pb (x : A) : (a b : Path B y (f x)) -> Path (Path B y (f x)) a b = propSet B pB y (f x)
r1 : Path A s.1 w.1 = pA s.1 w.1
equivhProp (P P' : hProp) (f : P.1 -> P'.1) (g : P'.1 -> P.1) : equiv P.1 P'.1 =
(f,isEquivprop P.1 P'.1 f g P.2 P'.2)
-- Proof of uahp using full univalence
uahp' (P P' : hProp) (f : P.1 -> P'.1) (g : P'.1 -> P.1) : Path hProp P P' =
subtypeEquality U prop propIsProp P P' rem
where
rem : Path U P.1 P'.1 = transport (<i> corrUniv P.1 P'.1 @ -i) (equivhProp P P' f g)
-- Direct proof of uahp
uahp (P P' : hProp) (f : P.1 -> P'.1) (g : P'.1 -> P.1) : Path hProp P P' =
subtypeEquality U prop propIsProp P P' rem
where
rem : Path U P.1 P'.1 = isoPath P.1 P'.1 f g s t
where s (y : P'.1) : Path P'.1 (f (g y)) y = P'.2 (f (g y)) y
t (x : P.1) : Path P.1 (g (f x)) x = P.2 (g (f x)) x
-- A short proof that hProp form a set using univalence: (this is not needed!)
propequiv (X Y : U) (H : prop Y) (f g : equiv X Y) : Path (equiv X Y) f g =
equivLemma X Y f g (<i> \(x : X) -> H (f.1 x) (g.1 x) @ i)
propidU (X Y : U) : Path U X Y -> prop Y -> prop X = substInv U prop X Y
sethProp (P P' : hProp) : prop (Path hProp P P') =
propidU (Path hProp P P') (equiv P.1 P'.1) rem (propequiv P.1 P'.1 P'.2)
where
rem1 : Path U (Path hProp P P') (Path U P.1 P'.1) = lemSigProp U prop propIsProp P P'
rem2 : Path U (Path U P.1 P'.1) (equiv P.1 P'.1) = corrUniv P.1 P'.1
rem : Path U (Path hProp P P') (equiv P.1 P'.1) =
compPath U (Path hProp P P') (Path U P.1 P'.1) (equiv P.1 P'.1) rem1 rem2
-- (* Sets *)
hsubtypes (X : U) : U = X -> hProp
carrier (X : U) (A : hsubtypes X) : U = (x : X) * (A x).1
sethsubtypes (X : U) : set (hsubtypes X) =
setPi X (\(_ : X) -> hProp) (\(_ : X) -> sethProp)
-- Definition hrel (X : UU) := X -> X -> hProp.
hrel (X : U) : U = X -> X -> hProp
iseqclass (X : U) (R : hrel X) (A : hsubtypes X) : U =
and (and (ishinh (carrier X A)).1
((x1 x2 : X) -> (R x1 x2).1 -> (A x1).1 -> (A x2).1))
((x1 x2 : X) -> (A x1).1 -> (A x2).1 -> (R x1 x2).1)
eqax0 (X : U) (R : hrel X) (A : hsubtypes X) (eqc : iseqclass X R A) :
(ishinh (carrier X A)).1 = eqc.1.1
eqax1 (X : U) (R : hrel X) (A : hsubtypes X) (eqc : iseqclass X R A) :
(x1 x2 : X) -> (R x1 x2).1 -> (A x1).1 -> (A x2).1 = eqc.1.2
eqax2 (X : U) (R : hrel X) (A : hsubtypes X) (eqc : iseqclass X R A) :
(x1 x2 : X) -> (A x1).1 -> (A x2).1 -> (R x1 x2).1 = eqc.2
propiseqclass (X : U) (R : hrel X) (A : hsubtypes X) : prop (iseqclass X R A) =
propAnd (and (ishinh (carrier X A)).1
((x1 x2 : X) -> (R x1 x2).1 -> (A x1).1 -> (A x2).1))
((x1 x2 : X) -> (A x1).1 -> (A x2).1 -> (R x1 x2).1)
(propAnd (ishinh (carrier X A)).1
((x1 x2 : X) -> (R x1 x2).1 -> (A x1).1 -> (A x2).1) p1 p2)
p3
where
p1 : prop (ishinh (carrier X A)).1 = propishinh (carrier X A)
-- This proof is quite cool, but it looks ugly...
p2 (f g : (x1 x2 : X) -> (R x1 x2).1 -> (A x1).1 -> (A x2).1) :
Path ((x1 x2 : X) -> (R x1 x2).1 -> (A x1).1 -> (A x2).1) f g =
<i> \(x1 x2 : X) (h1 : (R x1 x2).1) (h2 : (A x1).1) ->
(A x2).2 (f x1 x2 h1 h2) (g x1 x2 h1 h2) @ i
p3 (f g : (x1 x2 : X) -> (A x1).1 -> (A x2).1 -> (R x1 x2).1) :
Path ((x1 x2 : X) -> (A x1).1 -> (A x2).1 -> (R x1 x2).1) f g =
<i> \(x1 x2 : X) (h1 : (A x1).1) (h2 : (A x2).1) ->
(R x1 x2).2 (f x1 x2 h1 h2) (g x1 x2 h1 h2) @ i
hSet : U = (X : U) * set X
isrefl (X : U) (R : hrel X) : U = (x : X) -> (R x x).1
issymm (X : U) (R : hrel X) : U = (x1 x2 : X) -> (R x1 x2).1 -> (R x2 x1).1
istrans (X : U) (R : hrel X) : U =
(x1 x2 x3 : X) -> (R x1 x2).1 -> (R x2 x3).1 -> (R x1 x3).1
ispreorder (X : U) (R : hrel X) : U = and (istrans X R) (isrefl X R)
iseqrel (X : U) (R : hrel X) : U = and (ispreorder X R) (issymm X R)
eqrel (X : U) : U = (R : hrel X) * (iseqrel X R)
eqrelrefl (X : U) (R : eqrel X) : isrefl X R.1 = R.2.1.2
eqrelsymm (X : U) (R : eqrel X) : issymm X R.1 = R.2.2
eqreltrans (X : U) (R : eqrel X) : istrans X R.1 = R.2.1.1
boolset : hSet = (bool,setbool)
setquot (X : U) (R : hrel X) : U = (A : hsubtypes X) * (iseqclass X R A)
pr1setquot (X : U) (R : hrel X) (Q : setquot X R) : hsubtypes X = Q.1
setquotpr (X : U) (R : eqrel X) (X0 : X) : setquot X R.1 = (A,((p1,p2),p3))
where
rax : isrefl X R.1 = eqrelrefl X R
sax : issymm X R.1 = eqrelsymm X R
tax : istrans X R.1 = eqreltrans X R
A : hsubtypes X = \(x : X) -> R.1 X0 x
p1 : (ishinh (carrier X A)).1 = hinhpr (carrier X A) (X0,rax X0)
p2 (x1 x2 : X) (X1 : (R.1 x1 x2).1) (X2 : (A x1).1) : (A x2).1 = tax X0 x1 x2 X2 X1
p3 (x1 x2 : X) (X1 : (A x1).1) (X2 : (A x2).1) : (R.1 x1 x2).1 = tax x1 X0 x2 (sax X0 x1 X1) X2
setquotl0 (X : U) (R : eqrel X) (c : setquot X R.1) (x : carrier X c.1) :
Path (setquot X R.1) (setquotpr X R x.1) c = subtypeEquality (hsubtypes X) (iseqclass X R.1) p (setquotpr X R x.1) c rem
where
p (A : hsubtypes X) : prop (iseqclass X R.1 A) = propiseqclass X R.1 A
rem : Path (hsubtypes X) (setquotpr X R x.1).1 c.1 = <i> \(x : X) -> (rem' x) @ i -- inlined use of funext
where rem' (a : X) : Path hProp ((setquotpr X R x.1).1 a) (c.1 a) =
uahp' ((setquotpr X R x.1).1 a) (c.1 a) l2r r2l -- This is where uahp appears
where
l2r (r : ((setquotpr X R x.1).1 a).1) : (c.1 a).1 = eqax1 X R.1 c.1 c.2 x.1 a r x.2
r2l : (c.1 a).1 -> ((setquotpr X R x.1).1 a).1 = eqax2 X R.1 c.1 c.2 x.1 a x.2
setquotunivprop (X : U) (R : eqrel X) (P : setquot X R.1 -> hProp)
(ps : (x : X) -> (P (setquotpr X R x)).1) (c : setquot X R.1) : (P c).1 = hinhuniv (carrier X c.1) (P c) f rem
where
f (x : carrier X c.1) : (P c).1 =
let e : Path (setquot X R.1) (setquotpr X R x.1) c = setquotl0 X R c x
in subst (setquot X R.1) (\(w : setquot X R.1) -> (P w).1) (setquotpr X R x.1) c e (ps x.1)
rem : (ishinh (carrier X c.1)).1 = eqax0 X R.1 c.1 c.2
setquotuniv2prop (X : U) (R : eqrel X) (P : setquot X R.1 -> setquot X R.1 -> hProp)
(ps : (x x' : X) -> (P (setquotpr X R x) (setquotpr X R x')).1) (c c' : setquot X R.1) : (P c c').1 =
setquotunivprop X R (\ (c0' : setquot X R.1) -> P c c0')
(\ (x : X) -> setquotunivprop X R (\ (c0 : setquot X R.1) -> P c0 (setquotpr X R x))
(\ (x0 : X) -> ps x0 x) c) c'
setsetquot (X : U) (R : hrel X) : set (setquot X R) =
setSig (hsubtypes X) (\(A : hsubtypes X) -> iseqclass X R A)
sA sB
where
sA : set (hsubtypes X) = sethsubtypes X
sB (x : hsubtypes X) : set (iseqclass X R x) = propSet (iseqclass X R x) (propiseqclass X R x)
iscompsetquotpr (X : U) (R : eqrel X) (x x' : X) (a : (R.1 x x').1) :
Path (setquot X R.1) (setquotpr X R x) (setquotpr X R x') =
subtypeEquality (hsubtypes X) (iseqclass X R.1) rem1 (setquotpr X R x) (setquotpr X R x') rem2
where
rem1 (x : hsubtypes X) : prop (iseqclass X R.1 x) = propiseqclass X R.1 x
rem2 : Path (hsubtypes X) (setquotpr X R x).1 (setquotpr X R x').1 =
<i> \(x0 : X) -> rem x0 @ i
where
rem (x0 : X) : Path hProp (R.1 x x0) (R.1 x' x0) = uahp' (R.1 x x0) (R.1 x' x0) f g
where
f (r0 : (R.1 x x0).1) : (R.1 x' x0).1 =
eqreltrans X R x' x x0 (eqrelsymm X R x x' a) r0
g (r0 : (R.1 x' x0).1) : (R.1 x x0).1 =
eqreltrans X R x x' x0 a r0
weqpathsinsetquot (X : U) (R : eqrel X) (x x' : X) :
equiv (R.1 x x').1 (Path (setquot X R.1) (setquotpr X R x) (setquotpr X R x')) =
(iscompsetquotpr X R x x',rem)
where
rem : isEquiv (R.1 x x').1
(Path (setquot X R.1) (setquotpr X R x) (setquotpr X R x'))
(iscompsetquotpr X R x x') =
isEquivprop (R.1 x x').1
(Path (setquot X R.1) (setquotpr X R x) (setquotpr X R x'))
(iscompsetquotpr X R x x')
g pA pB
where g (e : Path (setquot X R.1) (setquotpr X R x) (setquotpr X R x')) :
(R.1 x x').1 = transport (<i> (rem1 @ i).1) rem
where
rem : (R.1 x' x').1 = eqrelrefl X R x'
rem2 : Path hProp (R.1 x x') (R.1 x' x') = <i> (e @ i).1 x'
rem1 : Path hProp (R.1 x' x') (R.1 x x') = <i> rem2 @ -i
pA : prop (R.1 x x').1 = (R.1 x x').2
pB : prop (Path (setquot X R.1) (setquotpr X R x) (setquotpr X R x')) =
setsetquot X R.1 (setquotpr X R x) (setquotpr X R x')
isdecprop (X : U) : U = and (prop X) (dec X)
propisdecprop (X : U): prop (isdecprop X) =
propSig (prop X) (\ (_ : prop X) -> dec X) rem1 rem2
where
rem1 : prop (prop X) = propIsProp X
rem2 : prop X -> prop (dec X) = propDec X
isdeceqif (X : U) (h : (x x' : X) -> isdecprop (Path X x x')) : discrete X =
\(x x' : X) -> (h x x').2
propEquiv (X Y : U) (w : equiv X Y) : prop X -> prop Y = subst U prop X Y rem
where
rem : Path U X Y = transport (<i> corrUniv X Y @ -i) w
isdecpropweqf (X Y : U) (w : equiv X Y) (hX : isdecprop X) : isdecprop Y = (rem1,rem2 hX.2)
where
rem1 : prop Y = propEquiv X Y w hX.1
rem2 : dec X -> dec Y = split
inl x -> inl (w.1 x)
inr nx -> inr (\(y : Y) -> nx (invEq X Y w y))
isdiscretesetquot (X : U) (R : eqrel X) (is : (x x' : X) -> isdecprop (R.1 x x').1) :
discrete (setquot X R.1) = isdeceqif (setquot X R.1) rem
where
rem : (x x' : setquot X R.1) -> isdecprop (Path (setquot X R.1) x x') =
setquotuniv2prop X R
(\(x0 x0' : setquot X R.1) -> (isdecprop (Path (setquot X R.1) x0 x0'),
propisdecprop (Path (setquot X R.1) x0 x0'))) rem'
where
rem' (x0 x0' : X) : isdecprop (Path (setquot X R.1) (setquotpr X R x0) (setquotpr X R x0')) =
isdecpropweqf (R.1 x0 x0').1 (Path (setquot X R.1) (setquotpr X R x0) (setquotpr X R x0'))
(weqpathsinsetquot X R x0 x0') (is x0 x0')
discretetobool (X : U) (h : discrete X) (x y : X) : bool = rem (h x y)
where
rem : dec (Path X x y) -> bool = split
inl _ -> true
inr _ -> false
-- The bool exercise:
R : eqrel bool = (r1,r2)
where
r1 : hrel bool = \(x y : bool) -> (Path bool x y,setbool x y)
r2 : iseqrel bool r1 = ((compPath bool,refl bool),inv bool)
bool' : U = setquot bool R.1
true' : bool' = setquotpr bool R true
false' : bool' = setquotpr bool R false
P' (t : bool') : hProp =
hdisj (Path bool' t true') (Path bool' t false')
K' (t : bool') : (P' t).1 = setquotunivprop bool R P' ps t
where
ps : (x : bool) -> (P' (setquotpr bool R x)).1 = split
false -> hdisj_in2 (Path bool' false' true')
(Path bool' false' false') (<_> false')
true -> hdisj_in1 (Path bool' true' true')
(Path bool' true' false') (<_> true')
test : (P' true').1 = hdisj_in1 (Path bool' true' true')
(Path bool' true' false') (<_> true')
test' : (P' true').1 = K' true'
-- test'' : Path (P' true').1 test test' = (P' true').2 test test'
-- These two terms are not convertible:
-- test' : Path (P' true').1 (K' true')
-- (hdisj_in1 (Path (setquot bool R.1) true' true') (Path (setquot bool R.1) true' false') (<_> true')) =
-- <_> K' true'
-- Another test:
true'neqfalse' (H : Path bool' true' false') : N0 = falseNeqTrue rem1
where
rem : Path U (Path bool true true) (Path bool false true) = <i> ((H @ i).1 true).1
rem1 : Path bool false true = comp rem (<_> true) []
test1 (x : bool') (H1 : Path bool' x true') (H2 : Path bool' x false') : N0 = true'neqfalse' rem
where
rem : Path bool' true' false' = <i> comp (<_> bool') x [(i = 0) -> H1, (i = 1) -> H2]
test2 (x : bool') (p1 : (ishinh (Path bool' x true')).1)
(p2 : (ishinh (Path bool' x false')).1) : N0 =
hinhuniv (Path bool' x true') (N0,propN0) rem p1
where
rem (H1 : Path bool' x true') : N0 =
hinhuniv (Path bool' x false') (N0,propN0)
(\(H2 : Path bool' x false') -> test1 x H1 H2) p2
-- shorthand for this big type
T (x : bool') : U = or (ishinh (Path bool' x true')).1 (ishinh (Path bool' x false')).1
-- test3 (x : bool') : prop (T x)
test3 (x : bool') : (a b : T x) -> Path (T x) a b = split
inl a' -> rem
where
rem : (b : T x) -> Path (T x) (inl a') b = split
inl b' -> <i> inl (propishinh (Path bool' x true') a' b' @ i)
inr b' -> efq (Path (T x) (inl a') (inr b')) (test2 x a' b')
inr a' -> rem
where
rem : (b : T x) -> Path (T x) (inr a') b = split
inl b' -> efq (Path (T x) (inr a') (inl b')) (test2 x b' a')
inr b' -> <i> inr (propishinh (Path bool' x false') a' b' @ i)
f (x : bool') : or (ishinh (Path bool' x true')).1 (ishinh (Path bool' x false')).1 -> bool = split
inl _ -> true
inr _ -> false
bar (x : bool') : or (Path bool' x true') (Path bool' x false') ->
or (ishinh (Path bool' x true')).1 (ishinh (Path bool' x false')).1 = split
inl p -> inl (hinhpr (Path bool' x true') p)
inr p -> inr (hinhpr (Path bool' x false') p)
-- finally the map:
foo (x : bool') (x' : (P' x).1) : bool = f x rem
where
rem : or (ishinh (Path bool' x true')).1 (ishinh (Path bool' x false')).1 =
hinhuniv (or (Path bool' x true') (Path bool' x false'))
(or (ishinh (Path bool' x true')).1 (ishinh (Path bool' x false')).1,test3 x)
(bar x) x'
-- > :n testfoo
-- NORMEVAL: true
-- Time: 0m0.490s
testfoo : bool = foo true' (K' true')
testfoo' : Path bool (foo true' (K' true')) true = <i> foo true' (K' true')
-- Tests of checking normal forms:
ntrue' : bool' = (\(x : bool) -> (PathP (<i0> bool) true x,lem8 x),((\(P : Sigma U (\(X : U) -> (a b : X) -> PathP (<i0> X) a b)) -> \(f : (Sigma bool (\(x : bool) -> PathP (<i0> bool) true x)) -> P.1) -> f ((true,<i0> true)),\(x1 x2 : bool) -> \(X1 : PathP (<i0> bool) x1 x2) -> \(X2 : PathP (<i0> bool) true x1) -> <i0> comp (<i1> bool) (X2 @ i0) [ (i0 = 0) -> <i1> true, (i0 = 1) -> <i1> X1 @ i1 ]),\(x1 x2 : bool) -> \(X1 : PathP (<i0> bool) true x1) -> \(X2 : PathP (<i0> bool) true x2) -> <i0> comp (<i1> bool) (X1 @ -i0) [ (i0 = 0) -> <i1> x1, (i0 = 1) -> <i1> X2 @ i1 ]))
nhdisj_in1 : (P Q : U) (X : P) -> (hdisj P Q).1 =
\(P Q : U) -> \(X : P) -> \(P0 : Sigma U (\(X0 : U) -> (a b : X0) -> PathP (<!0> X0) a b)) -> \(f : or P Q -> P0.1) -> f (inl X)
ntest : (P' true').1 = \(P : Sigma U (\(X : U) -> (a b : X) -> PathP (<!0> X) a b)) -> \(f : or (PathP (<!0> Sigma (bool -> (Sigma U (\(X : U) -> (a b : X) -> PathP (<!0> X) a b))) (\(A : bool -> (Sigma U (\(X : U) -> (a b : X) -> PathP (<!0> X) a b))) -> Sigma (Sigma ((P0 : Sigma U (\(X : U) -> (a b : X) -> PathP (<!0> X) a b)) -> ((Sigma bool (\(x : bool) -> (A x).1)) -> P0.1) -> P0.1) (\(_ : (P0 : Sigma U (\(X : U) -> (a b : X) -> PathP (<!0> X) a b)) -> ((Sigma bool (\(x : bool) -> (A x).1)) -> P0.1) -> P0.1) -> (x1 x2 : bool) -> (PathP (<!0> bool) x1 x2) -> ((A x1).1 -> (A x2).1))) (\(_ : Sigma ((P0 : Sigma U (\(X : U) -> (a b : X) -> PathP (<!0> X) a b)) -> ((Sigma bool (\(x : bool) -> (A x).1)) -> P0.1) -> P0.1) (\(_ : (P0 : Sigma U (\(X : U) -> (a b : X) -> PathP (<!0> X) a b)) -> ((Sigma bool (\(x : bool) -> (A x).1)) -> P0.1) -> P0.1) -> (x1 x2 : bool) -> (PathP (<!0> bool) x1 x2) -> ((A x1).1 -> (A x2).1))) -> (x1 x2 : bool) -> (A x1).1 -> ((A x2).1 -> (PathP (<!0> bool) x1 x2))))) ((\(x : bool) -> (PathP (<!0> bool) true x,lem8 x),((\(P0 : Sigma U (\(X : U) -> (a b : X) -> PathP (<!0> X) a b)) -> \(f : (Sigma bool (\(x : bool) -> PathP (<!0> bool) true x)) -> P0.1) -> f ((true,<!0> true)),\(x1 x2 : bool) -> \(X1 : PathP (<!0> bool) x1 x2) -> \(X2 : PathP (<!0> bool) true x1) -> <!0> comp (<!1> bool) (X2 @ !0) [ (!0 = 0) -> <!1> true, (!0 = 1) -> <!1> X1 @ !1 ]),\(x1 x2 : bool) -> \(X1 : PathP (<!0> bool) true x1) -> \(X2 : PathP (<!0> bool) true x2) -> <!0> comp (<!1> bool) (X1 @ -!0) [ (!0 = 0) -> <!1> x1, (!0 = 1) -> <!1> X2 @ !1 ]))) ((\(x : bool) -> (PathP (<!0> bool) true x,lem8 x),((\(P0 : Sigma U (\(X : U) -> (a b : X) -> PathP (<!0> X) a b)) -> \(f : (Sigma bool (\(x : bool) -> PathP (<!0> bool) true x)) -> P0.1) -> f ((true,<!0> true)),\(x1 x2 : bool) -> \(X1 : PathP (<!0> bool) x1 x2) -> \(X2 : PathP (<!0> bool) true x1) -> <!0> comp (<!1> bool) (X2 @ !0) [ (!0 = 0) -> <!1> true, (!0 = 1) -> <!1> X1 @ !1 ]),\(x1 x2 : bool) -> \(X1 : PathP (<!0> bool) true x1) -> \(X2 : PathP (<!0> bool) true x2) -> <!0> comp (<!1> bool) (X1 @ -!0) [ (!0 = 0) -> <!1> x1, (!0 = 1) -> <!1> X2 @ !1 ])))) PathP (<!0> Sigma (bool -> (Sigma U (\(X : U) -> (a b : X) -> PathP (<!0> X) a b))) (\(A : bool -> (Sigma U (\(X : U) -> (a b : X) -> PathP (<!0> X) a b))) -> Sigma (Sigma ((P0 : Sigma U (\(X : U) -> (a b : X) -> PathP (<!0> X) a b)) -> ((Sigma bool (\(x : bool) -> (A x).1)) -> P0.1) -> P0.1) (\(_ : (P0 : Sigma U (\(X : U) -> (a b : X) -> PathP (<!0> X) a b)) -> ((Sigma bool (\(x : bool) -> (A x).1)) -> P0.1) -> P0.1) -> (x1 x2 : bool) -> (PathP (<!0> bool) x1 x2) -> ((A x1).1 -> (A x2).1))) (\(_ : Sigma ((P0 : Sigma U (\(X : U) -> (a b : X) -> PathP (<!0> X) a b)) -> ((Sigma bool (\(x : bool) -> (A x).1)) -> P0.1) -> P0.1) (\(_ : (P0 : Sigma U (\(X : U) -> (a b : X) -> PathP (<!0> X) a b)) -> ((Sigma bool (\(x : bool) -> (A x).1)) -> P0.1) -> P0.1) -> (x1 x2 : bool) -> (PathP (<!0> bool) x1 x2) -> ((A x1).1 -> (A x2).1))) -> (x1 x2 : bool) -> (A x1).1 -> ((A x2).1 -> (PathP (<!0> bool) x1 x2))))) ((\(x : bool) -> (PathP (<!0> bool) true x,lem8 x),((\(P0 : Sigma U (\(X : U) -> (a b : X) -> PathP (<!0> X) a b)) -> \(f : (Sigma bool (\(x : bool) -> PathP (<!0> bool) true x)) -> P0.1) -> f ((true,<!0> true)),\(x1 x2 : bool) -> \(X1 : PathP (<!0> bool) x1 x2) -> \(X2 : PathP (<!0> bool) true x1) -> <!0> comp (<!1> bool) (X2 @ !0) [ (!0 = 0) -> <!1> true, (!0 = 1) -> <!1> X1 @ !1 ]),\(x1 x2 : bool) -> \(X1 : PathP (<!0> bool) true x1) -> \(X2 : PathP (<!0> bool) true x2) -> <!0> comp (<!1> bool) (X1 @ -!0) [ (!0 = 0) -> <!1> x1, (!0 = 1) -> <!1> X2 @ !1 ]))) ((\(x : bool) -> (PathP (<!0> bool) false x,lem7 x),((\(P0 : Sigma U (\(X : U) -> (a b : X) -> PathP (<!0> X) a b)) -> \(f : (Sigma bool (\(x : bool) -> PathP (<!0> bool) false x)) -> P0.1) -> f ((false,<!0> false)),\(x1 x2 : bool) -> \(X1 : PathP (<!0> bool) x1 x2) -> \(X2 : PathP (<!0> bool) false x1) -> <!0> comp (<!1> bool) (X2 @ !0) [ (!0 = 0) -> <!1> false, (!0 = 1) -> <!1> X1 @ !1 ]),\(x1 x2 : bool) -> \(X1 : PathP (<!0> bool) false x1) -> \(X2 : PathP (<!0> bool) false x2) -> <!0> comp (<!1> bool) (X1 @ -!0) [ (!0 = 0) -> <!1> x1, (!0 = 1) -> <!1> X2 @ !1 ]))) -> P.1) -> f (inl (<!0> (\(x : bool) -> (PathP (<!0> bool) true x,lem8 x),((\(P0 : Sigma U (\(X : U) -> (a b : X) -> PathP (<!0> X) a b)) -> \(f0 : (Sigma bool (\(x : bool) -> PathP (<!0> bool) true x)) -> P0.1) -> f0 ((true,<!0> true)),\(x1 x2 : bool) -> \(X1 : PathP (<!0> bool) x1 x2) -> \(X2 : PathP (<!0> bool) true x1) -> <!0> comp (<!1> bool) (X2 @ !0) [ (!0 = 0) -> <!1> true, (!0 = 1) -> <!1> X1 @ !1 ]),\(x1 x2 : bool) -> \(X1 : PathP (<!0> bool) true x1) -> \(X2 : PathP (<!0> bool) true x2) -> <!0> comp (<!1> bool) (X1 @ -!0) [ (!0 = 0) -> <!1> x1, (!0 = 1) -> <!1> X2 @ !1 ]))))