open import Cat.Diagram.Limit.Base
open import Cat.Displayed.Total
open import Cat.Functor.Algebra
open import Cat.Prelude

import Cat.Functor.Reasoning
import Cat.Reasoning
module Cat.Functor.Algebra.Limits where

Limits in categories of algebras๐Ÿ”—

This short note details the construction of limits in categories of F-algebras from limits in the underlying category.

module _
  {o โ„“ oj โ„“j} {C : Precategory o โ„“}
  (F : Functor C C)
  {J : Precategory oj โ„“j} (K : Functor J (FAlg F))
  where
  open Cat.Reasoning C
  private
    module J = Cat.Reasoning J
    module F = Cat.Functor.Reasoning F
    module K = Cat.Functor.Reasoning K
  open Total-hom

Let be an endofunctor, and be a diagram of If has a limit of then is the limit of in

  Forget-algebra-lift-limit : Limit (ฯ€แถ  (F-Algebras F) Fโˆ˜ K) โ†’ Limit K
  Forget-algebra-lift-limit L = to-limit (to-is-limit L') where
    module L = Limit L
    open make-is-limit

As noted earlier, the underlying object of the limit is The algebra is constructed via the universal property of to give a map it suffices to give maps for every which we can construct by composing the projection with the algebra

    apex : FAlg.Ob F
    apex .fst = L.apex
    apex .snd = L.universal (ฮป j โ†’ K.โ‚€ j .snd โˆ˜ F.โ‚ (L.ฯˆ j)) comm where abstract
      comm
        : โˆ€ {i j : J.Ob} (f : J.Hom i j)
        โ†’ K.โ‚ f .hom โˆ˜ K.โ‚€ i .snd โˆ˜ F.โ‚ (L.ฯˆ i) โ‰ก K.โ‚€ j .snd โˆ˜ F.โ‚ (L.ฯˆ j)
      comm {i} {j} f =
        K.โ‚ f .hom โˆ˜ K.โ‚€ i .snd โˆ˜ F.โ‚ (L.ฯˆ i)         โ‰กโŸจ pulll (K.โ‚ f .preserves) โŸฉ
        (K.โ‚€ j .snd โˆ˜ F.โ‚ (K.โ‚ f .hom)) โˆ˜ F.โ‚ (L.ฯˆ i) โ‰กโŸจ F.pullr (L.commutes f) โŸฉ
        K.โ‚€ j .snd โˆ˜ F.โ‚ (L.ฯˆ j)                      โˆŽ

A short series of calculations shows that the projections and universal map associated to are homomorphisms.

    L' : make-is-limit K apex
    L' .ฯˆ j .hom = L.ฯˆ j
    L' .ฯˆ j .preserves = L.factors _ _
    L' .universal eps p .hom =
      L.universal (ฮป j โ†’ eps j .hom) (ฮป f โ†’ ap hom (p f))
    L' .universal eps p .preserves =
      L.uniqueโ‚‚ (ฮป j โ†’ K.Fโ‚€ j .snd โˆ˜ F.โ‚ (eps j .hom))
        (ฮป f โ†’ pulll (K.โ‚ f .preserves) โˆ™ F.pullr (ap hom (p f)))
        (ฮป j โ†’ pulll (L.factors _ _) โˆ™ eps j .preserves)
        (ฮป j โ†’ pulll (L.factors _ _) โˆ™ F.pullr (L.factors _ _))

Finally, equality of morphisms of is given by equality on the underlying morphisms, so all of the relevant diagrams in commute.

    L' .commutes f =
      total-hom-path (F-Algebras F) (L.commutes f) prop!
    L' .factors eps p =
      total-hom-path (F-Algebras F) (L.factors _ _) prop!
    L' .unique eps p other q =
      total-hom-path (F-Algebras F) (L.unique _ _ _ ฮป j โ†’ ap hom (q j)) prop!
module _
  {o โ„“ oฮบ โ„“ฮบ} {C : Precategory o โ„“}
  (complete : is-complete oฮบ โ„“ฮบ C)
  where

This gives us the following useful corollary: if is then is also complete.

  FAlg-is-complete : (F : Functor C C) โ†’ is-complete oฮบ โ„“ฮบ (FAlg F)
  FAlg-is-complete F K = Forget-algebra-lift-limit F K (complete (ฯ€แถ  (F-Algebras F) Fโˆ˜ K))