module Cat.Total.Instances.Set {β„“} where

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 β˜…

  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