definition example theorem

The colimit of a Diagram , written , is the universal Cocone: the Initial Object in the category of cocones under . Equivalently it is a representing object for : (Kittenlab Lecture 9, DaoFP §9.5). 7 Sketches’ “compressed” definition: a cocone in is a cone in , and the colimit of is the limit of (Definition 3.102). Kittenlab’s slogan: “colimits are gluing” — take the disjoint union (-ary Coproduct) of the objects, then glue parts together (by equivalence relations, computed with union-find).

Sources: Kittenlab Lecture 9 (“Colimits”), 11, 15; DaoFP §9.5, §10.4, §10.7, §12.6 (“Initial Algebra as a Colimit”), §17.2 (“Colimits as coends”), §19.4; 7 Sketches §3.5.4, §6.2 (Chapter 6 unpacks colimits: initial objects, coproducts, pushouts, finite colimits, cospans), §3.4.4 (-operations are built from colimits); CTfS §2.6, Definition 4.5.3.25, Examples 4.5.3.28–4.5.3.29, Application 4.5.3.30

Special cases

shapecolimit
emptyInitial Object (in , )
objects, no arrows-ary Coproduct
Span Pushout
parallel pair Coequalizer (e.g. for a subgroup in , coequalizing the inclusion and ; angles )
a Preorder as Join ; joining systems (Generative Effect)
, any finite diagramdisjoint union of the modulo the equivalence relation generated by (7 Sketches Theorem 6.37, Kittenlab)
: connected components / quotients (Data Migration Functor)
-chain the Initial Algebra of (DaoFP §12.6)

Examples from Category Theory for Scientists

  • Gluing intervals and spaces (CTfS Examples 2.6.2.2, 4.5.3.29). ; in the pushout of collapses the boundary circle of a disk to a point and yields the sphere — “the category of topological spaces has the right morphisms to ensure the result really is a sphere”.
  • Transit maps (CTfS Application 4.5.3.30). Model a subway line with stops as the symmetric line graph ; a transfer station is a map picking a stop. The colimit of a diagram of lines and shared stations, e.g. , is the transit map: lines glued at their transfer stations.
  • Ologs (CTfS Example 2.6.2.3). “A cell in the torso or arm” is the pushout of “a cell in the torso” and “a cell in the arm” over “a cell in the shoulder”: shoulder cells are counted once. Pushouts can also equate: pushing out “a college course” along “a math course ↦ an utterance of too hard” replaces every math course by that phrase.
  • Connected components (CTfS Exercise 4.5.3.26): the colimit of a graph viewed as a functor is the Coequalizer of source and target, i.e. its set of connected components; the colimit of the empty diagram is the Initial Object (CTfS Exercise 4.5.3.27).
  • Cones as colimits (CTfS Example 4.5.3.28): collapsing the front face of the prism to a point, i.e. the pushout of in , is the left cone — the shape of all cones.

Properties

  • Unique up to unique isomorphism. is cocomplete; C-set categories and graphs have all colimits, pointwise (glue vertices and edges separately).
  • (DaoFP §10.4); left adjoints preserve colimits (dual); the contravariant Hom Functor turns colimits into limits: . Colimits are coends and left Kan extensions. Every presheaf is a colimit of representables.
  • Isomorphic diagrams have isomorphic colimits (Kittenlab Lecture 15): gives , so the representing objects agree — “that’s Yoneda, baby!” This makes composition of cospans by pushout well defined on isomorphism classes.
  • Colimits are where generative effects live: an observation that fails to preserve colimits sees more in the whole than in the parts. Colimits of network diagrams describe connection (7 Sketches Chapter 6: “colimits and connection”).

Docs: FinSets · Limits & colimits · Free diagrams · Graphs — Kittenlab Lecture 9, Lecture 15

using Catlab
# colimits in FinSet: coproduct, pushout, coequalizer
coproduct(FinSet(2), FinSet(3)) |> apex        # FinSet(5)
f = FinFunction([1, 2], 3); g = FinFunction([1, 1], 2)
P = pushout(f, g); apex(P)                     # glue 1~1, 2~1 in the two codomains
coequalizer(FinFunction([1], 3), FinFunction([2], 3)) |> apex   # squish 1 and 2: FinSet(2)
# colimits of graphs are computed the same way, pointwise
G = path_graph(Graph, 3); H = cycle_graph(Graph, 3)
colimit(Span(id(G), id(G))) |> apex == G      # (up to iso) pushout along identities
#check CategoryTheory.Limits.colimit
#check CategoryTheory.Limits.IsColimit
#check CategoryTheory.Limits.colimit.ι       -- the coprojections (legs)
#check CategoryTheory.Limits.colimit.desc    -- the unique map out of the colimit
#check CategoryTheory.Limits.colimConstAdj   -- colim ⊣ const
#check CategoryTheory.Limits.Types.Quot      -- colimits in Type are quotients of disjoint unions
-- colimits in Hask of finite diagrams: a disjoint union modulo generated equivalence
-- e.g. the pushout of f :: z -> x and g :: z -> y on finite carriers, via representatives:
pushoutSet :: (Eq x, Eq y) => [x] -> [y] -> [z] -> (z -> x) -> (z -> y) -> [[Either x y]]
pushoutSet xs ys zs f g = classes
  where pairs   = [ (Left (f z), Right (g z)) | z <- zs ]
        elems   = map Left xs ++ map Right ys
        related a b = a == b || (a, b) `elem` pairs || (b, a) `elem` pairs
        closure a = [ b | b <- elems, reach a b ]
        reach a b = a == b || any (\c -> related a c && reach' c b [a]) elems
        reach' c b seen = c == b || any (\d -> related c d && not (d `elem` seen) && reach' d b (c:seen)) elems
        classes = foldr (\e acc -> if any (e `elem`) acc then acc else closure e : acc) [] elems