Skip to content

Commit

Permalink
Opposite categories, gaunt categories, replete subprecategories, larg…
Browse files Browse the repository at this point in the history
…e Yoneda, and miscellaneous additions (#880)
  • Loading branch information
fredrik-bakke authored Nov 1, 2023
1 parent f392337 commit bc21da4
Show file tree
Hide file tree
Showing 103 changed files with 3,731 additions and 846 deletions.
3 changes: 1 addition & 2 deletions TEMPLATE.lagda.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,4 @@ concept-subconcept = ...

1. Univalent Foundations Project, _Homotopy Type Theory – Univalent Foundations
of Mathematics_ (2013) ([website](https://homotopytypetheory.org/book/),
[arXiv:1308.0729](https://arxiv.org/abs/1308.0729),
[DOI:10.48550](https://doi.org/10.48550/arXiv.1308.0729))
[arXiv:1308.0729](https://arxiv.org/abs/1308.0729))
9 changes: 9 additions & 0 deletions src/category-theory.lagda.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ open import category-theory.category-of-maps-from-small-to-large-categories publ
open import category-theory.commuting-squares-of-morphisms-in-large-precategories public
open import category-theory.commuting-squares-of-morphisms-in-precategories public
open import category-theory.composition-operations-on-binary-families-of-sets public
open import category-theory.copresheaf-categories public
open import category-theory.coproducts-in-precategories public
open import category-theory.dependent-products-of-categories public
open import category-theory.dependent-products-of-large-categories public
Expand Down Expand Up @@ -59,6 +60,7 @@ open import category-theory.functors-from-small-to-large-precategories public
open import category-theory.functors-large-categories public
open import category-theory.functors-large-precategories public
open import category-theory.functors-precategories public
open import category-theory.gaunt-categories public
open import category-theory.groupoids public
open import category-theory.homotopies-natural-transformations-large-precategories public
open import category-theory.initial-objects-large-categories public
Expand All @@ -70,6 +72,7 @@ open import category-theory.isomorphisms-in-categories public
open import category-theory.isomorphisms-in-large-categories public
open import category-theory.isomorphisms-in-large-precategories public
open import category-theory.isomorphisms-in-precategories public
open import category-theory.isomorphisms-in-subprecategories public
open import category-theory.large-categories public
open import category-theory.large-function-categories public
open import category-theory.large-function-precategories public
Expand All @@ -88,6 +91,7 @@ open import category-theory.natural-isomorphisms-maps-categories public
open import category-theory.natural-isomorphisms-maps-precategories public
open import category-theory.natural-numbers-object-precategories public
open import category-theory.natural-transformations-functors-categories public
open import category-theory.natural-transformations-functors-from-small-to-large-categories public
open import category-theory.natural-transformations-functors-from-small-to-large-precategories public
open import category-theory.natural-transformations-functors-large-categories public
open import category-theory.natural-transformations-functors-large-precategories public
Expand All @@ -97,7 +101,9 @@ open import category-theory.natural-transformations-maps-from-small-to-large-pre
open import category-theory.natural-transformations-maps-precategories public
open import category-theory.nonunital-precategories public
open import category-theory.one-object-precategories public
open import category-theory.opposite-categories public
open import category-theory.opposite-precategories public
open import category-theory.opposite-preunivalent-categories public
open import category-theory.precategories public
open import category-theory.precategory-of-functors public
open import category-theory.precategory-of-functors-from-small-to-large-precategories public
Expand All @@ -109,10 +115,13 @@ open import category-theory.preunivalent-categories public
open import category-theory.products-in-precategories public
open import category-theory.products-of-precategories public
open import category-theory.pullbacks-in-precategories public
open import category-theory.replete-subprecategories public
open import category-theory.representable-functors-categories public
open import category-theory.representable-functors-large-precategories public
open import category-theory.representable-functors-precategories public
open import category-theory.representing-arrow-category public
open import category-theory.rigid-objects-categories public
open import category-theory.rigid-objects-precategories public
open import category-theory.sieves-in-categories public
open import category-theory.simplex-category public
open import category-theory.slice-precategories public
Expand Down
121 changes: 121 additions & 0 deletions src/category-theory/categories.lagda.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ open import category-theory.precategories
open import category-theory.preunivalent-categories

open import foundation.1-types
open import foundation.cartesian-product-types
open import foundation.dependent-pair-types
open import foundation.equivalences
open import foundation.identity-types
open import foundation.propositions
open import foundation.sets
open import foundation.surjective-maps
open import foundation.universe-levels
```

Expand Down Expand Up @@ -56,6 +58,10 @@ module _

is-category-Precategory : UU (l1 ⊔ l2)
is-category-Precategory = type-Prop is-category-prop-Precategory

is-prop-is-category-Precategory : is-prop is-category-Precategory
is-prop-is-category-Precategory =
is-prop-type-Prop is-category-prop-Precategory
```

### The type of categories
Expand Down Expand Up @@ -156,6 +162,20 @@ module _
is-emb-is-equiv (is-category-Category C x y)
```

### The total hom-type of a preunivalent category

```agda
total-hom-Category :
{l1 l2 : Level} (C : Category l1 l2) UU (l1 ⊔ l2)
total-hom-Category C = total-hom-Precategory (precategory-Category C)

obj-total-hom-Category :
{l1 l2 : Level} (C : Category l1 l2)
total-hom-Category C
obj-Category C × obj-Category C
obj-total-hom-Category C = obj-total-hom-Precategory (precategory-Category C)
```

### Equalities induce morphisms

```agda
Expand Down Expand Up @@ -207,3 +227,104 @@ module _
obj-1-type-Category =
obj-1-type-Preunivalent-Category (preunivalent-category-Category C)
```

### The total hom-type of a category is a 1-type

```agda
module _
{l1 l2 : Level} (C : Category l1 l2)
where

is-1-type-total-hom-Category :
is-1-type (total-hom-Category C)
is-1-type-total-hom-Category =
is-1-type-total-hom-Preunivalent-Category (preunivalent-category-Category C)

total-hom-1-type-Category : 1-Type (l1 ⊔ l2)
total-hom-1-type-Category =
total-hom-1-type-Preunivalent-Category (preunivalent-category-Category C)
```

### A preunivalent category is a category if and only if `iso-eq` is surjective

```agda
module _
{l1 l2 : Level} (C : Precategory l1 l2)
where

is-surjective-iso-eq-prop-Precategory : Prop (l1 ⊔ l2)
is-surjective-iso-eq-prop-Precategory =
Π-Prop
( obj-Precategory C)
( λ x
Π-Prop
( obj-Precategory C)
( λ y
is-surjective-Prop
( iso-eq-Precategory C x y)))

is-surjective-iso-eq-Precategory : UU (l1 ⊔ l2)
is-surjective-iso-eq-Precategory =
type-Prop is-surjective-iso-eq-prop-Precategory

is-prop-is-surjective-iso-eq-Precategory :
is-prop is-surjective-iso-eq-Precategory
is-prop-is-surjective-iso-eq-Precategory =
is-prop-type-Prop is-surjective-iso-eq-prop-Precategory
```

```agda
module _
{l1 l2 : Level} (C : Preunivalent-Category l1 l2)
where

is-category-is-surjective-iso-eq-Preunivalent-Category :
is-surjective-iso-eq-Precategory (precategory-Preunivalent-Category C)
is-category-Precategory (precategory-Preunivalent-Category C)
is-category-is-surjective-iso-eq-Preunivalent-Category
is-surjective-iso-eq-C x y =
is-equiv-is-emb-is-surjective
( is-surjective-iso-eq-C x y)
( is-preunivalent-Preunivalent-Category C x y)

is-surjective-iso-eq-is-category-Preunivalent-Category :
is-category-Precategory (precategory-Preunivalent-Category C)
is-surjective-iso-eq-Precategory (precategory-Preunivalent-Category C)
is-surjective-iso-eq-is-category-Preunivalent-Category
is-category-C x y =
is-surjective-is-equiv (is-category-C x y)

is-equiv-is-category-is-surjective-iso-eq-Preunivalent-Category :
is-equiv is-category-is-surjective-iso-eq-Preunivalent-Category
is-equiv-is-category-is-surjective-iso-eq-Preunivalent-Category =
is-equiv-is-prop
( is-prop-is-surjective-iso-eq-Precategory
( precategory-Preunivalent-Category C))
( is-prop-is-category-Precategory (precategory-Preunivalent-Category C))
( is-surjective-iso-eq-is-category-Preunivalent-Category)

is-equiv-is-surjective-iso-eq-is-category-Preunivalent-Category :
is-equiv is-surjective-iso-eq-is-category-Preunivalent-Category
is-equiv-is-surjective-iso-eq-is-category-Preunivalent-Category =
is-equiv-is-prop
( is-prop-is-category-Precategory (precategory-Preunivalent-Category C))
( is-prop-is-surjective-iso-eq-Precategory
( precategory-Preunivalent-Category C))
( is-category-is-surjective-iso-eq-Preunivalent-Category)

equiv-is-category-is-surjective-iso-eq-Preunivalent-Category :
is-surjective-iso-eq-Precategory (precategory-Preunivalent-Category C) ≃
is-category-Precategory (precategory-Preunivalent-Category C)
pr1 equiv-is-category-is-surjective-iso-eq-Preunivalent-Category =
is-category-is-surjective-iso-eq-Preunivalent-Category
pr2 equiv-is-category-is-surjective-iso-eq-Preunivalent-Category =
is-equiv-is-category-is-surjective-iso-eq-Preunivalent-Category

equiv-is-surjective-iso-eq-is-category-Preunivalent-Category :
is-category-Precategory (precategory-Preunivalent-Category C) ≃
is-surjective-iso-eq-Precategory (precategory-Preunivalent-Category C)
pr1 equiv-is-surjective-iso-eq-is-category-Preunivalent-Category =
is-surjective-iso-eq-is-category-Preunivalent-Category
pr2 equiv-is-surjective-iso-eq-is-category-Preunivalent-Category =
is-equiv-is-surjective-iso-eq-is-category-Preunivalent-Category
```
169 changes: 169 additions & 0 deletions src/category-theory/copresheaf-categories.lagda.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
# Copresheaf categories

```agda
module category-theory.copresheaf-categories where
```

<details><summary>Imports</summary>

```agda
open import category-theory.categories
open import category-theory.category-of-functors-from-small-to-large-categories
open import category-theory.functors-precategories
open import category-theory.large-categories
open import category-theory.large-precategories
open import category-theory.precategories
open import category-theory.precategory-of-functors-from-small-to-large-precategories

open import foundation.category-of-sets
open import foundation.sets
open import foundation.universe-levels
```

</details>

## Idea

Given a [precategory](category-theory.precategories.md) `C`, we can form its
**copresheaf [category](category-theory.large-categories.md)** as the
[large category of functors](category-theory.functors-from-small-to-large-precategories.md)
from `C`, into the [large category of sets](foundation.category-of-sets.md)

```text
C Set.
```

To this large category, there is an associated
[small category](category-theory.categories.md) of small copresheaves, taking
values in small [sets](foundation-core.sets.md).

## Definitions

### The large category of copresheaves on a precategory

```agda
module _
{l1 l2 : Level} (C : Precategory l1 l2)
where

copresheaf-Large-Precategory :
Large-Precategory (λ l l1 ⊔ l2 ⊔ lsuc l) (λ l l' l1 ⊔ l2 ⊔ l ⊔ l')
copresheaf-Large-Precategory =
functor-large-precategory-Small-Large-Precategory C Set-Large-Precategory

is-large-category-copresheaf-Large-Category :
is-large-category-Large-Precategory copresheaf-Large-Precategory
is-large-category-copresheaf-Large-Category =
is-large-category-functor-large-precategory-is-large-category-Small-Large-Precategory
( C)
( Set-Large-Precategory)
( is-large-category-Set-Large-Precategory)

copresheaf-Large-Category :
Large-Category (λ l l1 ⊔ l2 ⊔ lsuc l) (λ l l' l1 ⊔ l2 ⊔ l ⊔ l')
large-precategory-Large-Category copresheaf-Large-Category =
copresheaf-Large-Precategory
is-large-category-Large-Category copresheaf-Large-Category =
is-large-category-copresheaf-Large-Category
```

We record the components of the large category of copresheaves on a precategory.

```agda
obj-copresheaf-Large-Category =
obj-Large-Precategory copresheaf-Large-Precategory

hom-set-copresheaf-Large-Category =
hom-set-Large-Precategory copresheaf-Large-Precategory

hom-copresheaf-Large-Category =
hom-Large-Precategory copresheaf-Large-Precategory

comp-hom-copresheaf-Large-Category =
comp-hom-Large-Precategory copresheaf-Large-Precategory

id-hom-copresheaf-Large-Category =
id-hom-Large-Precategory copresheaf-Large-Precategory

associative-comp-hom-copresheaf-Large-Category =
associative-comp-hom-Large-Precategory copresheaf-Large-Precategory

left-unit-law-comp-hom-copresheaf-Large-Category =
left-unit-law-comp-hom-Large-Precategory copresheaf-Large-Precategory

right-unit-law-comp-hom-copresheaf-Large-Category =
right-unit-law-comp-hom-Large-Precategory copresheaf-Large-Precategory
```

### The category of small copresheaves on a precategory

```agda
module _
{l1 l2 : Level} (C : Precategory l1 l2) (l : Level)
where

copresheaf-Precategory : Precategory (l1 ⊔ l2 ⊔ lsuc l) (l1 ⊔ l2 ⊔ l)
copresheaf-Precategory =
precategory-Large-Precategory (copresheaf-Large-Precategory C) l

copresheaf-Category : Category (l1 ⊔ l2 ⊔ lsuc l) (l1 ⊔ l2 ⊔ l)
copresheaf-Category = category-Large-Category (copresheaf-Large-Category C) l
```

We also record the components of the category of small copresheaves on a
precategory.

```agda
obj-copresheaf-Category =
obj-Precategory copresheaf-Precategory

hom-set-copresheaf-Category =
hom-set-Precategory copresheaf-Precategory

hom-copresheaf-Category =
hom-Precategory copresheaf-Precategory

comp-hom-copresheaf-Category =
comp-hom-Precategory copresheaf-Precategory

id-hom-copresheaf-Category =
id-hom-Precategory copresheaf-Precategory

associative-comp-hom-copresheaf-Category =
associative-comp-hom-Precategory copresheaf-Precategory

left-unit-law-comp-hom-copresheaf-Category =
left-unit-law-comp-hom-Precategory copresheaf-Precategory

right-unit-law-comp-hom-copresheaf-Category =
right-unit-law-comp-hom-Precategory copresheaf-Precategory
```

### Sections of copresheaves

As a choice of universe level must be made to talk about sections of
copresheaves, this notion coincides for the large and small category of
copresheaves.

```agda
module _
{l1 l2 l3 : Level} (C : Precategory l1 l2)
where

section-copresheaf-Category :
(F : obj-copresheaf-Category C l3) (c : obj-Precategory C) UU l3
section-copresheaf-Category F c =
type-Set (obj-functor-Precategory C (Set-Precategory l3) F c)
```

## See also

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

## External links

- [Presheaf precategories](https://1lab.dev/Cat.Functor.Base.html#presheaf-precategories)
at 1lab
- [category of presheaves](https://ncatlab.org/nlab/show/category+of+presheaves)
at nlab
- [copresheaf](https://ncatlab.org/nlab/show/copresheaf) at nlab
Loading

0 comments on commit bc21da4

Please sign in to comment.