module Cat.Diagram.Colimit.Cocone where
Colimits via coconesπ
As noted in the main page on colimits, most
introductory texts opt to define colimits via categorical gadgets called
cocones. A Cocone
over
is given by an object (the coapex
) together with a family of
maps Ο
β one for each object in the
indexing category J
β such that βeverything in sight
commutesβ.
module _ {J : Precategory o β} {C : Precategory o' β'} (F : Functor J C) where private module C = Cat.Reasoning C module J = Precategory J module F = Functor F
record Cocone : Type (o β β β o' β β') where no-eta-equality constructor cocone field coapex : C.Ob Ο : (x : J.Ob) β C.Hom (F.β x) coapex commutes : β {x y} (f : J.Hom x y) β Ο y C.β F.β f β‘ Ο x
open Cocone Cocone-path : {x y : Cocone} β (p : x .coapex β‘ y .coapex) β (β o β PathP (Ξ» i β C.Hom (F.β o) (p i)) (Ο x o) (Ο y o)) β x β‘ y Cocone-path p q i .coapex = p i Cocone-path p q i .Ο o = q o i Cocone-path {x = x} {y = y} p q i .commutes {x = a} {y = b} f = is-propβpathp (Ξ» i β C.Hom-set _ _ (q b i C.β F.β f) (q a i)) (x .commutes f) (y .commutes f) i
Cocone mapsπ
To express the universal property of a colimit in terms of cocones, we now have to define the notion of cocone homomorphism. We define a cocone homomorphism to be a map between the coapices which commutes with the family
record Cocone-hom (x y : Cocone) : Type (o β β') where no-eta-equality constructor cocone-hom field hom : C.Hom (x .coapex) (y .coapex) commutes : β o β hom C.β x .Ο o β‘ y .Ο o
private unquoteDecl eqv = declare-record-iso eqv (quote Cocone-hom) open Cocone-hom Cocone-hom-path : β {x y} {f g : Cocone-hom x y} β f .hom β‘ g .hom β f β‘ g Cocone-hom-path p i .hom = p i Cocone-hom-path {x = x} {y = y} {f = f} {g = g} p i .commutes o j = is-setβsquarep (Ξ» i j β C.Hom-set _ _) (Ξ» j β p j C.β x .Ο o) (f .commutes o) (g .commutes o) refl i j
Since cocone homomorphisms are closed under composition in the base category, itβs immediate that they form a category.
Cocones : Precategory _ _ Cocones = cat where open Precategory compose : β {x y z} β Cocone-hom y z β Cocone-hom x y β Cocone-hom x z compose K L .hom = K .hom C.β L .hom compose {x = x} {y = y} {z = z} K L .commutes o = (K .hom C.β L .hom) C.β x .Ο o β‘β¨ C.pullr (L .commutes o) β©β‘ K .hom C.β y .Ο o β‘β¨ K .commutes o β©β‘ z .Ο o β
cat : Precategory _ _ cat .Ob = Cocone cat .Hom = Cocone-hom cat .id = cocone-hom C.id (Ξ» _ β C.idl _) cat ._β_ = compose cat .idr f = Cocone-hom-path (C.idr (f .hom)) cat .idl f = Cocone-hom-path (C.idl (f .hom)) cat .assoc f g h = Cocone-hom-path (C.assoc (f .hom) (g .hom) (h .hom)) cat .Hom-set x y = Isoβis-hlevel! 2 eqv
Initial cocones as colimitsπ
A cocone over some diagram contains the same data as natural transformation from to a constant functor. Since we have defined a colimit to consist of (a functor equipped with) a natural transformation into a constant functor, there is an equivalence between the cocones defined here and those considered in the definition of colimit.
Coconeβcocone : (K : Cocone) β F => Const (Cocone.coapex K) Coconeβcocone K .Ξ· = K .Cocone.Ο Coconeβcocone K .is-natural x y f = K .Cocone.commutes f β sym (C.idl _)
We can then rephrase the universality from the definition of left Kan extension by asking that a particular cocone be initial in the category we have just constructed.
is-initial-coconeβis-colimit : β {K : Cocone} β is-initial Cocones K β is-colimit F (Cocone.coapex K) (Coconeβcocone K) is-initial-coconeβis-colimit {K = K} init = to-is-colimitp colim refl where open make-is-colimit open Cocone open Cocone-hom colim : make-is-colimit F (Cocone.coapex K) colim .Ο = K .Ο colim .commutes = K .commutes colim .universal eta p = init (cocone _ eta p) .centre .hom colim .factors eta p = init (cocone _ eta p) .centre .commutes _ colim .unique eta p other q = ap hom (sym (init (cocone _ eta p) .paths (cocone-hom other q)))
To finish concretising the correspondence, note that this process is invertible: From a colimit, we can extract an initial cocone.
is-colimitβis-initial-cocone : β {x} {eta : F => Const x} β (L : is-colimit F x eta) β is-initial Cocones (cocone x (is-colimit.Ο L) (is-colimit.commutes L))
The proof consists of more data shuffling, so we omit it.
is-colimitβis-initial-cocone {x = x} L K = init where module L = is-colimit L module K = Cocone K open Cocone-hom init : is-contr (Cocone-hom (cocone x L.Ο L.commutes) K) init .centre .hom = L.universal K.Ο K.commutes init .centre .commutes _ = L.factors K.Ο K.commutes init .paths f = Cocone-hom-path (sym (L.unique K.Ο K.commutes (f .hom) (f .commutes)))