module Cat.Functor.Adjoint.ConstD {o ℓ} {C : Precategory o ℓ} where
open _=>_
private
variable
: Level
o' ℓ' : Precategory o' ℓ'
J D : Functor J C
F G open module C = Cat.Reasoning C
(Partial) adjoints to the diagonal functor🔗
Suppose that is a free object with respect to and then is a colimit of
: Free-object ConstD F → Colimit F
const-free→colim {F} free-ob = to-colimit $ to-is-colimit $ record where
const-free→colim open module free = Free-object free-ob
= unit .η
ψ {x} eta commutes = fold {x} (NT eta λ j k f → commutes f ∙ sym (idl _))
universal
{j} {k} f = unit .is-natural _ _ f ∙ idl _
commutes {j} eta p = commute {f = NT eta λ x y f → p f ∙ sym (idl _)} ηₚ j
factors = unique other $ ext commutes
unique eta p other commutes
: Colimit F → Free-object ConstD F
colim→const-free {F} colim = record where
colim→const-free open module colim = Colimit colim using (coapex; cocone)
open make-is-colimit (unmake-colimit colim.has-colimit)
= coapex
free = cocone
unit = universal (eta .η) λ f → eta .is-natural _ _ f ∙ idl _
fold eta
{x} {nt} = ext λ j → factors (nt .η) λ _ → nt .is-natural _ _ _ ∙ idl _
commute {x} {nt} g p = unique (nt .η) (λ _ → nt .is-natural _ _ _ ∙ idl _) g
unique λ j → p ηₚ j
: Cofree-object ConstD F → Limit F
const-cofree→lim : Limit F → Cofree-object ConstD F lim→const-cofree
-- this is better worked out explicitly
{F} cofree-ob = to-limit $ to-is-limit $ record where
const-cofree→lim open module cofree = Cofree-object cofree-ob
= counit .η
ψ {x} eta commutes = unfold {x} $ NT eta λ j k f → idr _ ∙ sym (commutes f)
universal
{j} {k} f = (sym $ counit .is-natural _ _ f) ∙ idr _
commutes {j} eta p = commute {f = NT eta λ j k f → idr _ ∙ sym (p f) } ηₚ j
factors = unique other $ ext commutes
unique eta p other commutes
{F} lim = record where
lim→const-cofree open Limit lim using (apex; cone)
open make-is-limit (unmake-limit (Limit.has-limit lim))
= apex
cofree = cone
counit = universal (eta .η) λ f → sym (eta .is-natural _ _ f) ∙ idr _
unfold eta
{x} {nt} = ext λ j → factors (nt .η) λ _ → sym (nt .is-natural _ _ _)
commute _
∙ idr {x} {nt} g p = unique (nt .η) (λ _ → sym (nt .is-natural _ _ _) ∙ idr _) g
unique λ j → p ηₚ j
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.
: ∀ {o' ℓ'} → ({J : Precategory o' ℓ'} → Σ[ Colim ∈ Functor _ C ] Colim ⊣ ConstD {C = C} {J = J}) → is-cocomplete o' ℓ' C
has-const-adjs→is-cocomplete = const-adj→has-colimits-of-shape (adjs .snd)
has-const-adjs→is-cocomplete adjs
: ∀ {o' ℓ'} → ({J : Precategory o' ℓ'} → Σ[ Lim ∈ Functor _ C ] ConstD {C = C} {J = J} ⊣ Lim) → is-complete o' ℓ' C
has-const-adjs→is-complete = const-adj→has-limits-of-shape (adjs .snd) has-const-adjs→is-complete adjs