Skip to content

Commit 80de9be

Browse files
author
Patrick Nicodemus
committed
Some changes in response to reviewer comments
1 parent ee99c2c commit 80de9be

File tree

4 files changed

+18
-32
lines changed

4 files changed

+18
-32
lines changed

theories/Basics/PathGroupoids.v

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -96,30 +96,7 @@ Definition concat_p_pp {A : Type} {x y z t : A} (p : x = y) (q : y = z) (r : z =
9696

9797
Definition concat_pp_p {A : Type} {x y z t : A} (p : x = y) (q : y = z) (r : z = t) :
9898
(p @ q) @ r = p @ (q @ r) :=
99-
match r with idpath =>
100-
match q with idpath =>
101-
match p with idpath => 1
102-
end end end.
103-
104-
Theorem concat_assoc_inv {A : Type} {x y z t : A} (p : x = y) (q : y = z) (r : z = t) :
105-
concat_p_pp p q r @ concat_pp_p p q r = 1.
106-
Proof.
107-
unfold concat_pp_p, concat_p_pp.
108-
refine (match r with idpath => _ end).
109-
refine (match q with idpath => _ end).
110-
refine (match p with idpath => _ end).
111-
exact idpath.
112-
Defined.
113-
114-
Theorem concat_assoc_inv' {A : Type} {x y z t : A} (p : x = y) (q : y = z) (r : z = t) :
115-
concat_pp_p p q r @ concat_p_pp p q r = 1.
116-
Proof.
117-
unfold concat_pp_p, concat_p_pp.
118-
refine (match r with idpath => _ end).
119-
refine (match q with idpath => _ end).
120-
refine (match p with idpath => _ end).
121-
exact idpath.
122-
Defined.
99+
(concat_p_pp p q r)^.
123100

124101
(** The left inverse law. *)
125102
Definition concat_pV {A : Type} {x y : A} (p : x = y) :

theories/WildCat/Paths.v

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ Instance is1cat_paths {A : Type} : Is1Cat A
7171
Instance is1gpd_paths {A : Type} : Is1Gpd A.
7272
Proof.
7373
intros a b f; constructor.
74-
- exact (@concat_pV A _ _ _).
75-
- exact (@concat_Vp A _ _ _).
74+
- apply concat_pV.
75+
- apply concat_Vp.
7676
Defined.
7777

7878
(** Any type is a 2-category with higher morphisms given by paths. *)
@@ -104,8 +104,8 @@ Proof.
104104
unfold cat_precomp; simpl in p, q, r.
105105
destruct r, q, p. simpl. exact (concat_1p_p1 _ ).
106106
- intros a b c d f g h; constructor.
107-
+ exact (concat_assoc_inv f g h).
108-
+ exact (concat_assoc_inv' f g h).
107+
+ apply concat_pV.
108+
+ apply concat_Vp.
109109
- intros a b f; constructor.
110110
+ exact (concat_pV _).
111111
+ exact (concat_Vp _).

theories/WildCat/TwoOneCat.v

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
Require Import Basics.Overture Basics.Tactics.
2+
Require Import Types.Forall.
23
Require Import WildCat.Core.
34
Require Import WildCat.NatTrans.
45
Require Import WildCat.Prod.
@@ -10,7 +11,11 @@ Local Open Scope twocat.
1011

1112
(** * Wild (2,1)-categories *)
1213

14+
(** This file introduces two basic 2-dimensional structures, (2,1)-categories and bicategories. Bicategories classically have 0-cells, 1-cells and 2-cells; our presentation includes 3-cells expressing coherence relations between 2-cells, that would classically be expressed as truncated equalities. The paradigmatic example of a bicategory is the bicategory of categories, functors and natural transformations. Other common bicategories are the bicategory of sets and spans, the bicategory of rings and ring bimodules, and the bicategory of categories and profunctors. A (2,1)-category is a bicategory where all 2-cells are invertible; a (2,1)-category can also be seen as an ordinary category extended with coherence conditions on 2-cells, expressed as 3-cells. *)
15+
1316
(** ** Wild 1-categorical structures *)
17+
18+
(** We start by introducing the common core of the theory of 1-categories and the theory of bicategories. A wild 1-bicategory is like a wild 1-category, but without the requirement that the 2-cells are invertible in general. The theory of 1-bicategories is the fragment of the theory of bicategories containing all 0-cells, 1-cells and 2-cells, but subject to no coherence conditions between 2-cells (which would require 3-cells to express.) *)
1419
Class Is1Bicat (A : Type) `{!IsGraph A, !Is2Graph A, !Is01Cat A} :=
1520
{
1621
is01bicat_hom :: forall (a b : A), Is01Cat (a $-> b) ;
@@ -26,6 +31,7 @@ Class Is1Bicat (A : Type) `{!IsGraph A, !Is2Graph A, !Is01Cat A} :=
2631
bicat_idr_opp : forall {a b : A} (f : a $-> b), f $=> f $o Id a;
2732
}.
2833

34+
(** A wild 1-category is precisely a wild 1-bicategory such that the 2-cells are invertible. *)
2935
Definition is1cat_is1bicat (A : Type) `{Is1Bicat A}
3036
(p : forall a b : A, Is0Gpd (Hom a b))
3137
: Is1Cat A.
@@ -37,6 +43,7 @@ Proof.
3743
- exact (@bicat_idr _ _ _ _ _).
3844
Defined.
3945

46+
(** Conversely, forgetting the inverses of 2-cells, one recovers a 1-bicategory from a 1-category. *)
4047
Definition is1bicat_is1cat (A : Type) `{Is1Cat A}
4148
: Is1Bicat A.
4249
Proof.
@@ -60,8 +67,8 @@ Instance is0bifunctor_bicat_comp (A : Type) `{Is1Bicat A} (a b c : A)
6067
Instance Is0Functor_swap (A: Type) `{Is1Bicat A} (a b c : A)
6168
: Is0Functor (fun '(f,g) => cat_comp (a:=a) (b:=b) (c:=c) g f).
6269
Proof.
63-
change (fun p => snd p $o fst p) with (fun p => (Types.Forall.flip (cat_comp (a:=a) (b:=b) (c:=c)) (fst p) (snd p))).
64-
rapply (is0functor_bifunctor_uncurried (Forall.flip (cat_comp))).
70+
change (fun p => snd p $o fst p) with (fun p => (flip (cat_comp (a:=a) (b:=b) (c:=c)) (fst p) (snd p))).
71+
rapply (is0functor_bifunctor_uncurried (flip (cat_comp))).
6572
rapply is0bifunctor_flip.
6673
Defined.
6774

@@ -87,6 +94,7 @@ Proof.
8794
exact ((alpha $@@ beta) $@@ gamma).
8895
Defined.
8996

97+
(** The full structure of a bicategory, incorporating all appropriate coherence conditions. *)
9098
Class IsBicat (A : Type) `{H: Is1Bicat A} `{!Is3Graph A} :=
9199
{
92100
is1cat_hom :: forall (a b : A), Is1Cat (a $-> b) ;
@@ -116,6 +124,7 @@ Class IsBicat (A : Type) `{H: Is1Bicat A} `{!Is3Graph A} :=
116124
(g $@L bicat_idl f) $o (bicat_assoc f (Id b) g) $== (bicat_idr g $@R f)
117125
}.
118126

127+
(** A (2,1)-category is a bicategory such that all 2-cells have a unique inverse. Here we have chosen to define (2,1)-categories as extending the theory of bicategories, but the theory of (2,1)-categories also extends the theory of 1-categories with coherence conditions on 2-cells. TODO: Give a constructor to upgrade a 1-category to a (2,1)-category by adding appropriate coherence conditions. *)
119128
Class Is21Cat (A : Type) `{IsBicat A} :=
120129
{
121130
is0gpd_hom :: forall (a b : A), Is0Gpd (a $-> b) ;

theories/WildCat/Universe.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Require Import Basics.Overture Basics.Tactics Basics.Equivalences Basics.PathGroupoids.
22
Require Import Types.Equiv.
3-
Require Import WildCat.Core WildCat.Equiv WildCat.NatTrans WildCat.TwoOneCat WildCat.Bifunctor.
3+
Require Import WildCat.Core WildCat.Equiv WildCat.NatTrans WildCat.TwoOneCat WildCat.Bifunctor WildCat.Prod.
44

55
(** ** The (1-)category of types *)
66

@@ -160,7 +160,7 @@ Lemma Type_associator_natural (A B C D: Type)
160160
(p : f == f') (q : g == g') (r : h == h') (x : A)
161161
: hcomp (hcomp r q) p x @ 1 = 1 @ hcomp r (hcomp q p) x.
162162
Proof.
163-
unfold Bifunctor.fmap11, Prod.fmap_pair; simpl.
163+
unfold fmap11, fmap_pair; simpl.
164164
refine (concat_p1 _ @ _ @ (concat_1p _)^).
165165
refine (whiskerR (ap_compose _ _ _) _ @ _).
166166
exact (concat_p_pp _ _ _ @ (whiskerR (ap_pp _ _ _)^ _)).

0 commit comments

Comments
 (0)