41.06.02 · category-theory / kan-extensions

Kan Extensions: All Concepts Are Kan Extensions

shipped3 tiersLean: none

Anchor (Master): Mac Lane 1998 *Categories for the Working Mathematician* 2e (Springer GTM 5) Ch. X (Kan extensions as the unifying construction: (co)limits, adjoints, the density theorem, codensity); Riehl 2016 *Category Theory in Context* (Dover) §6.1-6.5 (pointwise Kan extensions via (co)ends, the density comonad, derived functors as a preview); Riehl 2014 *Categorical Homotopy Theory* (Cambridge) Ch. 1, 2 (homotopy/derived Kan extensions, the gateway to (∞,1)-categorical left and right derived functors); Loregian 2021 *(Co)end Calculus* (Cambridge) Ch. 2-3 (the coend computation and the codensity monad, the ultrafilter example)

Intuition Beginner

Suppose you have a recipe that works only for some of the inputs you care about, and you want to spread it to all of them in the most honest way. You know the answer on a small collection of cases; a second rule renames those cases as members of a larger collection. The question is how to fill in the answer on every member of the larger collection, using only what the recipe already told you, without inventing anything extra.

There are two honest ways to fill the gaps. One extends the recipe from the left: at each new input, it pastes together everything the recipe says about the known cases that map into that input, and takes the most generous merge. The other extends from the right: it pastes together everything the recipe says about the known cases that the input maps into, and takes the most cautious common part. Both are the best possible extension of a partially-defined construction — one leans toward including as much as compatible, the other toward keeping only what is forced.

The headline of this unit is a slogan from category theory: nearly every construction you have met is one of these two best extensions in disguise. Summaries, averages, best matches, even the act of comparing one structure to another — each turns out to be the most economical way to spread a known rule across a renamed domain.

Visual Beginner

Picture three boards. The left board holds the known cases. An arrow-rule renames each known case as a spot on the middle board, which is larger and has empty spots the rule never reached. A separate recipe assigns a value to each known case on the left. The task is to fill every spot on the middle board.

extension what it gathers at a new spot flavour of the answer
left (most generous) all known cases that point into the spot the merged whole of their values
right (most cautious) all known cases the spot points into the common part of their values
the renaming rule sends each known case to a middle spot may miss spots and may overlap

Read the picture top-down for the generous extension and bottom-up for the cautious one. The same known data, spread two ways, gives the two answers. Everything later in the unit is a special choice of the three boards and the recipe.

Worked example Beginner

Take three known cases on the left: call them , , . The recipe assigns sizes: case gets size , case gets size , case gets size . The renaming rule sends all three known cases to a single spot on the middle board, which has only that one spot. We fill two ways.

Step 1. Generous extension at . Gather every known case that points into : that is all three, with sizes , , . The most generous merge of a list of sizes, in the order-world where bigger means "more permissive", is the largest. So the generous value at is .

Step 2. Cautious extension at . Gather every known case that points into: again all three, sizes , , . The most cautious common part is the smallest. So the cautious value at is .

Step 3. Read the two answers. Generous gives ; cautious gives . The single middle spot got a high answer one way and a low answer the other way, from the very same recipe.

What this tells us: when the renaming collapses every known case onto one spot, the generous extension computes a join (here, a maximum) and the cautious one computes a meet (here, a minimum). Collapsing everything onto one spot is the same as asking for an overall summary of the recipe, and the two best extensions are the two natural summaries.

Check your understanding Beginner

Formal definition Intermediate+

Fix a functor along which we extend, and a functor to be extended. The data lives in the 2-category , where the 2-cells are natural transformations [Mac Lane 1998].

Definition (left and right Kan extension). A left Kan extension of along is a functor together with a natural transformation that is universal from the left: for every functor and every there is a unique natural transformation with . Dually a right Kan extension comes with universal from the right: every factors as for a unique . Equivalently, when the extensions exist for all , the restriction functor , , has a left adjoint and a right adjoint , with and the unit and counit.

Definition (pointwise Kan extension). The left Kan extension is pointwise if it is computed object-by-object by the coend formula, and dually for the right. Using the (co)end calculus of 41.06.01, when is cocomplete the pointwise left Kan extension is $$ (\mathrm{Lan}{K}F)(d);\cong;\int^{c\in\mathcal{C}}\mathcal{D}(Kc,d)\cdot Fc, $$ the copower of by the hom-set , and when is complete the pointwise right Kan extension is $$ (\mathrm{Ran}{K}F)(d);\cong;\int_{c\in\mathcal{C}}(Fc)^{\mathcal{D}(d,Kc)}, $$ the power of by . These are the weighted colimit and weighted limit of 41.06.01, with the hom-functor as weight. The notation reused here — the copower and power of by a set , the (co)end signs and , and the comma categories and — is recorded in _meta/NOTATION.md.

Definition (Kan extension along the comma category). Equivalently the pointwise left Kan extension is the colimit over the comma category of objects equipped with an arrow , and the right extension is the limit over . The coend formula and the comma-category formula agree because is the coend presentation of that comma-category colimit.

Counterexamples to common slips Intermediate+

  • A Kan extension need not restrict to on the nose. The unit is generally not an isomorphism; it is iso when is fully faithful, in which case genuinely extends rather than merely best-approximating it. Reading every Kan extension as an exact extension discards the word approximate.

  • Not every Kan extension is pointwise. A Kan extension defined by the 2-categorical universal property may fail to be computed by the (co)end formula when lacks the needed (co)limits; "Kan extension" and "pointwise Kan extension" coincide only when the relevant weighted (co)limits exist. The pointwise ones are the ones the calculus of 41.06.01 reaches.

  • and are not interchangeable by formal duality alone. The left extension uses the copower (a colimit, the generous side) and the right uses the power (a limit, the cautious side); swapping the coend for an end without dualising the variance of the hom-weight produces a formula that represents neither extension.

Key theorem with proof Intermediate+

The pointwise formula is the computational heart of the chapter: it turns the abstract universal property into an integral the calculus of 41.06.01 can evaluate.

Theorem (pointwise left Kan extension by a coend). Let and with small and cocomplete. Then the functor $$ L(d);=;\int^{c\in\mathcal{C}}\mathcal{D}(Kc,d)\cdot Fc $$ carries a natural transformation exhibiting as [Mac Lane 1998].

Proof. Fix . Compute the natural transformations as an end, using the end form from 41.06.01: $$ \mathrm{Nat}(L,G);\cong;\int_{d}\mathcal{E}\Bigl(\int^{c}\mathcal{D}(Kc,d)\cdot Fc,;Gd\Bigr). $$ The functor sends the coend (a colimit) to a limit, turning it into an end, and the copower-power adjunction gives $$ \mathrm{Nat}(L,G);\cong;\int_{d}\int_{c}\mathbf{Set}\bigl(\mathcal{D}(Kc,d),,\mathcal{E}(Fc,Gd)\bigr). $$ By the Fubini theorem of 41.06.01 the two ends commute, so the order may be swapped to . The inner end is over , and the end form of the Yoneda lemma from 41.06.01, applied with , evaluates it to . Hence $$ \mathrm{Nat}(L,G);\cong;\int_{c}\mathcal{E}\bigl(Fc,G(Kc)\bigr);\cong;\mathrm{Nat}(F,G\circ K), $$ the last step again by the end form of natural transformations. This bijection is natural in , so corepresents ; by definition that is precisely the universal property of , with the image of .

Bridge. This coend computation builds toward every special case in the slogan and appears again in 41.06.02's own Advanced results, where setting to the terminal functor, to a representable, or to the Yoneda embedding turns the one formula into limits, adjoints, and density. The foundational reason the universal property reduces to an integral is that the (co)end calculus of 41.06.01 makes a chain of Fubini and Yoneda rewrites; this is exactly the adjunction written pointwise, and it generalises the weighted-colimit machinery of 41.06.01 from a fixed weight to the hom-weight that varies with the target object. Putting these together, the right Kan extension is dual to the left throughout — coend becomes end, copower becomes power, colimit-preservation becomes limit-preservation — and the bridge is that one integral, evaluated along different choices of , is the engine that makes "all concepts are Kan extensions" a computation rather than a metaphor.

Exercises Intermediate+

Advanced results Master

Theorem (all concepts are Kan extensions: the four reductions). Let , with the relevant (co)completeness. The pointwise formula specialises as follows. For the terminal functor, and , since the hom-weight collapses to the constant weight and the (co)end becomes the conical (co)limit of 41.02.01. For and , an absolute is the right adjoint of and an absolute is the left adjoint, so an adjunction is a pair of mutually absolute Kan extensions along each other; this is Kan's original reading [Kan 1958]. For the Yoneda embedding, is the unique cocontinuous extension of , with right adjoint the nerve ; taking itself returns the identity, the density theorem of 41.04.02 in the form . And the Yoneda lemma itself reappears: a presheaf satisfies restricted along , the statement that is recovered from its restriction to representables.

Theorem (preservation of pointwise left Kan extensions). If is a pointwise left Kan extension and is cocontinuous, then is a pointwise left Kan extension of along , with the whiskered unit. The reason is that commutes with the defining coend, , because a cocontinuous functor preserves copowers and coends alike. Dually, continuous functors preserve pointwise right Kan extensions. Pointwiseness is precisely the property that makes Kan extensions stable under (co)continuous change of target — the non-pointwise ones can break under such functors.

Theorem (the codensity monad and its algebras). For with existing, is a monad on , the codensity monad of , and factors through the forgetful functor of -algebras via the comparison . When is the inclusion the codensity monad is the ultrafilter monad , with algebras the compact Hausdorff spaces; when is the inclusion of finite-dimensional vector spaces into all vector spaces the codensity monad is double-dualization . The codensity monad measures the failure of to be codense: is codense exactly when is the identity monad, the right-extension analogue of the density of 41.04.02. This connects the extension calculus to the monad theory of 41.05.01, where Eilenberg-Moore algebras were the home of such comparison functors.

Theorem (homotopy and derived Kan extensions). When carry homotopical structure — model categories, or -categories — the relevant extension is the homotopy Kan extension, computed by replacing the strict (co)end with a homotopy (co)end (a bar construction of 41.06.01). Left and right derived functors and of a functor between homotopical categories are the homotopy left and right Kan extensions of along the localisation , so and . This is the gateway to the -categorical theory, where and become the fundamental operations of quasicategories and the derived category of 04.03.11 is the homotopy category in which and live as derived Kan extensions [Riehl 2014].

Synthesis. Putting these together, the single pointwise formula of 41.06.01 is the foundational reason every construction in the chapter is one identification: the terminal-functor choice recovers the colimits of 41.02.01, the identity-functor choice recovers the adjoints of 41.03.01, the Yoneda-embedding choice recovers the density and the realization-nerve adjunction of 41.04.02, and the self-extension recovers the monads of 41.05.01 as codensity monads. This is exactly the slogan "all concepts are Kan extensions" made computational, and it generalises the weighted-(co)limit calculus of 41.06.01 by letting the weight be the variable hom-functor ; the left and right extensions are dual throughout, coend to end and copower to power, so the central insight is that one integral, read along different functors , is the universal approximation that limits, adjoints, Yoneda, and monads each instantiate. The bridge is that passing from strict to homotopy (co)ends turns the same formula into derived functors and carries the entire chapter into the -categorical and derived-categorical world of 04.03.11, which is why this unit is the capstone the whole chapter was built toward.

Full proof set Master

Proposition 1 (the pointwise formula is a left Kan extension). For with small and cocomplete, is .

Proof. For any , the chain of 41.06.01 isomorphisms $$ \mathrm{Nat}(L,G)\cong\int_{d}\mathcal{E}(Ld,Gd)\cong\int_{d}\int_{c}\mathbf{Set}\bigl(\mathcal{D}(Kc,d),\mathcal{E}(Fc,Gd)\bigr)\cong\int_{c}\int_{d}\mathbf{Set}\bigl(\mathcal{D}(Kc,d),\mathcal{E}(Fc,Gd)\bigr) $$ uses the end form of , the continuity of with the copower-power adjunction, and Fubini. The inner end over is the end-form Yoneda lemma , giving . So corepresents , the universal property of . Cocompleteness of provides the coend defining .

Proposition 2 (limits and colimits as Kan extensions). For with small and cocomplete, , and dually .

Proof. The terminal category has one object and for every . By Proposition 1, . The coend of viewed as constant in its contravariant slot is the colimit , by the conical-case result of 41.06.01, because a cowedge out of it is exactly a cocone under . The right statement is dual: .

Proposition 3 (a left adjoint is ). If has a right adjoint , then and this Kan extension is absolute (preserved by every functor).

Proof. Let with unit and counit . Given and , define . Then , and the triangle identity together with naturality of collapses this to ; uniqueness follows because any with is forced by post-composing with . So has the universal property of with unit . The extension is absolute: for any , the same computation with whiskered in shows , since the triangle identities are preserved by whiskering.

Proposition 4 (the codensity monad is a monad). For with existing, carries a canonical monad structure .

Proof. Let be the counit of the right extension. The identity factors uniquely through as , defining the unit . The transformation factors uniquely through as , defining . Associativity asks ; both, whiskered by and composed with , equal , so by uniqueness of factorisations through the universal they coincide. The unit laws follow identically: both sides composed with give . Hence is a monad.

Proposition 5 (preservation by cocontinuous functors). If is pointwise and is cocontinuous, then pointwise.

Proof. Pointwiseness gives . Apply . A cocontinuous functor preserves colimits, hence coends and copowers, both of which are colimits, so $$ H\Bigl(\int^{c}\mathcal{D}(Kc,d)\cdot Fc\Bigr)\cong\int^{c}H\bigl(\mathcal{D}(Kc,d)\cdot Fc\bigr)\cong\int^{c}\mathcal{D}(Kc,d)\cdot HFc=(\mathrm{Lan}{K}(HF))(d). $$ The whiskered unit exhibits the universal property, since the bijection $\mathrm{Nat}(H,\mathrm{Lan}{K}F,G')\cong\mathrm{Nat}(HF,G'K)HH,\mathrm{Lan}_{K}FHF\square$

Connections Master

  • Ends, coends, and the (co)end calculus 41.06.01. The prerequisite supplies every move the pointwise formula needs: the end form , the Fubini theorem, and the (co)Yoneda reduction are the three rewrites that turn into a left Kan extension in Proposition 1. The Kan-extension formulas are precisely the weighted (co)limits of 41.06.01 with the hom-functor as weight, so this unit is that calculus applied to extension problems.

  • The Yoneda lemma, embedding, and density 41.04.02. Density is the statement , and the free-cocompletion universal property is exactly that is the unique cocontinuous extension of . The realization-nerve adjunction of Exercise 5 is the adjunction , with the nerve ; geometric realization of simplicial sets is the case .

  • Adjunctions via hom-sets, unit, and counit 41.03.01. Proposition 3 identifies a left adjoint with the absolute and a right adjoint with , so the adjunction theory of 41.03.01 is the special case of Kan extension. The unit and counit of an adjunction are the unit and counit of these extensions.

  • Monads, Eilenberg-Moore, and Kleisli 41.05.01. The codensity monad of Proposition 4 is a monad whose Eilenberg-Moore algebras (in the ultrafilter example, compact Hausdorff spaces) live in the algebra theory of 41.05.01; the comparison measures codensity exactly as the monadic comparison of 41.05.01 measures monadicity.

  • Limits, colimits, and universal cones 41.02.01; derived categories 04.03.11. Proposition 2 makes (co)limits the Kan extensions along the terminal functor, so the universal-cone machinery of 41.02.01 is the constant-weight case. Passing to homotopy (co)ends turns into the derived functors on the derived category of 04.03.11, the homotopy-categorical home of and .

Historical & philosophical context Master

Daniel Kan introduced adjoint functors and the extension construction that bears his name in his 1958 paper, where the left and right extensions along a functor are defined by the universal properties used here, and where the adjoint-functor reading — a left adjoint as an extension of an identity — already appears [Kan 1958]. Mac Lane gave the construction its canonical exposition and its slogan in Chapter X of Categories for the Working Mathematician, titling a section "All concepts are Kan extensions" and proving the pointwise (co)end formula together with the recovery of limits, colimits, and adjoints as instances [Mac Lane 1998].

The codensity monad and its ultrafilter example were studied by Kennison and Gildenhuys in the early 1970s, identifying as the codensity monad of finite sets, and the double-dualization codensity monad of finite-dimensional vector spaces belongs to the same circle of ideas; Loregian's (Co)end Calculus gives the modern coend account [Loregian 2021]. The homotopy-theoretic lift, in which derived functors are homotopy Kan extensions along a localisation and the construction becomes the basic operation of -category theory, is developed in Riehl's Categorical Homotopy Theory [Riehl 2014].

Bibliography Master

@article{Kan1958,
  author  = {Kan, Daniel M.},
  title   = {Adjoint functors},
  journal = {Transactions of the American Mathematical Society},
  volume  = {87},
  year    = {1958},
  pages   = {294--329}
}

@book{MacLane1998kan,
  author    = {Mac Lane, Saunders},
  title     = {Categories for the Working Mathematician},
  edition   = {2},
  publisher = {Springer},
  series    = {Graduate Texts in Mathematics 5},
  year      = {1998}
}

@book{Riehl2016kan,
  author    = {Riehl, Emily},
  title     = {Category Theory in Context},
  publisher = {Dover},
  year      = {2016}
}

@book{Riehl2014kan,
  author    = {Riehl, Emily},
  title     = {Categorical Homotopy Theory},
  publisher = {Cambridge University Press},
  series    = {New Mathematical Monographs 24},
  year      = {2014}
}

@book{Loregian2021kan,
  author    = {Loregian, Fosco},
  title     = {(Co)end Calculus},
  publisher = {Cambridge University Press},
  series    = {London Mathematical Society Lecture Note Series 468},
  year      = {2021}
}

@article{Kennison1971,
  author  = {Kennison, John F. and Gildenhuys, Dion},
  title   = {Equational completion, model induced triples and pro-objects},
  journal = {Journal of Pure and Applied Algebra},
  volume  = {1},
  number  = {4},
  year    = {1971},
  pages   = {317--346}
}