module Cat.Total {o β} (C : Precategory o β) where
open import Cat.Functor.Hom Cprivate
open module C = Precategory C
variable
o' β' : Level
E : Precategory o' β'
J : Precategory o' β'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 γβ) publicMotivationπ
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
privateSince is a presheaf, it can be written as a colimit of representable functors by the coyoneda lemma.
F-is-colimit : is-colimit (γ Fβ Οβ C F) F _
F-is-colimit = coyoneda _ FAs 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
free-is-colimit : is-colimit (Οβ C F) free _
free-is-colimit =
free-objectβis-colimit γ γ-is-fully-faithful (to-colimit F-is-colimit) cmodule Total (C-total : is-total) where
open module C-total = is-total C-total public
open Cat.Morphism C public
γβγβ
βΏid : γ Fβ γ β
βΏ Id
γβγβ
βΏid = is-reflectiveβcounit-iso has-γ-adj γ-is-fully-faithful
private
γβγβFβ
βΏF : β {F : Functor J C} β γ Fβ γ Fβ F β
βΏ F
γβγβFβ
βΏF = ni-assoc βni (γβγβ
βΏid βni _) βni pathβiso Fβ-idlγ on valuesπ
For each yields a free value on relative to As we have proved, this is a colimit.
γβ-is-colimit : (F : β PSh β C β) β is-colimit (Οβ C F) (γβ F) _
γβ-is-colimit F = free-is-colimit F $ left-adjointβfree-objects has-γ-adj FCocompletenessπ
Thus, all total categories are cocomplete as their colimits can be computed in
cocomplete : is-cocomplete β β C
cocomplete F = natural-isoβcolimit γβγβFβ
βΏF
$ left-adjoint-colimit has-γ-adj
$ PSh-cocomplete β C (γ Fβ F)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 : is-colimit (Id {C = C}) β
_
β
-is-colimit-id =
extend-is-colimit _
(right-adjoint-is-final (elements-terminal-is-equivalence.Fβ»ΒΉβ£F {s = β})) _
col'
where
open is-equivalence
col : is-colimit (Οβ C $ β€PSh _ _) β
_
col = γβ-is-colimit _
col' : is-colimit (Id Fβ Οβ C (β€PSh _ _)) β
_
col' = natural-iso-extβis-lan
(left-adjoint-is-cocontinuous (Id-is-equivalence .Fβ£Fβ»ΒΉ) col)
(!const-isoβΏ id-iso)
total-terminal : Terminal C
total-terminal = Id-colimitβTerminal $ to-colimit β
-is-colimit-id
module total-terminal = Terminal total-terminalCopowersπ
As C is cocomplete, it has all set-indexed coproducts
and is thus copowered.
open Cat.Diagram.Colimit.Coproduct C
has-set-indexed-coproducts : (S : Set β) β has-coproducts-indexed-by C β£ S β£
has-set-indexed-coproducts S F = ColimitβIC F (cocomplete $ Ξ β-adjunct C F)
open Copowers has-set-indexed-coproducts public
open Consts total-terminal has-set-indexed-coproducts public