module Cat.Functor.Final where
Final functorsπ
A final functor expresses an equivalence of diagram schemata for the purposes of computing colimits: if is final, then colimits for are equivalent to colimits for A terminological warning: in older literature (e.g. (Borceux 1994) and (Adamek and Rosicky 1994)), these functors are called cofinal, but we stick with terminology from the nLab here.
module _ {o β o' β'} {π : Precategory o β} {π : Precategory o' β'} (F : Functor π π) where open Functor private module π = Cr π module π = Cr π module F = Functor F
Finality has an elementary characterisation: we define a functor to be final if, for every the comma category is connected. That is, unpacking, the following data: for every object an object and a map and for every span
a finite zigzag of morphisms from to inducing a chain of commuting triangles from to For example, in the case of a βcospanβ zigzag
is-final : Type (o β β β o' β β') is-final = β d β is-connected-cat (d β F)
module is-final (fin : is-final) (d : π.Ob) = is-connected-groupoid (fin d) module _ {o'' β''} {β° : Precategory o'' β''} (D : Functor π β°) where
The utility of this definition comes, as mentioned, from the ability to move cocones back and forth between a diagram and its restriction to the domain category in a way that preserves the property of being a colimit. First, for any functor we can restrict cocones under to cocones under by precomposition.
restrict-cocone : β {coapex} β D => Const coapex β D Fβ F => Const coapex restrict-cocone K .Ξ· x = K .Ξ· (F.β x) restrict-cocone K .is-natural x y f = K .is-natural (F.β x) (F.β y) (F.β f) Restrict-cocone : Functor (Cocones D) (Cocones (D Fβ F)) Restrict-cocone .Fβ K = coconeβCocone _ (restrict-cocone (Coconeβcocone _ K)) Restrict-cocone .Fβ f .map = f .map Restrict-cocone .Fβ f .com c = f .com (F.β c) Restrict-cocone .F-id = ext refl Restrict-cocone .F-β _ _ = ext refl
module _ {o'' β''} {β° : Precategory o'' β''} {D : Functor π β°} (final : is-final) where private module fin = is-final final module D = Func D module β° = Cr β°
The point is now that, if is final, then the restriction functor thus defined is an equivalence of categories between the categories of cocones under and
First, if we have a cocone then precomposition with the map (where comes from the finality of defines a cocone
However, since the comma category is merely inhabited, we need to make sure that this extension is independent of the choice of and This follows from naturality of the cocone and by connectedness of as expressed by the commutativity of the following diagram:
module _ {coapex} (cocone : D Fβ F => Const coapex) where extend : β d β Ob (d β F) β β°.Hom (D.β d) coapex extend d f = cocone .Ξ· (f .cod) β°.β D.β (f .map) opaque extend-const1 : β d {f g : Ob (d β F)} (h : βHom _ _ f g) β extend d f β‘ extend d g extend-const1 d {f} {g} h = cocone .Ξ· _ β°.β D.β (f .map) β‘Λβ¨ cocone .is-natural _ _ _ β β°.idl _ β°.β©ββ¨refl β©β‘Λ (cocone .Ξ· _ β°.β D.β (F.β (h .bot))) β°.β D.β (f .map) β‘β¨ D.pullr refl β©β‘ cocone .Ξ· _ β°.β D.β β F.β (h .bot) π.β f .map β β‘β¨ ap! (sym (h .com) β π.idr _) β©β‘ cocone .Ξ· _ β°.β D.β (g .map) β opaque extend-const : β d (f g : Ob (d β F)) β extend d f β‘ extend d g extend-const d f g = case fin.path d f g of Meander-rec-β‘ (el! _) (extend d) (extend-const1 d) extend' : β d β β₯ Ob (d β F) β₯ β β°.Hom (D.β d) coapex extend' d = β₯-β₯-rec-set (hlevel 2) (extend d) (extend-const d) extend-cocone : D => Const coapex extend-cocone .Ξ· d = extend' d (fin.point d) extend-cocone .is-natural x y f = case fin.point x , fin.point y return (Ξ» (x' , y') β extend' y y' β°.β D.β f β‘ β°.id β°.β extend' x x') of Ξ» x' y' β extend y y' β°.β D.β f β‘β¨ D.pullr refl β©β‘ extend x (βobj (y' .map π.β f)) β‘β¨ extend-const x (βobj _) x' β©β‘ extend x x' β‘β¨ β°.introl refl β©β‘ β°.id β°.β extend x x' β
A few more computations show that restrict-cocone and extend-cocone are inverses (so
that Restrict-cocone is an
equivalence on objects), and that the restriction functor is fully
faithful, which makes it an isomorphism of categories (and thus an
equivalence).
restrict-cocone-is-equiv : β {coapex} β is-equiv (restrict-cocone D {coapex = coapex}) restrict-cocone-is-equiv = is-isoβis-equiv Ξ» where .from K β extend-cocone K .rinv K β ext Ξ» c β case fin.point (F.β c) return (Ξ» c' β extend' _ (F.β c) c' β‘ K .Ξ· c) of Ξ» c' β extend-const K (F.β c) c' (βobj π.id) β D.elimr refl .linv K β ext Ξ» d β case fin.point d return (Ξ» d' β extend' (restrict-cocone D K) d d' β‘ K .Ξ· d) of Ξ» d' β K .is-natural _ _ (d' .map) β β°.eliml refl restrict-coconeβ : β {coapex} β (D => Const coapex) β (D Fβ F => Const coapex) restrict-coconeβ = _ , restrict-cocone-is-equiv Restrict-cocone-ff : is-fully-faithful (Restrict-cocone D) Restrict-cocone-ff {X} {Y} = is-isoβis-equiv Ξ» where .is-iso.from f .map β f .map .is-iso.from f .com d β case fin.point d of Ξ» d' β f .map β°.β X .Ο d β‘β¨ β°.cdr (sym (X .commutes (d' .map))) β©β‘ f .map β°.β X .Ο (F.β (d' .cod)) β°.β D.β (d' .map) β‘β¨ β°.pulll (f .com (d' .cod)) β©β‘ Y .Ο (F.β (d' .cod)) β°.β D.β (d' .map) β‘β¨ Y .commutes (d' .map) β©β‘ Y .Ο d β .is-iso.rinv _ β ext refl .is-iso.linv _ β ext refl Restrict-cocone-is-precat-iso : is-precat-iso (Restrict-cocone D) Restrict-cocone-is-precat-iso .has-is-ff = Restrict-cocone-ff Restrict-cocone-is-precat-iso .has-is-iso = snd $ Coconeβcocone _ βe Ξ£-ap-snd (Ξ» _ β restrict-coconeβ) βe Coconeβcocone _ eβ»ΒΉ Restrict-cocone-is-equivalence : is-equivalence (Restrict-cocone D) Restrict-cocone-is-equivalence = is-precat-isoβis-equivalence Restrict-cocone-is-precat-iso module Restrict-cocone = is-equivalence Restrict-cocone-is-equivalence
Since Restrict-cocone is an
equivalence, it preserves initial objects, i.e. colimiting cocones. In
other words, if
is a colimit of
then its restriction is a colimit of
restrict-is-colimit : β {coapex} β (K : D => Const coapex) β is-colimit D coapex K β is-colimit (D Fβ F) coapex (restrict-cocone D K) restrict-is-colimit {coapex} K colim = generalize-colimitp (is-initial-coconeβis-colimit _ (left-adjointβinitial (Restrict-cocone.Fβ£Fβ»ΒΉ) (is-colimitβis-initial-cocone _ colim))) refl
But we can also go the other way: if is a colimit of then its extension is a colimit of
extend-is-colimit : β {coapex} (K : D Fβ F => Const coapex) β is-colimit (D Fβ F) coapex K β is-colimit D coapex (extend-cocone K) extend-is-colimit {coapex} K colim = generalize-colimitp (is-initial-coconeβis-colimit _ (left-adjointβinitial Restrict-cocone.Fβ»ΒΉβ£F (is-colimitβis-initial-cocone _ colim))) Ξ» {d} β case fin.point d return (Ξ» d' β extend' _ d d' β‘ extend' K d d') of Ξ» d' β refl
Finally, we summarise these results as a displayed equivalence between the property of being a colimit for cocones under and for cocones under
finalβis-colimitβ : β {coapex} β is-colimit D coapex β[ restrict-coconeβ ] is-colimit (D Fβ F) coapex finalβis-colimitβ = prop-over-ext! restrict-coconeβ restrict-is-colimit extend-is-colimit
Examplesπ
Final functors between pregroupoids have a very simple characterisation: they are the full, essentially surjective functors. In this case, there is a direct connection with homotopy type theory: groupoids are 1-types, comma categories are fibres of over and so finality says that is a connected map.
Essential surjectivity on objects pretty much exactly says that each comma category is inhabited. To see that fullness implies the existence of zigzags, meditate on the following diagram:
module _ (π-grpd : is-pregroupoid π) (π-grpd : is-pregroupoid π) where full+esoβfinal : is-full F β is-eso F β is-final full+esoβfinal full eso d .path f g = do z , p β full (g .map π.β π-grpd (f .map) .inv) pure $ zig (βhom {bot = z} (π.idr _ β sym (π.rswizzle p (π-grpd (f .map) .invr)))) [] where open π.is-invertible full+esoβfinal full eso d .point = β₯-β₯-map (Ξ» e β βobj (π.from (e .snd))) (eso d)
For the other direction, given observe that connectedness of the comma category gives us a zigzag between and but since is a pregroupoid we can evaluate this zigzag to a single morphism such that
finalβfull+eso : is-final β is-full F Γ is-eso F finalβfull+eso fin .fst {x} {y} f = do zs β fin (F.β x) .path (βobj π.id) (βobj f) let z = Free-groupoid-counit (β-is-pregroupoid _ _ β€Cat-is-pregroupoid π-grpd) .Fβ zs pure (z .bot , sym (π.idr _) β sym (z .com) β π.idr _) finalβfull+eso fin .snd d = do fd β fin d .point pure (fd .cod , π.invertibleβiso (fd .map) (π-grpd _) π.Isoβ»ΒΉ)
Another general class of final functors is given by right adjoint functors. This follows directly from the characterisation of right adjoints in terms of free objects: since the comma categories have initial objects, they are connected.
opaque right-adjoint-is-final : β {o β o' β'} {π : Precategory o β} {π : Precategory o' β'} β {L : Functor π π} {R : Functor π π} (Lβ£R : L β£ R) β is-final R right-adjoint-is-final Lβ£R c = initialβconnected (left-adjointβuniversal-maps Lβ£R c)
In particular, the inclusion of a terminal object into a category is a final functor. This means that the colimit of any diagram over a shape category with a terminal object is simply the value of the diagram on the terminal object.
terminalβinclusion-is-final : β {o β} {π : Precategory o β} β (top : π .Ob) (term : is-terminal π top) β is-final (!Const {C = π} top) terminalβinclusion-is-final top term = right-adjoint-is-final (is-terminalβinclusion-is-right-adjoint _ top term)
Closure under compositionπ
module _ {o β o' β' o'' β''} {π : Precategory o β} {π : Precategory o' β'} {β° : Precategory o'' β''} (F : Functor π π) (G : Functor π β°) (f-fin : is-final F) (g-fin : is-final G) where private module π = Cr π module β° = Cr β° module G = Func G module F = Functor F module ff = is-final F f-fin module gf = is-final G g-fin open β-compose F G
We now prove that final functors are closed under composition.
First, given an object we get a map using the finality of and a map using the finality of which we can compose into an object of
Fβ-is-final : is-final (G Fβ F) Fβ-is-final c .point = do g β gf.point c f β ff.point (g .cod) pure (g β> f)
Now, given a span
finality of
gives us a zigzag between
and
in
but we need a zigzag between
and
in
Thus we have to refine our zigzag step by step,
using the finality of
Fβ-is-final c .path f g = do gz β gf.path c (βobj (f .map)) (βobj (g .map)) fz β refine gz (βobj π.id) (βobj π.id) pure (substβ (Meander (c β G Fβ F)) β>-id β>-id fz)
We start by defining a congruence on the objects of whereby and are related if, for any extensions and there merely exists a zigzag between the corresponding objects of
where R : Congruence (Ob (c β G)) _ R ._βΌ_ f g = β (f' : Ob (f .cod β F)) (g' : Ob (g .cod β F)) β β₯ Meander (c β G Fβ F) (f β> f') (g β> g') β₯ R .has-is-prop _ _ = hlevel 1
That this is a congruence is easily checked using the finality of
R .reflαΆ {f} f' g' = Free-groupoid-map (β-compose f) .Fβ <$> ff.path (f .cod) f' g' R ._βαΆ_ {f} {g} {h} fg gh f' h' = do g' β ff.point (g .cod) β₯-β₯-mapβ _++_ (gh g' h') (fg f' g') R .symαΆ fg g' f' = β₯-β₯-map (reverse _) (fg f' g')
Using the universal mapping property of the free groupoid into congruences, we conclude by showing that any two arrows connected by a morphism are related, which again involves the connectedness of
refine1 : β {f g} β Hom (c β G) f g β R ._βΌ_ f g refine1 {f} {g} h f' g' = do z β ff.path (f .cod) f' (βobj (g' .map π.β h .bot)) let z' : Meander (c β G Fβ F) _ _ z' = Free-groupoid-map (β-compose f) .Fβ z fixup : f β> βobj (g' .map π.β h .bot) β‘ g β> g' fixup = ext $ refl ,β G.pushl refl β (β°.reflβ©ββ¨ sym (h .com) β β°.idr _) pure (subst (Meander (c β G Fβ F) (f β> f')) fixup z') refine : β {f g} β Meander (c β G) f g β R ._βΌ_ f g refine = Meander-rec-congruence R refine1
References
- Adamek, J., and J. Rosicky. 1994. Locally Presentable and Accessible Categories. Lecture Note Series / London Mathematical Society. Cambridge University Press. https://books.google.com.br/books?id=iXh6rOd7of0C.
- Borceux, Francis. 1994. Handbook of Categorical Algebra. Vol. 1. Encyclopedia of Mathematics and Its Applications. Cambridge University Press. https://doi.org/10.1017/CBO9780511525858.