-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathomega_cat_examples.v
598 lines (510 loc) · 23.1 KB
/
omega_cat_examples.v
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
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
Add LoadPath "." as OmegaCategories.
Require Export Unicode.Utf8_core.
Require Import Omega BinInt.
Require Import path GType omega_categories omega_categories_transport type_to_omega_cat Integers.
Set Implicit Arguments.
Notation "| G |" := (objects G) (at level 80).
Notation "G [ A , B ]" := (hom G A B) (at level 80).
Notation "A ** B" := (product A B) (at level 90).
Notation " A ==> B " := (GHom A B) (at level 90).
(** The empty type *)
Inductive Empty : Type := .
(**
- The empty globular set *)
Definition empty : GType := Delta Empty.
(**
- The discrete one, parameterised by any set X0, i.e., X0 in dim 0 and empty elsewhere *)
CoFixpoint Discrete (X0 : Type) : GType := @mkGType X0 (fun _ _ => empty).
(** Some technical definitions *)
Definition transport_IsωPreCat G G' (e:G = G') (compG : IsωPreCat G) :
e # compG = {| _comp := e # (@_comp _ compG); _id := e # (@_id _ compG) |}.
destruct e, compG. reflexivity.
Defined.
Definition path_IsωPreCat G (compG compG' : IsωPreCat G) :
(@_comp _ compG = @_comp _ compG') -> (@_id _ compG = @_id _ compG') ->
compG = compG'.
destruct compG,compG'; simpl.
intros e e'; destruct e, e'. reflexivity.
Defined.
Definition Decidable_to_bool P (H : Decidable P) : bool :=
match H with
inl _ => true
| inr _ => false
end.
Definition decpaths_nat_refl g : decpaths_nat g g = inl eq_refl.
induction g.
- reflexivity.
- simpl. rewrite IHg. reflexivity.
Defined.
Definition decpaths_nat_neq g g' ( e : ~~ g = g') : {e' : ~~ g = g' & decpaths_nat g g' = inr e'}.
generalize dependent g'. induction g; destruct g'; intro e.
- simpl in *. exists e. destruct (e eq_refl).
- simpl. refine (existT _ _ eq_refl).
- simpl. refine (existT _ _ eq_refl).
- simpl. assert (~~ g = g'). intro H. destruct (e (ap S H)).
specialize (IHg g' H). destruct IHg as [e' IHg]. exists (λ e0 : S g = S g',
match e0 in (_ = y) return (y = S g' → path.Empty) with
| eq_refl =>
λ H0 : S g = S g',
eq_ind_r (λ _ : nat, path.Empty)
(e'
(f_equal (λ e1 : nat, match e1 with
| 0 => g
| S n => n
end) H0))
(f_equal (λ e1 : nat, match e1 with
| 0 => g
| S n => n
end) H0)
end eq_refl).
rewrite IHg. reflexivity.
Defined.
Definition unapS m n : S m = S n -> m = n. intro. inversion H. auto. Defined.
Definition decpaths_nat_refl' g g' (e: g = g') : {e' : g = g' & decpaths_nat g g' = inl e'}.
generalize dependent g'. induction g; destruct g'; intro e.
- exists eq_refl. reflexivity.
- inversion e.
- inversion e.
- specialize (IHg g' (unapS e)). destruct IHg. exists (f_equal S x).
simpl. rewrite e0. reflexivity.
Defined.
(** Definitions around empty (initial) and terminal objects *)
CoFixpoint init_empty (G : GType) : empty ==> G :=
mkGHom empty G (fun x => match x with end)
(fun x y => (init_empty _)).
Instance composable_id_left (G : GType) : Composable terminal G G.
econstructor. generalize dependent G; cofix.
intro; apply (mkGHom (product terminal G ) G (fun X => snd X)).
simpl; intros. apply composable_id_left.
Defined.
Definition composable_id_right (G : GType) : Composable G terminal G.
econstructor. generalize dependent G; cofix.
intro; apply (mkGHom (product G terminal) G (fun X => fst X)).
simpl; intros. apply composable_id_right.
Defined.
Instance uncomposable_left (G H : GType) : Composable empty G H.
econstructor. generalize dependent G; generalize dependent H; cofix.
intros H G. assert (|empty ** G| -> |H|). intros (x,y); destruct x.
apply (mkGHom _ _ X).
simpl; intros. apply (uncomposable_left ( H [X x, X x']) (G[snd x, snd x'])).
Defined.
Definition uncomposable_right (G H : GType) : Composable G empty H.
econstructor. generalize dependent G; generalize dependent H; cofix.
intros H G. assert (|G ** empty| -> |H|). intros (x,y); destruct y.
apply (mkGHom _ _ X).
simpl; intros. apply (uncomposable_right ( H [X x, X x']) (G[fst x, fst x'])).
Defined.
CoFixpoint Compo_empty : Compo empty.
apply mkCompo; intros. apply uncomposable_left.
apply Compo_empty.
Defined.
CoFixpoint Id_empty : Id empty.
apply mkId; intros. destruct x.
apply Id_empty.
Defined.
Instance empty_CompoGType : IsωPreCat empty :=
{| _comp := Compo_empty; _id := Id_empty|}.
Definition CGempty : ωPreCat := (empty; empty_CompoGType).
Definition transport_hom_GType {G G' H H':GType} (e:H = G) (e' : H' = G') :
G ==> G' -> H ==> H'.
destruct e, e'. exact id.
Defined.
Notation "G [ A , B ]" := (hom' G A B) (at level 80).
Notation "| G |" := (objects G.1) (at level 80).
Notation "A ** B" := (prod' A B) (at level 90).
Notation " A ==> B " := (A.1 ==> B.1) (at level 90).
(* Instance transport_terminal : transport_eq ωterminal *)
(* := canonical_transport _. *)
Definition terminal_is_hprop G `(G = ωterminal) n (x y : cell n G) : x = y.
generalize x y. clear x y. rewrite H. induction n. destruct x, y; reflexivity.
intros. destruct x as [[x x'] c], y as [[y y'] c'].
destruct x, x', y ,y'. refine (path_sigma' _ _ _ ). reflexivity. apply IHn.
Defined.
Definition empty_is_false_fun G (f: G ==> CGempty) n (c : cell n G) T : T c.
pose (c' := cellGHom _ _ _ f c). destruct n. destruct c'.
destruct c' as [[y y' ] c']. destruct y.
Defined.
Definition empty_is_false G (f: G = CGempty) n (c : cell n G) T : T c.
apply empty_is_false_fun. rewrite f. apply GId.
Defined.
CoFixpoint prod_empty_L G H : G ==> CGempty -> (G ** H) ==> CGempty.
intro f. refine (mkGHom _ _ _ _).
intros [x y]. destruct (f @@ x).
intros [x x'] [y y']. exact (prod_empty_L (G [x, y]) (H [x', y']) (f <<x,y>>)).
Defined.
CoFixpoint prod_empty_R G H : H ==> CGempty -> (G ** H) ==> CGempty.
intro f. refine (mkGHom _ _ _ _).
intros [x y]. destruct (f @@ y).
intros [x x'] [y y']. exact (prod_empty_R (G [x, y]) (H [x', y']) (f <<x',y'>>)).
Defined.
Definition unique_morphism G (f g : G ==> ωterminal) : GHom_eq_cell _ _ f g.
intro n. generalize dependent G. induction n; intros G f g c.
- destruct (f `@c` c), (g `@c` c). reflexivity.
- destruct c as [[x y] c]. refine (path_sigma_uncurried _ _ _ ). simpl.
destruct (@app _ terminal f x), (@app _ terminal f y), (@app _ terminal g x), (@app _ terminal g y).
exists (eq_refl _). exact (IHn _ _ _ c).
Defined.
CoFixpoint unitalityR_terminal : @unitalityR ωterminal (canonicalTriangle _).
apply mkUnitalityR.
- intros x y. apply unique_morphism.
- intros x y. apply unitalityR_terminal.
Defined.
CoFixpoint unitalityL_terminal : @unitalityL ωterminal (canonicalTriangle _).
apply mkUnitalityL.
- intros x y. apply unique_morphism.
- intros x y. apply unitalityL_terminal.
Defined.
Definition unique_morphism_empty G (f g: G ==> CGempty) : GHom_eq_cell _ _ f g.
intros n c; destruct n.
- destruct (f `@c` c).
- destruct c as [[x y] c]. destruct (f @@ x).
Defined.
CoFixpoint unitalityR_empty : @unitalityR CGempty (canonicalTriangle _).
apply mkUnitalityR.
- intros x y. apply unique_morphism_empty.
- intros x y. apply unitalityR_empty.
Defined.
CoFixpoint unitalityL_empty : @unitalityL CGempty (canonicalTriangle _).
apply mkUnitalityL.
- intros x y. apply unique_morphism_empty.
- intros x y. apply unitalityL_empty.
Defined.
CoFixpoint associativity_terminal : @associativity ωterminal (canonicalSquare _).
apply mkAssociativity.
- intros x y z t. apply unique_morphism.
- intros x y. apply associativity_terminal.
Defined.
CoFixpoint associativity_empty : @associativity CGempty (canonicalSquare _).
apply mkAssociativity.
- intros x y z t. apply unique_morphism_empty.
- intros x y. apply associativity_empty.
Defined.
CoFixpoint preservesCompo_terminal G (f : G ==> ωterminal): @preservesCompo _ _ f (canonicalSquare _).
apply mkPreservesCompo.
- intros. apply unique_morphism.
- intros x y. apply preservesCompo_terminal.
Defined.
CoFixpoint preservesId_terminal G (f : G ==> ωterminal): @preservesId _ _ f.
apply mkPreservesId.
- intros. destruct (identity (f @@ x)), ((f << x, x >>) @@ identity x). reflexivity.
- intros x y. apply preservesId_terminal.
Defined.
CoFixpoint compo_ωFunctor_terminal : @compo_ωFunctor ωterminal (canonicalSquare _).
apply mkcompo_ωFunctor.
- intros. split. apply preservesCompo_terminal. apply preservesId_terminal.
- intros. apply compo_ωFunctor_terminal.
Defined.
CoFixpoint preservesCompo_empty G (f : G ==> CGempty): @preservesCompo _ _ f (canonicalSquare _).
apply mkPreservesCompo.
- intros. apply unique_morphism_empty.
- intros x y. apply preservesCompo_empty.
Defined.
CoFixpoint preservesId_empty G (f : G ==> CGempty): @preservesId _ _ f.
apply mkPreservesId.
- intros. destruct (identity (f @@ x)).
- intros x y. apply preservesId_empty.
Defined.
CoFixpoint compo_ωFunctor_empty : @compo_ωFunctor CGempty (canonicalSquare _).
apply mkcompo_ωFunctor.
- intros. split. apply preservesCompo_empty. apply preservesId_empty.
- intros. apply compo_ωFunctor_empty.
Defined.
Definition path_unitalityR G H `(H = G) :
@unitalityR G (canonicalTriangle _) -> @unitalityR H (canonicalTriangle _).
destruct H0. exact id.
Defined.
Definition path_unitalityL G H `(H = G) :
@unitalityL G (canonicalTriangle _) -> @unitalityL H (canonicalTriangle _).
destruct H0. exact id.
Defined.
CoFixpoint preservesCompo_empty_domL G H (f : CGempty ** G ==> H):
@preservesCompo _ _ f (canonicalSquare _).
apply mkPreservesCompo.
- intros. intros n c. match goal with | |- ?T =>
refine (@empty_is_false_fun _ _ n c (fun c => T)) end.
apply prod_empty_R. apply (prod_empty_L CGempty (G[_,_])). apply GId.
- intros x y. apply (preservesCompo_empty_domL (G[_,_])).
Defined.
CoFixpoint preservesCompo_empty_domR G H (f : G ** CGempty ==> H):
@preservesCompo _ _ f (canonicalSquare _).
apply mkPreservesCompo.
- intros. intros n c. match goal with | |- ?T =>
refine (@empty_is_false_fun _ _ n c (fun c => T)) end.
apply prod_empty_R. apply (prod_empty_R (G[_,_]) CGempty). apply GId.
- intros x y. apply (preservesCompo_empty_domR (G[_,_])).
Defined.
Definition path_preservesCompo G H H' (e : H = H') (f : G ==> H) :
@preservesCompo G H' (transport (fun X => _ ==> X) e f) (canonicalSquare _) ->
@preservesCompo G H f (canonicalSquare _).
destruct e. exact id.
Defined.
Definition path_preservesCompo' G G' H (e : G = G') (f : G ==> H) :
@preservesCompo G' H (transport (fun X => X ==> _) e f) (canonicalSquare _) ->
@preservesCompo G H f (canonicalSquare _).
destruct e. exact id.
Defined.
CoFixpoint preservesId_empty_domL G H (f : CGempty ** G ==> H): preservesId _ _ f.
apply mkPreservesId.
- intros [x y]. destruct x.
- intros [x x'] [y y']. destruct x.
Defined.
CoFixpoint preservesId_empty_domR G H (f : G ** CGempty ==> H): preservesId _ _ f.
apply mkPreservesId.
- intros [x y]. destruct y.
- intros [x x'] [y y']. destruct x'.
Defined.
Definition path_preservesId G H H' (e : H = H') (f : G ==> H) :
@preservesId G H' (transport (fun X => _ ==> X) e f) ->
@preservesId G H f.
destruct e. exact id.
Defined.
Definition path_preservesId' G G' H (e : G = G') (f : G ==> H) :
@preservesId G' H (transport (fun X => X ==> _) e f) ->
@preservesId G H f .
destruct e. exact id.
Defined.
Definition path_compo_ωFunctor H H' (e : H = H') :
@compo_ωFunctor H (canonicalSquare _) -> @compo_ωFunctor H' (canonicalSquare _).
destruct e. exact id.
Defined.
Definition path_associativity H H' (e : H = H') :
@associativity H (canonicalSquare _) -> @associativity H' (canonicalSquare _).
destruct e. exact id.
Defined.
Instance terminal_IsOmegaCategory : IsOmegaCategory ωterminal _ _ :=
{| _idR := unitalityR_terminal ;
_idL := unitalityL_terminal ;
_compo_ωFunctor := compo_ωFunctor_terminal;
_assoc := associativity_terminal
|}.
Definition ω_terminal : wild_ωcat := (ωterminal; terminal_IsOmegaCategory).
(** The omega category of the circle S1 *)
Definition GS1 := @mkGType unit (λ _ _ : unit,
@mkGType nat (λ z z', if Decidable_to_bool (decpaths_nat z z')
then terminal
else empty)).
Notation "G [ A , B ]" := (hom G A B) (at level 80).
Definition GS1_eq_terminal (g g':nat) : g = g' -> (GS1 [tt, tt]) [g, g'] = terminal.
destruct 1. unfold hom'; simpl. rewrite decpaths_nat_refl. reflexivity.
Defined.
Definition GS1_neq_empty (g g':nat) : ~~ g = g' -> (GS1 [tt, tt]) [g, g'] = empty.
unfold hom'; simpl; intro H. rewrite (decpaths_nat_neq H).2. reflexivity.
Defined.
Definition Compo_S1 : Compo GS1.
apply mkCompo; intros.
- econstructor. apply (mkGHom (product (hom GS1 x y) (hom GS1 y z)) (hom GS1 x z)
(fun z => fst z + snd z)).
+ destruct x, y ,z. intros [e e'] [h h'].
exact (match decpaths_nat e h with
| inl H => match decpaths_nat e' h' with
| inl H' => transport_hom_GType
(ap2 _ (GS1_eq_terminal H) (GS1_eq_terminal H'))
(GS1_eq_terminal (ap2 plus H H'))
(@compo _ _ _ (composable_id_left _))
| inr H' => transport_hom_GType
(ap2 _ eq_refl (GS1_neq_empty H'))
eq_refl
(@compo _ _ _ (uncomposable_right _ _))
end
| inr H => transport_hom_GType
(ap2 _ (GS1_neq_empty H) eq_refl)
eq_refl
(@compo _ _ _ (uncomposable_left _ _))
end).
- apply mkCompo; intros; simpl.
+ destruct (decpaths_nat x0 y0); destruct (decpaths_nat y0 z); destruct (decpaths_nat x0 z);
simpl; intros; try apply composable_id_left; try apply composable_id_right;
try apply uncomposable_left; try apply uncomposable_right.
destruct (n (e @ e0)).
+ destruct (decpaths_nat x0 y0); try apply Compo_terminal; apply Compo_empty.
Defined.
Definition Id_S1 : Id GS1.
apply mkId.
- intro. exact 0.
- intros x y. destruct x, y. apply mkId.
+ intro z. rewrite (GS1_eq_terminal (eq_refl z)). exact tt.
+ intros z z'. simpl. destruct (decpaths_nat z z'). apply Id_terminal. apply Id_empty.
Defined.
Instance CompoGType_S1 : IsωPreCat GS1 :=
{| _comp := Compo_S1; _id := Id_S1|}.
Definition CGS1 : ωPreCat := (GS1; CompoGType_S1).
Notation "G [ A , B ]" := (hom' G A B) (at level 80).
Definition CGS1_eq_terminal (g g':nat) : g = g' -> (CGS1 [tt, tt]) [g, g'] = ωterminal.
destruct 1. unfold hom'; simpl. refine (path_sigma' _ _ _).
- rewrite decpaths_nat_refl. reflexivity.
- rewrite transport_IsωPreCat. apply path_IsωPreCat; simpl.
+ unfold compoHom. simpl. rewrite decpaths_nat_refl. reflexivity.
+ unfold idHom. simpl. rewrite decpaths_nat_refl. reflexivity.
Defined.
Definition CGS1_neq_empty (g g':nat) : ~~ g = g' -> (CGS1 [tt, tt]) [g, g'] = CGempty.
unfold hom'; simpl; intro H. refine (path_sigma' _ _ _).
- rewrite (decpaths_nat_neq H).2. reflexivity.
- rewrite transport_IsωPreCat. apply path_IsωPreCat; simpl.
+ unfold compoHom. simpl. rewrite (decpaths_nat_neq H).2. reflexivity.
+ unfold idHom. simpl. rewrite (decpaths_nat_neq H).2. reflexivity.
Defined.
Definition unitalityR_S1 : @unitalityR CGS1 (@canonicalTriangle _).
apply mkUnitalityR.
- intros. destruct x, y. intros n c. destruct n.
+ apply Plus.plus_0_r.
+ destruct c as [[[x x'] [y y']] c]. destruct x', y'.
refine (path_sigma' _ _ _). simpl. refine (path_prod _ _ _ _).
apply Plus.plus_0_r. apply Plus.plus_0_r.
case (decpaths_nat x y); intro H.
apply (terminal_is_hprop (CGS1_eq_terminal H)).
apply (empty_is_false (CGS1_neq_empty H)).
- intros. destruct x, y.
apply mkUnitalityR; intros x y.
case (decpaths_nat x y); intros H c n.
apply (terminal_is_hprop (CGS1_eq_terminal H)).
apply (empty_is_false (CGS1_neq_empty H)).
case (decpaths_nat x y); intros H.
apply (path_unitalityR (CGS1_eq_terminal H) unitalityR_terminal).
apply (path_unitalityR (CGS1_neq_empty H) unitalityR_empty).
Defined.
Definition unitalityL_S1 : @unitalityL CGS1 (@canonicalTriangle _).
apply mkUnitalityL.
- intros. destruct x, y. intros n c. destruct n.
+ apply Plus.plus_0_l.
+ destruct c as [[[x' x] [y' y]] c]. destruct x', y'.
refine (path_sigma' _ _ _). simpl. refine (path_prod _ _ _ _).
apply Plus.plus_0_l. apply Plus.plus_0_l.
case (decpaths_nat x y); intro H.
apply (terminal_is_hprop (CGS1_eq_terminal H)).
apply (empty_is_false (CGS1_neq_empty H)).
- intros. destruct x, y.
apply mkUnitalityL; intros x y.
case (decpaths_nat x y); intros H c n.
apply (terminal_is_hprop (CGS1_eq_terminal H)).
apply (empty_is_false (CGS1_neq_empty H)).
case (decpaths_nat x y); intros H.
apply (path_unitalityL (CGS1_eq_terminal H) unitalityL_terminal).
apply (path_unitalityL (CGS1_neq_empty H) unitalityL_empty).
Defined.
CoFixpoint compo_ωFunctor_S1 : @compo_ωFunctor CGS1 (canonicalSquare _).
apply mkcompo_ωFunctor.
- intros x y z. destruct x, y, z. split.
+ apply mkPreservesCompo.
* intros [x x'] [y y'] [z z'] n c.
case (decpaths_nat x y); intro H.
case (decpaths_nat x' y'); intro H'.
case (decpaths_nat y z); intro G.
case (decpaths_nat y' z'); intro G'.
apply terminal_is_hprop. simpl.
exact (CGS1_eq_terminal (ap2 plus (H @ G) (H' @ G'))).
match goal with | |- ?T =>
refine (@empty_is_false_fun _ _ n c (fun c => T)) end.
apply prod_empty_R. refine (prod_empty_R ((CGS1 [tt, tt])[y,z]) ((CGS1 [tt, tt])[y', z']) _).
rewrite (CGS1_neq_empty G'). apply GId.
match goal with | |- ?T =>
refine (@empty_is_false_fun _ _ n c (fun c => T)) end.
apply prod_empty_R. refine (prod_empty_L ((CGS1 [tt, tt])[y,z]) ((CGS1 [tt, tt])[y', z']) _).
rewrite (CGS1_neq_empty G). apply GId.
match goal with | |- ?T =>
refine (@empty_is_false_fun _ _ n c (fun c => T)) end.
apply prod_empty_L. refine (prod_empty_R ((CGS1 [tt, tt])[x,y]) ((CGS1 [tt, tt])[x', y']) _).
rewrite (CGS1_neq_empty H'). apply GId.
match goal with | |- ?T =>
refine (@empty_is_false_fun _ _ n c (fun c => T)) end.
apply prod_empty_L. refine (prod_empty_L ((CGS1 [tt, tt])[x,y]) ((CGS1 [tt, tt])[x', y']) _).
rewrite (CGS1_neq_empty H). apply GId.
* intros [x x'] [y y'].
case (decpaths_nat x y); intro H.
case (decpaths_nat x' y'); intro H'.
refine (path_preservesCompo (CGS1_eq_terminal (ap2 plus H H')) _ _).
apply preservesCompo_terminal.
refine (@path_preservesCompo' _ ((CGS1 [tt, tt] [x,y]) ** CGempty) _ _ _ _).
rewrite <- (CGS1_neq_empty H'). reflexivity.
apply preservesCompo_empty_domR.
refine (@path_preservesCompo' _ (CGempty ** (CGS1 [tt, tt] [x',y'])) _ _ _ _).
rewrite <- (CGS1_neq_empty H). reflexivity.
apply preservesCompo_empty_domL.
+ apply mkPreservesId.
* intros [x x']. refine (terminal_is_hprop _ 0 _ (identity (x' ° x))).
apply (CGS1_eq_terminal eq_refl).
* intros [x x'] [y y'].
case (decpaths_nat x y); intro H.
case (decpaths_nat x' y'); intro H'.
refine (path_preservesId (CGS1_eq_terminal (ap2 plus H H')) _ _).
apply preservesId_terminal.
refine (@path_preservesId' _ ((CGS1 [tt, tt] [x,y]) ** CGempty) _ _ _ _).
rewrite <- (CGS1_neq_empty H'). reflexivity.
apply preservesId_empty_domR.
refine (@path_preservesId' _ (CGempty ** (CGS1 [tt, tt] [x',y'])) _ _ _ _).
rewrite <- (CGS1_neq_empty H). reflexivity.
apply preservesId_empty_domL.
- intros x y. destruct x, y.
apply mkcompo_ωFunctor.
+ intros x y z. split.
* case (decpaths_nat x z); intro H.
refine (path_preservesCompo (CGS1_eq_terminal H) _ _).
apply preservesCompo_terminal.
refine (path_preservesCompo (CGS1_neq_empty H) _ _).
apply preservesCompo_empty.
* case (decpaths_nat x z); intro H.
refine (path_preservesId (CGS1_eq_terminal H) _ _).
apply preservesId_terminal.
refine (path_preservesId (CGS1_neq_empty H) _ _).
apply preservesId_empty.
+ intros x y.
case (decpaths_nat x y); intro H.
refine (path_compo_ωFunctor (eq_sym (CGS1_eq_terminal H)) _).
apply compo_ωFunctor_terminal.
refine (path_compo_ωFunctor (eq_sym (CGS1_neq_empty H)) _).
apply compo_ωFunctor_empty.
Defined.
CoFixpoint associativity_S1 : @associativity CGS1 (canonicalSquare _).
apply mkAssociativity.
- intros x y z t n c. destruct x, y, z, t. destruct n.
+ apply Plus.plus_assoc.
+ destruct c as [[[x [x' x'']] [y [y' y'']]] c].
refine (path_sigma' _ _ _). refine (path_prod _ _ _ _).
apply Plus.plus_assoc. apply Plus.plus_assoc.
case (decpaths_nat x y); intro H.
case (decpaths_nat x' y'); intro H'.
case (decpaths_nat x'' y''); intro H''.
apply terminal_is_hprop. exact (CGS1_eq_terminal (ap2 plus (ap2 plus H H') H'')).
match goal with | |- ?T =>
refine (@empty_is_false_fun _ _ n c (fun c => T)) end.
refine (prod_empty_R ((CGS1 [tt, tt])[x,y]) (((CGS1 [tt, tt])[x',y']) ** ((CGS1 [tt, tt])[x'',y''])) _).
refine (prod_empty_R ((CGS1 [tt, tt])[x',y']) ((CGS1 [tt, tt])[x'', y'']) _).
rewrite (CGS1_neq_empty H''). apply GId.
match goal with | |- ?T =>
refine (@empty_is_false_fun _ _ n c (fun c => T)) end.
refine (prod_empty_R ((CGS1 [tt, tt])[x,y]) (((CGS1 [tt, tt])[x',y']) ** ((CGS1 [tt, tt])[x'',y''])) _).
refine (prod_empty_L ((CGS1 [tt, tt])[x',y']) ((CGS1 [tt, tt])[x'', y'']) _).
rewrite (CGS1_neq_empty H'). apply GId.
match goal with | |- ?T =>
refine (@empty_is_false_fun _ _ n c (fun c => T)) end.
refine (prod_empty_L ((CGS1 [tt, tt])[x,y]) (((CGS1 [tt, tt])[x',y']) ** ((CGS1 [tt, tt])[x'',y''])) _).
rewrite (CGS1_neq_empty H). apply GId.
- intros x y. destruct x, y. apply mkAssociativity.
+ intros x y z t n c.
case (decpaths_nat x y); intro H.
case (decpaths_nat y z); intro H'.
case (decpaths_nat z t); intro H''.
apply terminal_is_hprop. exact (CGS1_eq_terminal (H @ H' @ H'')).
match goal with | |- ?T =>
refine (@empty_is_false_fun _ _ n c (fun c => T)) end.
refine (prod_empty_R _ _ _). refine (prod_empty_R _ _ _).
rewrite (CGS1_neq_empty H''). apply GId.
match goal with | |- ?T =>
refine (@empty_is_false_fun _ _ n c (fun c => T)) end.
refine (prod_empty_R _ _ _). refine (prod_empty_L _ _ _).
rewrite (CGS1_neq_empty H'). apply GId.
match goal with | |- ?T =>
refine (@empty_is_false_fun _ _ n c (fun c => T)) end.
refine (prod_empty_L _ _ _). rewrite (CGS1_neq_empty H). apply GId.
+ intros x y. case (decpaths_nat x y); intro H.
refine (path_associativity (eq_sym (CGS1_eq_terminal H)) _).
apply associativity_terminal.
refine (path_associativity (eq_sym (CGS1_neq_empty H)) _).
apply associativity_empty.
Defined.
Instance S1_IsOmegaCategory : IsOmegaCategory CGS1 _ _ :=
{| _idR := unitalityR_S1;
_idL := unitalityL_S1;
_compo_ωFunctor := compo_ωFunctor_S1;
_assoc := associativity_S1
|}.
Definition ωS1 : wild_ωcat := (CGS1; S1_IsOmegaCategory).