Skip to content

Commit 7da1d48

Browse files
Initial and terminal copresheaves (#1174)
Adding initial and terminal copresheaves. --------- Co-authored-by: Fredrik Bakke <[email protected]>
1 parent 0682351 commit 7da1d48

File tree

2 files changed

+134
-0
lines changed

2 files changed

+134
-0
lines changed

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

+117
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,32 @@ module category-theory.copresheaf-categories where
99
```agda
1010
open import category-theory.categories
1111
open import category-theory.category-of-functors-from-small-to-large-categories
12+
open import category-theory.constant-functors
1213
open import category-theory.functors-from-small-to-large-precategories
1314
open import category-theory.functors-precategories
15+
open import category-theory.initial-objects-precategories
1416
open import category-theory.large-categories
1517
open import category-theory.large-precategories
1618
open import category-theory.natural-transformations-functors-from-small-to-large-precategories
19+
open import category-theory.natural-transformations-functors-precategories
1720
open import category-theory.precategories
1821
open import category-theory.precategory-of-functors-from-small-to-large-precategories
22+
open import category-theory.terminal-objects-precategories
1923
2024
open import foundation.category-of-sets
2125
open import foundation.commuting-squares-of-maps
2226
open import foundation.dependent-pair-types
27+
open import foundation.empty-types
2328
open import foundation.equality-cartesian-product-types
2429
open import foundation.function-extensionality
2530
open import foundation.function-types
2631
open import foundation.functoriality-cartesian-product-types
2732
open import foundation.homotopies
2833
open import foundation.identity-types
34+
open import foundation.propositions
35+
open import foundation.raising-universe-levels
2936
open import foundation.sets
37+
open import foundation.unit-type
3038
open import foundation.universe-levels
3139
```
3240

@@ -307,6 +315,115 @@ module _
307315
( pr2 w)))
308316
```
309317

318+
### The initial copresheaf
319+
320+
Since colimits are computed pointwise, the initial copresheaf is the constant
321+
functor at the empty set.
322+
323+
```agda
324+
module _
325+
{l1 l2 : Level} (C : Precategory l1 l2) (l : Level)
326+
where
327+
328+
obj-initial-copresheaf-Precategory :
329+
copresheaf-Precategory C l
330+
obj-initial-copresheaf-Precategory =
331+
constant-functor-Precategory
332+
C (Set-Precategory l) (raise-empty-Set l)
333+
334+
hom-initial-copresheaf-Precategory :
335+
( X : copresheaf-Precategory C l) →
336+
hom-Precategory
337+
(copresheaf-precategory-Precategory C l)
338+
obj-initial-copresheaf-Precategory
339+
X
340+
pr1 (hom-initial-copresheaf-Precategory X) x (map-raise ())
341+
pr2 (hom-initial-copresheaf-Precategory X) f =
342+
eq-htpy (λ where (map-raise ()))
343+
344+
is-unique-hom-initial-copresheaf-Precategory :
345+
( X : copresheaf-Precategory C l) →
346+
( τ :
347+
hom-Precategory
348+
(copresheaf-precategory-Precategory C l)
349+
obj-initial-copresheaf-Precategory
350+
X) →
351+
hom-initial-copresheaf-Precategory X = τ
352+
is-unique-hom-initial-copresheaf-Precategory X τ =
353+
eq-htpy-hom-family-natural-transformation-Precategory
354+
( C)
355+
( Set-Precategory l)
356+
( obj-initial-copresheaf-Precategory)
357+
( X)
358+
( hom-initial-copresheaf-Precategory X)
359+
( τ)
360+
( λ x → eq-htpy (λ where (map-raise ())))
361+
362+
initial-copresheaf-Precategory :
363+
initial-obj-Precategory
364+
(copresheaf-precategory-Precategory C l)
365+
pr1 initial-copresheaf-Precategory =
366+
obj-initial-copresheaf-Precategory
367+
pr1 (pr2 initial-copresheaf-Precategory X) =
368+
hom-initial-copresheaf-Precategory X
369+
pr2 (pr2 initial-copresheaf-Precategory X) τ =
370+
is-unique-hom-initial-copresheaf-Precategory X τ
371+
```
372+
373+
### The terminal copresheaf
374+
375+
Since limits are computed pointwise, the terminal copresheaf is the constant
376+
functor at the terminal set.
377+
378+
```agda
379+
module _
380+
{l1 l2 : Level} (C : Precategory l1 l2) (l : Level)
381+
where
382+
383+
obj-terminal-copresheaf-Precategory :
384+
copresheaf-Precategory C l
385+
obj-terminal-copresheaf-Precategory =
386+
constant-functor-Precategory
387+
C (Set-Precategory l) (raise-unit-Set l)
388+
389+
hom-terminal-copresheaf-Precategory :
390+
( X : copresheaf-Precategory C l) →
391+
hom-Precategory
392+
(copresheaf-precategory-Precategory C l)
393+
X
394+
obj-terminal-copresheaf-Precategory
395+
pr1 (hom-terminal-copresheaf-Precategory X) c m = raise-star
396+
pr2 (hom-terminal-copresheaf-Precategory X) f = refl
397+
398+
is-unique-hom-terminal-copresheaf-Precategory :
399+
( X : copresheaf-Precategory C l) →
400+
( τ :
401+
hom-Precategory
402+
(copresheaf-precategory-Precategory C l)
403+
X
404+
obj-terminal-copresheaf-Precategory) →
405+
hom-terminal-copresheaf-Precategory X = τ
406+
is-unique-hom-terminal-copresheaf-Precategory X τ =
407+
eq-htpy-hom-family-natural-transformation-Precategory
408+
( C)
409+
( Set-Precategory l)
410+
( X)
411+
( obj-terminal-copresheaf-Precategory)
412+
( hom-terminal-copresheaf-Precategory X)
413+
( τ)
414+
( λ x → eq-htpy (λ _ → eq-is-prop is-prop-raise-unit))
415+
416+
terminal-copresheaf-Precategory :
417+
terminal-obj-Precategory
418+
(copresheaf-precategory-Precategory C l)
419+
pr1 terminal-copresheaf-Precategory =
420+
obj-terminal-copresheaf-Precategory
421+
pr1 (pr2 terminal-copresheaf-Precategory X) =
422+
hom-terminal-copresheaf-Precategory X
423+
pr2 (pr2 terminal-copresheaf-Precategory X) τ =
424+
is-unique-hom-terminal-copresheaf-Precategory X τ
425+
```
426+
310427
## See also
311428

312429
- [The Yoneda lemma](category-theory.yoneda-lemma-precategories.md)

src/foundation/empty-types.lagda.md

+17
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ open import foundation-core.contractible-types
2222
open import foundation-core.equality-dependent-pair-types
2323
open import foundation-core.function-types
2424
open import foundation-core.propositions
25+
open import foundation-core.sets
26+
open import foundation-core.truncated-types
27+
open import foundation-core.truncation-levels
2528
```
2629

2730
</details>
@@ -105,6 +108,8 @@ pr1 (is-nonempty-Prop A) = is-nonempty A
105108
pr2 (is-nonempty-Prop A) = is-property-is-empty
106109
```
107110

111+
### Being empty is preserved under propositional truncations
112+
108113
```agda
109114
abstract
110115
is-empty-type-trunc-Prop :
@@ -128,6 +133,8 @@ abstract
128133
map-universal-property-trunc-Prop (is-nonempty-Prop X) (λ x f → f x)
129134
```
130135

136+
### Properties for the raised empty type
137+
131138
```agda
132139
abstract
133140
is-prop-raise-empty :
@@ -146,6 +153,16 @@ abstract
146153
is-empty-raise-empty :
147154
{l1 : Level} → is-empty (raise-empty l1)
148155
is-empty-raise-empty {l1} = map-inv-equiv (compute-raise-empty l1)
156+
157+
abstract
158+
is-set-raise-empty :
159+
{l1 : Level} → is-set (raise-empty l1)
160+
is-set-raise-empty = is-trunc-succ-is-trunc neg-one-𝕋 is-prop-raise-empty
161+
162+
raise-empty-Set :
163+
(l1 : Level) → Set l1
164+
pr1 (raise-empty-Set l1) = raise-empty l1
165+
pr2 (raise-empty-Set l1) = is-set-raise-empty
149166
```
150167

151168
### The type of all empty types of a given universe is contractible

0 commit comments

Comments
 (0)