Skip to content

Commit 0ebb5e6

Browse files
Refactor category theory to use strictly involutive identity types (#1052)
### Summary - Refactors the definition of categories to use the new and more general strictly involutive identity types for their associativity witnesses. - Refactor definitions of some instances of large and small precategories to use a new `make-(Large-)?-Precategory` constructor. - Defines the underlying large precategory of a large subprecategory. - Change some prose regarding basic definitions in category theory. - Refactors all appropriate instances of large precategories to be (full) large subprecategories. - Rename `is-group` to `is-group-Semigroup`. The last item was appropriate to make the handling of `involutive-eq-associative-comp-hom-***-Large-Precategory` systematic. Improves on what was implemented in #945.
1 parent 0f0d379 commit 0ebb5e6

File tree

134 files changed

+1674
-1666
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+1674
-1666
lines changed

src/category-theory/augmented-simplex-category.lagda.md

+11-17
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ open import elementary-number-theory.natural-numbers
1616
open import foundation.dependent-pair-types
1717
open import foundation.identity-types
1818
open import foundation.sets
19+
open import foundation.strictly-involutive-identity-types
1920
open import foundation.universe-levels
2021
2122
open import order-theory.order-preserving-maps-posets
@@ -81,19 +82,19 @@ associative-comp-hom-augmented-simplex-Category {n} {m} {r} {s} =
8182
( Fin-Poset r)
8283
( Fin-Poset s)
8384
84-
inv-associative-comp-hom-augmented-simplex-Category :
85+
involutive-eq-associative-comp-hom-augmented-simplex-Category :
8586
{n m r s : obj-augmented-simplex-Category}
8687
(h : hom-augmented-simplex-Category r s)
8788
(g : hom-augmented-simplex-Category m r)
8889
(f : hom-augmented-simplex-Category n m) →
89-
comp-hom-augmented-simplex-Category {n} {r} {s}
90-
( h)
91-
( comp-hom-augmented-simplex-Category {n} {m} {r} g f) =
9290
comp-hom-augmented-simplex-Category {n} {m} {s}
9391
( comp-hom-augmented-simplex-Category {m} {r} {s} h g)
94-
( f)
95-
inv-associative-comp-hom-augmented-simplex-Category {n} {m} {r} {s} =
96-
inv-associative-comp-hom-Poset
92+
( f) =ⁱ
93+
comp-hom-augmented-simplex-Category {n} {r} {s}
94+
( h)
95+
( comp-hom-augmented-simplex-Category {n} {m} {r} g f)
96+
involutive-eq-associative-comp-hom-augmented-simplex-Category {n} {m} {r} {s} =
97+
involutive-eq-associative-comp-hom-Poset
9798
( Fin-Poset n)
9899
( Fin-Poset m)
99100
( Fin-Poset r)
@@ -104,16 +105,9 @@ associative-composition-operation-augmented-simplex-Category :
104105
hom-set-augmented-simplex-Category
105106
pr1 associative-composition-operation-augmented-simplex-Category {n} {m} {r} =
106107
comp-hom-augmented-simplex-Category {n} {m} {r}
107-
pr1
108-
( pr2
109-
associative-composition-operation-augmented-simplex-Category
110-
{ n} {m} {r} {s} h g f) =
111-
associative-comp-hom-augmented-simplex-Category {n} {m} {r} {s} h g f
112-
pr2
113-
( pr2
114-
associative-composition-operation-augmented-simplex-Category
115-
{ n} {m} {r} {s} h g f) =
116-
inv-associative-comp-hom-augmented-simplex-Category {n} {m} {r} {s} h g f
108+
pr2 associative-composition-operation-augmented-simplex-Category
109+
{ n} {m} {r} {s} =
110+
involutive-eq-associative-comp-hom-augmented-simplex-Category {n} {m} {r} {s}
117111
118112
id-hom-augmented-simplex-Category :
119113
(n : obj-augmented-simplex-Category) → hom-augmented-simplex-Category n n

src/category-theory/categories.lagda.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ open import foundation.equivalences
2020
open import foundation.identity-types
2121
open import foundation.propositions
2222
open import foundation.sets
23+
open import foundation.strictly-involutive-identity-types
2324
open import foundation.surjective-maps
2425
open import foundation.universe-levels
2526
```
@@ -28,7 +29,7 @@ open import foundation.universe-levels
2829

2930
## Idea
3031

31-
A **category** in Homotopy Type Theory is a
32+
A {{#concept "category" Agda=Category}} in Homotopy Type Theory is a
3233
[precategory](category-theory.precategories.md) for which the
3334
[identifications](foundation-core.identity-types.md) between the objects are the
3435
[isomorphisms](category-theory.isomorphisms-in-precategories.md). More
@@ -105,15 +106,15 @@ module _
105106
associative-comp-hom-Category =
106107
associative-comp-hom-Precategory precategory-Category
107108
108-
inv-associative-comp-hom-Category :
109+
involutive-eq-associative-comp-hom-Category :
109110
{x y z w : obj-Category}
110111
(h : hom-Category z w)
111112
(g : hom-Category y z)
112113
(f : hom-Category x y) →
113-
comp-hom-Category h (comp-hom-Category g f) =
114-
comp-hom-Category (comp-hom-Category h g) f
115-
inv-associative-comp-hom-Category =
116-
inv-associative-comp-hom-Precategory precategory-Category
114+
comp-hom-Category (comp-hom-Category h g) f =ⁱ
115+
comp-hom-Category h (comp-hom-Category g f)
116+
involutive-eq-associative-comp-hom-Category =
117+
involutive-eq-associative-comp-hom-Precategory precategory-Category
117118
118119
associative-composition-operation-Category :
119120
associative-composition-operation-binary-family-Set hom-set-Category

src/category-theory/composition-operations-on-binary-families-of-sets.lagda.md

+79-67
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ open import foundation.identity-types
1414
open import foundation.iterated-dependent-product-types
1515
open import foundation.propositions
1616
open import foundation.sets
17+
open import foundation.strictly-involutive-identity-types
1718
open import foundation.subtypes
1819
open import foundation.universe-levels
1920
```
@@ -22,22 +23,24 @@ open import foundation.universe-levels
2223

2324
## Idea
2425

25-
Given a type `A`, a **composition operation on a binary family of sets**
26-
`hom : A → A → Set ` is a map
26+
Given a type `A`, a
27+
{{#concept "composition operation" Disambiguation="on binary families of sets" Agda=composition-operation-binary-family-Set}}
28+
on a binary family of [sets](foundation-core.sets.md) `hom : A → A → Set` is a
29+
map
2730

2831
```text
29-
hom y z → hom x y → hom x z
32+
_∘_ : hom y z → hom x y → hom x z
3033
```
3134

3235
for every triple of elements `x y z : A`.
3336

3437
For such operations, we can consider
35-
[properties](foundation-core.propositions.md) such as **associativity** and
36-
**unitality**.
38+
[properties](foundation-core.propositions.md) such as _associativity_ and
39+
_unitality_.
3740

3841
## Definitions
3942

40-
### Composition operations in binary families of sets
43+
### Composition operations on binary families of sets
4144

4245
```agda
4346
module _
@@ -50,14 +53,30 @@ module _
5053
type-Set (hom-set y z) → type-Set (hom-set x y) → type-Set (hom-set x z)
5154
```
5255

53-
### Associative composition operations in binary families of sets
56+
### Associative composition operations on binary families of sets
5457

55-
We give a slightly nonstandard definition of associativity, requiring an
56-
associativity witness in each direction. This is of course redundant as `inv` is
57-
a [fibered involution](foundation.fibered-involutions.md) on
58-
[identity types](foundation-core.identity-types.md). However, by recording both
59-
directions we maintain a definitional double inverse law which is practical in
60-
defining the [opposite category](category-theory.opposite-categories.md).
58+
A composition operation
59+
60+
```text
61+
_∘_ : hom y z → hom x y → hom x z
62+
```
63+
64+
on a binary family of sets of morphisms is called
65+
{{#concept "associative" Disambiguation="composition operation on a binary family of sets" Agda=is-associative-composition-operation-binary-family-Set}}
66+
if, for every triple of composable morphisms we have
67+
68+
```text
69+
(h ∘ g) ∘ f = h ∘ (g ∘ f).
70+
```
71+
72+
We give a slightly nonstandard definition of associativity using the
73+
[strictly involutive identity types](foundation.strictly-involutive-identity-types.md)
74+
rather than the standard [identity types](foundation-core.identity-types.md).
75+
This is because, while the strictly involutive identity types are always
76+
[equivalent](foundation-core.equivalences.md) to the standard ones, they satisfy
77+
the strict computation rule `inv (inv p) ≐ p` which is practical in defining the
78+
[opposite category](category-theory.opposite-categories.md), as this also makes
79+
the opposite construction strictly involutive: `(𝒞ᵒᵖ)ᵒᵖ ≐ 𝒞`.
6180

6281
```agda
6382
module _
@@ -71,8 +90,7 @@ module _
7190
(h : type-Set (hom-set z w))
7291
(g : type-Set (hom-set y z))
7392
(f : type-Set (hom-set x y)) →
74-
( comp-hom (comp-hom h g) f = comp-hom h (comp-hom g f)) ×
75-
( comp-hom h (comp-hom g f) = comp-hom (comp-hom h g) f)
93+
( comp-hom (comp-hom h g) f =ⁱ comp-hom h (comp-hom g f))
7694
7795
associative-composition-operation-binary-family-Set : UU (l1 ⊔ l2)
7896
associative-composition-operation-binary-family-Set =
@@ -88,6 +106,19 @@ module _
88106
composition-operation-binary-family-Set hom-set
89107
comp-hom-associative-composition-operation-binary-family-Set = pr1 H
90108
109+
involutive-eq-associative-composition-operation-binary-family-Set :
110+
{x y z w : A}
111+
(h : type-Set (hom-set z w))
112+
(g : type-Set (hom-set y z))
113+
(f : type-Set (hom-set x y)) →
114+
( comp-hom-associative-composition-operation-binary-family-Set
115+
( comp-hom-associative-composition-operation-binary-family-Set h g)
116+
( f)) =ⁱ
117+
( comp-hom-associative-composition-operation-binary-family-Set
118+
( h)
119+
( comp-hom-associative-composition-operation-binary-family-Set g f))
120+
involutive-eq-associative-composition-operation-binary-family-Set = pr2 H
121+
91122
witness-associative-composition-operation-binary-family-Set :
92123
{x y z w : A}
93124
(h : type-Set (hom-set z w))
@@ -98,7 +129,8 @@ module _
98129
( comp-hom-associative-composition-operation-binary-family-Set
99130
( h) (comp-hom-associative-composition-operation-binary-family-Set g f))
100131
witness-associative-composition-operation-binary-family-Set h g f =
101-
pr1 (pr2 H h g f)
132+
eq-involutive-eq
133+
( involutive-eq-associative-composition-operation-binary-family-Set h g f)
102134
103135
inv-witness-associative-composition-operation-binary-family-Set :
104136
{x y z w : A}
@@ -110,50 +142,32 @@ module _
110142
( comp-hom-associative-composition-operation-binary-family-Set
111143
( comp-hom-associative-composition-operation-binary-family-Set h g) (f))
112144
inv-witness-associative-composition-operation-binary-family-Set h g f =
113-
pr2 (pr2 H h g f)
145+
eq-involutive-eq
146+
( invⁱ
147+
( involutive-eq-associative-composition-operation-binary-family-Set
148+
( h)
149+
( g)
150+
( f)))
114151
```
115152

116-
```agda
117-
module _
118-
{l1 l2 : Level} {A : UU l1}
119-
(hom-set : A → A → Set l2)
120-
(comp-hom : composition-operation-binary-family-Set hom-set)
121-
where
153+
### Unital composition operations on binary families of sets
122154

123-
is-associative-witness-associative-composition-operation-binary-family-Set :
124-
( {x y z w : A}
125-
(h : type-Set (hom-set z w))
126-
(g : type-Set (hom-set y z))
127-
(f : type-Set (hom-set x y)) →
128-
comp-hom (comp-hom h g) f = comp-hom h (comp-hom g f)) →
129-
is-associative-composition-operation-binary-family-Set hom-set comp-hom
130-
pr1
131-
( is-associative-witness-associative-composition-operation-binary-family-Set
132-
H h g f) =
133-
H h g f
134-
pr2
135-
( is-associative-witness-associative-composition-operation-binary-family-Set
136-
H h g f) =
137-
inv (H h g f)
138-
139-
is-associative-inv-witness-associative-composition-operation-binary-family-Set :
140-
( {x y z w : A}
141-
(h : type-Set (hom-set z w))
142-
(g : type-Set (hom-set y z))
143-
(f : type-Set (hom-set x y)) →
144-
comp-hom h (comp-hom g f) = comp-hom (comp-hom h g) f) →
145-
is-associative-composition-operation-binary-family-Set hom-set comp-hom
146-
pr1
147-
( is-associative-inv-witness-associative-composition-operation-binary-family-Set
148-
H h g f) =
149-
inv (H h g f)
150-
pr2
151-
( is-associative-inv-witness-associative-composition-operation-binary-family-Set
152-
H h g f) =
153-
H h g f
155+
A composition operation
156+
157+
```text
158+
_∘_ : hom y z → hom x y → hom x z
159+
```
160+
161+
on a binary family of sets of morphisms is called
162+
{{#concept "unital" Disambiguation="composition operation on a binary family of sets" Agda=is-unital-composition-operation-binary-family-Set}}
163+
if there is a morphism `id_x : hom x x` for every element `x : A` such that
164+
165+
```text
166+
id_y ∘ f = f and f ∘ id_x = f.
154167
```
155168

156-
### Unital composition operations in binary families of sets
169+
As will be demonstrated momentarily, every composition operation on a binary
170+
family of sets is unital in [at most one](foundation.subterminal-types.md) way.
157171

158172
```agda
159173
module _
@@ -171,7 +185,7 @@ module _
171185

172186
## Properties
173187

174-
### Being associative is a property of composition operations in binary families of sets
188+
### Being associative is a property of composition operations on binary families of sets
175189

176190
```agda
177191
module _
@@ -187,15 +201,12 @@ module _
187201
( λ x y z w →
188202
is-prop-iterated-Π 3
189203
( λ h g f →
190-
is-prop-product
204+
is-prop-equiv
205+
( equiv-eq-involutive-eq)
191206
( is-set-type-Set
192207
( hom-set x w)
193208
( comp-hom (comp-hom h g) f)
194-
( comp-hom h (comp-hom g f)))
195-
( is-set-type-Set
196-
( hom-set x w)
197-
( comp-hom h (comp-hom g f))
198-
( comp-hom (comp-hom h g) f))))
209+
( comp-hom h (comp-hom g f)))))
199210
200211
is-associative-prop-composition-operation-binary-family-Set : Prop (l1 ⊔ l2)
201212
pr1 is-associative-prop-composition-operation-binary-family-Set =
@@ -204,7 +215,7 @@ module _
204215
is-prop-is-associative-composition-operation-binary-family-Set
205216
```
206217

207-
### Being unital is a property of composition operations in binary families of sets
218+
### Being unital is a property of composition operations on binary families of sets
208219

209220
**Proof:** Suppose `e e' : (x : A) → hom-set x x` are both right and left units
210221
with regard to composition. It is enough to show that `e = e'` since the right
@@ -266,7 +277,8 @@ module _
266277

267278
- [Set-magmoids](category-theory.set-magmoids.md) capture the structure of
268279
composition operations on binary families of sets.
269-
- [Precategories](category-theory.precategories.md) are associative and unital
270-
composition operations on binary families of sets.
271-
- [Nonunital precategories](category-theory.nonunital-precategories.md) are
272-
associative composition operations on binary families of sets.
280+
- [Precategories](category-theory.precategories.md) are the structure of an
281+
associative and unital composition operation on a binary families of sets.
282+
- [Nonunital precategories](category-theory.nonunital-precategories.md) are the
283+
structure of an associative composition operation on a binary families of
284+
sets.

src/category-theory/conservative-functors-precategories.lagda.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ isomorphism in `C`.
2929

3030
## Definitions
3131

32-
### The predicate of being conservative
32+
### The predicate on functors of being conservative
3333

3434
```agda
3535
module _

src/category-theory/copresheaf-categories.lagda.md

-24
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ module category-theory.copresheaf-categories where
1010
open import category-theory.categories
1111
open import category-theory.category-of-functors-from-small-to-large-categories
1212
open import category-theory.functors-from-small-to-large-precategories
13-
open import category-theory.functors-precategories
1413
open import category-theory.large-categories
1514
open import category-theory.large-precategories
1615
open import category-theory.natural-transformations-functors-from-small-to-large-precategories
@@ -210,29 +209,6 @@ module _
210209
{ Z}
211210
{ W}
212211
213-
inv-associative-comp-hom-copresheaf-Precategory :
214-
{l3 l4 l5 l6 : Level}
215-
(X : copresheaf-Precategory l3)
216-
(Y : copresheaf-Precategory l4)
217-
(Z : copresheaf-Precategory l5)
218-
(W : copresheaf-Precategory l6)
219-
(h : hom-copresheaf-Precategory Z W)
220-
(g : hom-copresheaf-Precategory Y Z)
221-
(f : hom-copresheaf-Precategory X Y) →
222-
comp-hom-copresheaf-Precategory X Z W
223-
( h)
224-
( comp-hom-copresheaf-Precategory X Y Z g f) =
225-
comp-hom-copresheaf-Precategory X Y W
226-
( comp-hom-copresheaf-Precategory Y Z W h g)
227-
( f)
228-
inv-associative-comp-hom-copresheaf-Precategory X Y Z W =
229-
inv-associative-comp-hom-Large-Precategory
230-
( copresheaf-large-precategory-Precategory)
231-
{ X = X}
232-
{ Y}
233-
{ Z}
234-
{ W}
235-
236212
left-unit-law-comp-hom-copresheaf-Precategory :
237213
{l3 l4 : Level}
238214
(X : copresheaf-Precategory l3)

0 commit comments

Comments
 (0)