module Cat.Total {o β} (C : Precategory o β) where
open import Cat.Functor.Hom C
private
open module C = Precategory C
variable
: Level
o' β' : Precategory o' β'
E : Precategory o' β' J
Total precategoriesπ
A precategory is total if its Yoneda embedding has a left adjoint. We call this adjoint γ, a reading for ε·¦, which means βleftβ.
record is-total : Type (o β lsuc β) where
field
{γ} : Functor Cat[ C ^op , Sets β ] C
: γ β£ γ
has-γ-adj open module γ = Cat.Functor.Reasoning γ using () renaming
(Fβ to γβ; Fβ to γβ) public
Motivationπ
Total categories represent a particularly nice site in which to do logic, as they are a reflective subcategory of their category of presheaves. In particular, total categories are cocomplete with many useful limits. However, a category being total is a slightly weaker requirement than a category being a topos, as all topoi are both total and cototal.
Free objects relative to γπ
Before we investigate the properties of a total category, itβs worth considering the action of such a functor on objects, if it exists. Given some presheaf an object could be if it is free with respect to
module _ (F : Functor (C ^op) (Sets β)) (c : Free-object γ F) where
open Free-object c
private
Since is a presheaf, it can be written as a colimit of representable functors by the coyoneda lemma.
: is-colimit (γ Fβ Οβ C F) F _
F-is-colimit = coyoneda _ F F-is-colimit
As left adjoints preserve colimits, we can imagine that a partial left adjoint (a free object) of a colimit should also be a colimit. Indeed this is true as is fully faithful.
We call a free object with respect to a realising object for
: is-colimit (Οβ C F) free _
free-is-colimit =
free-is-colimit (to-colimit F-is-colimit) c free-objectβis-colimit γ γ-is-fully-faithful
module Total (C-total : is-total) where
open module C-total = is-total C-total public
open Cat.Morphism C public
: γ Fβ γ β
βΏ Id
γβγβ
βΏid = is-reflectiveβcounit-iso has-γ-adj γ-is-fully-faithful
γβγβ
βΏid
private
: β {F : Functor J C} β γ Fβ γ Fβ F β
βΏ F
γβγβFβ
βΏF = ni-assoc βni (γβγβ
βΏid βni _) βni pathβiso Fβ-idl γβγβFβ
βΏF
γ on valuesπ
For each yields a free value on relative to As we have proved, this is a colimit.
: (F : β PSh β C β) β is-colimit (Οβ C F) (γβ F) _
γβ-is-colimit = free-is-colimit F $ left-adjointβfree-objects has-γ-adj F γβ-is-colimit F
Cocompletenessπ
Thus, all total categories are cocomplete as their colimits can be computed in
: is-cocomplete β β C
cocomplete = natural-isoβcolimit γβγβFβ
βΏF
cocomplete F
$ left-adjoint-colimit has-γ-adj(γ Fβ F) $ PSh-cocomplete β C
Terminal objectπ
Total categories also have many limits. For example, the terminal presheaf has a realisation in Furthermore, the projection functor from the category of elements of the terminal presheaf is an equivalence. A colimit of an equivalence is equivalent to a colimit of the identityβi.e., a terminal object.
: C.Ob
β
= γ.β (β€PSh _ _)
β
private
: is-colimit (Id {C = C}) β
_
β
-is-colimit-id = extend-is-colimit _
β
-is-colimit-id (right-adjoint-is-final (elements-terminal-is-equivalence.Fβ»ΒΉβ£F {s = β})) _
where
col' open is-equivalence
: is-colimit (Οβ C $ β€PSh _ _) β
_
col = γβ-is-colimit _
col
: is-colimit (Id Fβ Οβ C (β€PSh _ _)) β
_
col' = natural-iso-extβis-lan
col' (left-adjoint-is-cocontinuous (Id-is-equivalence .Fβ£Fβ»ΒΉ) col)
(!const-isoβΏ id-iso)
: Terminal C
total-terminal = Id-colimitβTerminal $ to-colimit β
-is-colimit-id
total-terminal module total-terminal = Terminal total-terminal
Copowersπ
As C
is cocomplete, it has all set-indexed coproducts
and is thus copowered.
open Cat.Diagram.Colimit.Coproduct C
: (S : Set β) β has-coproducts-indexed-by C β£ S β£
has-set-indexed-coproducts = ColimitβIC F (cocomplete $ Disc-adjunct F)
has-set-indexed-coproducts S F open Copowers has-set-indexed-coproducts public
open Consts total-terminal has-set-indexed-coproducts public