module Cat.Total.Instances.Set {โ} whereopen Terminal (Sets-terminal {โ}) renaming (top to โ
)
open _โฃ_
open _=>_
open Functor
privateTotal 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 โ
has-ใ-adj : ใ โฃ ใ (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 โ
G โช (ฮป _ โ r) โซ (nt .ฮท X s) โกหโจ unext (nt .is-natural _ _ _) _ โฉ
(nt .ฮท โ
(F โช (ฮป _ โ r) โซ s)) โกหโจ unext (G .F-id) _ โฉ
G โช (ฮป x โ x) โซ (nt .ฮท โ
(F โช (ฮป _ โ r) โซ s)) โ
has-ใ-adj .counit .ฮท X s = s _
has-ใ-adj .counit .is-natural _ _ _ = refl
has-ใ-adj .zig {F} = F .F-id
has-ใ-adj .zag = trivial!
Sets-total : is-total (Sets โ)
Sets-total .is-total.ใ = ใ
Sets-total .is-total.has-ใ-adj = has-ใ-adj