module Cat.Instances.Functor.Limits where

Limits in functor categories🔗

Let be a category admitting limits. Then the functor category for any category, also admits limits. In particular, if is then so is

module _
  {o₁ ℓ₁} {C : Precategory o₁ ℓ₁}
  {o₂ ℓ₂} {D : Precategory o₂ ℓ₂}
  {o₃ ℓ₃} {E : Precategory o₃ ℓ₃}
  (has-D-lims : (F : Functor D C)  Limit F)
  (F : Functor D Cat[ E , C ])
  where

Let be a diagram, and suppose admits limits of diagrams; We wish to compute the limit First, observe that we can Uncurry to obtain a functor By fixing the value of the coordinate (say, to we obtain a family of diagrams in which, by assumption, all have limits.

    module F' = Bifunctor F
    module D-lim x = Limit (has-D-lims (F'.Left x))

Let us call the limit of — taken in lim-for, and similarly the unique, “terminating” cone homomorphism will be called !-for.

    !-for :  {x y} (f : E.Hom x y)  C.Hom (D-lim.apex x) (D-lim.apex y)
    !-for {x} {y} f = D-lim.universal y  j  F'.Right j .F₁ f C.∘ D-lim.ψ x j)
       g  C.extendl (F'.lrmap _ _)  ap₂ C._∘_ refl (D-lim.commutes x g))

    functor-apex : Functor E C
    functor-apex .F₀ x = D-lim.apex x
    functor-apex .F₁ {x} {y} f = !-for f
    functor-apex .F-id = D-lim.unique _ _ _ _ λ j 
      C.idr _  C.introl F'.rmap-id
    functor-apex .F-∘ f g = D-lim.unique _ _ _ _ λ j 
        C.pulll (D-lim.factors _ _ _)
       C.pullr (D-lim.factors _ _ _)
       C.pulll (sym (F'.rmap-∘ _ _))

  functor-limit : Limit F
  functor-limit = to-limit $ to-is-limit ml where
    open make-is-limit

    ml : make-is-limit F functor-apex
    ml .ψ j .η x = D-lim.ψ x j
    ml .ψ j .is-natural x y f = D-lim.factors _ _ _
    ml .commutes f = ext λ j  D-lim.commutes j f
    ml .universal eps p .η x = D-lim.universal x
       j  eps j .η x)
       f  p f ηₚ x)
    ml .universal eps p .is-natural x y f = D-lim.unique₂ y _
       g  C.pulll (p g ηₚ y))
       j  C.pulll (D-lim.factors _ _ _))
       j  C.pulll (D-lim.factors _ _ _)
          ∙∙ C.pullr (D-lim.factors _ _ _)
          ∙∙ sym (eps j .is-natural _ _ _))
    ml .factors eps p = ext λ j  D-lim.factors j _ _
    ml .unique eps p other q = ext λ x  D-lim.unique _ _ _ _ λ j  q j ηₚ x

As a corollary, if is an category, then so is

Functor-cat-is-complete :
   {o } {o₁ ℓ₁} {C : Precategory o₁ ℓ₁} {o₂ ℓ₂} {D : Precategory o₂ ℓ₂}
   is-complete o  D  is-complete o  Cat[ C , D ]
Functor-cat-is-complete D-complete = functor-limit D-complete