module Cat.Total.Instances.Set {โ} where
open Terminal (Sets-terminal {โ}) renaming (top to โ
)
open _โฃ_
open _=>_
open Functor
private
Total cocompleteness of sets๐
If we are to show that the category of sets is total, we must give a colimit over the category of elements of every presheaf.
Suppose What would a colimit of look like? Let We require a universal function Notice that any element of a set is equivalent to a subobject sending the single element to Furthermore, sends this to a function Thus, setting we have a function from to as desired.
Now, let in the category of elements. Our cocone commutes as, for any as
: Functor (PSh โ (Sets โ)) (Sets โ)
ใ = eval-at โ
ใ
: ใ โฃ ใ (Sets โ)
has-ใ-adj .unit .ฮท P .ฮท X p s = P โช (ฮป _ โ s) โซ p
has-ใ-adj .unit .ฮท P .is-natural x y f = ext ฮป r s โ sym $ unext (P .F-โ _ _) _
has-ใ-adj .unit .is-natural F G nt = ext ฮป X s r โ
has-ใ-adj (ฮป _ โ r) โซ (nt .ฮท X s) โกหโจ unext (nt .is-natural _ _ _) _ โฉ
G โช (nt .ฮท โ
(F โช (ฮป _ โ r) โซ s)) โกหโจ unext (G .F-id) _ โฉ
(ฮป x โ x) โซ (nt .ฮท โ
(F โช (ฮป _ โ r) โซ s)) โ
G โช .counit .ฮท X s = s _
has-ใ-adj .counit .is-natural _ _ _ = refl
has-ใ-adj .zig {F} = F .F-id
has-ใ-adj .zag = trivial!
has-ใ-adj
: is-total (Sets โ)
Sets-total .is-total.ใ = ใ
Sets-total .is-total.has-ใ-adj = has-ใ-adj Sets-total