module Cat.Functor.Adjoint.ConstD {o } {C : Precategory o }  where

(Partial) adjoints to the diagonal functor🔗

Suppose that is a free object with respect to and then is a colimit of

const-free→colim : Free-object ConstD F  Colimit F
const-free→colim {F} free-ob = to-colimit $ to-is-colimit $ record where
  open module free = Free-object free-ob
  ψ = unit .η
  universal {x} eta commutes = fold {x} (NT eta λ j k f  commutes f  sym (idl _))

  commutes {j} {k} f = unit .is-natural _ _ f  idl _
  factors {j} eta p = commute {f = NT eta λ x y f  p f  sym (idl _)} ηₚ j
  unique eta p other commutes = unique other $ ext commutes

colim→const-free : Colimit F  Free-object ConstD F
colim→const-free {F} colim = record where
  open module colim = Colimit colim using (coapex; cocone)
  open make-is-colimit (unmake-colimit colim.has-colimit)
  free = coapex
  unit = cocone
  fold eta = universal (eta .η) λ f  eta .is-natural _ _ f  idl _

  commute {x} {nt} = ext λ j  factors (nt .η) λ _  nt .is-natural _ _ _  idl _
  unique {x} {nt} g p = unique (nt .η)  _  nt .is-natural _ _ _  idl _) g
    λ j  p ηₚ  j

const-cofree→lim : Cofree-object ConstD F  Limit F
lim→const-cofree : Limit F  Cofree-object ConstD F

The (Co)limit functor🔗

Any functor which is a right (resp: left) colimit to computes as (co)limits.

const-adj→has-colimits-of-shape
  :  {J : Precategory o' ℓ'} {Colim}  (Colim  ConstD {C = C} {J = J})
   (F : Functor J C)  Colimit F
const-adj→has-colimits-of-shape has-adj =
  const-free→colim  left-adjoint→free-objects has-adj

const-adj→has-limits-of-shape
  :  {J : Precategory o' ℓ'} {Lim}  (ConstD {C = C} {J = J}  Lim)
   (F : Functor J C)  Limit F
const-adj→has-limits-of-shape has-adj =
  const-cofree→lim  right-adjoint→cofree-objects has-adj

Thus, any category which has adjoints to its generalized diagonal functor for any is (co)complete.

has-const-adjs→is-cocomplete :  {o' ℓ'}  ({J : Precategory o' ℓ'}  Σ[ Colim  Functor _ C ] Colim  ConstD {C = C} {J = J})  is-cocomplete o' ℓ' C
has-const-adjs→is-cocomplete adjs = const-adj→has-colimits-of-shape (adjs .snd)

has-const-adjs→is-complete :  {o' ℓ'}  ({J : Precategory o' ℓ'}  Σ[ Lim  Functor _ C ] ConstD {C = C} {J = J}  Lim)  is-complete o' ℓ' C
has-const-adjs→is-complete adjs = const-adj→has-limits-of-shape (adjs .snd)