Category Theory & Homological Algebra
Kan Extensions: The Universal Way to Extend a Functor
Saunders Mac Lane ended Categories for the Working Mathematician with the slogan "All concepts are Kan extensions" β and he meant it literally: limits, colimits, adjoints, the Yoneda embedding, geometric realization, and derived functors are all special cases of a single construction. A Kan extension solves the problem: given a functor F : π β β° and a "change of shape" K : π β π, find the best possible functor π β β° that restricts back to F along K.
Precisely, the left Kan extension Lan_K F is the functor π β β° equipped with a natural transformation Ξ· : F β (Lan_K F)βK that is universal from the left: any other pair (G, Ξ³ : F β GβK) factors uniquely through Ξ·. When β° is cocomplete it is computed pointwise by a colimit, (Lan_K F)(d) = colim over the comma category (Kβd) of F. The right Kan extension Ran_K F is dual, computed by a limit.
- FieldCategory theory / homological algebra
- Named afterDaniel M. Kan (1958)
- StatementUniversal (co)restriction of F along K: πβπ
- Key hypothesisβ° (co)complete, or (co)limits over comma categories exist
- Proof techniqueComma categories + coend/end formula; adjoint to K*
- Generalizes(Co)limits, adjoints, Yoneda, derived functors
Interactive visualization
Press play, or step through manually. The visualization is yours to drive β try it before reading on.
Watch the 60-second explainer
A condensed visual walkthrough β narrated, captioned, under a minute.
The precise statement and universal property
Fix functors F : π β β° and K : π β π. The left Kan extension of F along K is a functor L = Lan_K F : π β β° together with a natural transformation Ξ· : F β LβK satisfying the following universal property: for every functor G : π β β° and every natural transformation Ξ³ : F β GβK, there is a unique natural transformation Ξ΄ : L β G with (Ξ΄βK)Β·Ξ· = Ξ³. In other words Ξ· is initial in the category of pairs (G, F β GK).
Packaged cleanly: restriction along K defines a functor K* : [π, β°] β [π, β°], G β¦ GβK. Then Lan_K is precisely the left adjoint to K*, and Ran_K (right Kan extension) is the right adjoint, giving the adjunctions Lan_K β£ K* β£ Ran_K. The unit Ξ· above is the adjunction unit; the right extension's counit Ξ΅ : (Ran_K F)βK β F is dual. Being adjoint, Kan extensions are unique up to unique natural isomorphism whenever they exist.
The picture: extending along a change of shape
Think of K : π β π as reindexing: π is a small diagram shape, π is a larger or different shape, and K places the small shape inside the large one. F assigns data (objects of β°) to the small shape. We want to spread that data over all of π in the most economical way.
For a target object d β π, look at every way K hits near d β the objects c β π equipped with an arrow Kc β d. These form the comma category (K β d). The left extension glues together all the values Fc over this category by taking their colimit: (Lan_K F)(d) = colim_{(c, Kcβd)} Fc. This is the freest, most permissive amalgamation β it uses everything F knows about points mapping into d and nothing more. The right extension dually uses arrows d β Kc and forms a limit, the most cautious, most constrained extension. Left = generated by, right = constrained by. When d is literally in the image of K the extension recovers F up to iso in the nicest cases (K fully faithful).
Key idea of the proof: the pointwise colimit and the coend
The mechanism is to construct the extension explicitly and then verify universality. Assume β° is cocomplete. Define L(d) = colim(FβΞ _d), where Ξ _d : (K β d) β π is the projection (c, Kcβd) β¦ c. A morphism d β dβ² induces a functor (Kβd) β (Kβdβ²), hence a map of colimits, making L functorial; the colimit cocone gives Ξ·.
Universality is a colimit computation. A natural transformation Ξ΄ : L β G is, by the colimit definition, exactly a compatible family of maps Fc β G(d) natural in (c, Kcβd) β which is precisely a natural transformation Ξ³ : F β GK. This bijection [π,β°](L, G) β [π,β°](F, GK) is the adjunction Lan_K β£ K*. Compactly, the whole thing is the coend (Lan_K F)(d) = β«^{cβπ} π(Kc, d) Β· Fc, where S Β· X denotes the copower (S-indexed coproduct of X). Dually Ran_K F(d) = β«_c Fc^{π(d,Kc)}, an end using powers.
Canonical special cases and a worked example
Colimits and limits. Take π = π the terminal category and K the unique functor π β π. Then (K β *) = π, and Lan_K F = colim F, Ran_K F = lim F. So every colimit is a left Kan extension and every limit a right one.
Adjoints. If G : π β π has Lan_G(id_π) preserved by G and equal to a left adjoint, one recovers adjoint functors as Kan extensions of identities; indeed a left adjoint of K is Ran_K(id) when it exists (a so-called absolute Kan extension).
Worked example (Yoneda / density). Let π be small and γ : π β [πα΅α΅, Set] the Yoneda embedding. For any F : π β β° with β° cocomplete, Lan_γ F is the unique colimit-preserving extension to presheaves. Taking F = γ itself gives Lan_γ γ β id: the density theorem, every presheaf is canonically a colimit of representables, P β β«^{c} P(c) Β· γc.
Why the hypotheses matter β and when extensions fail or misbehave
Existence. The pointwise formula needs the colimit over each (K β d) to exist in β°. If β° is not cocomplete these colimits can fail: e.g. extending a functor into a poset with no joins, some (Lan_K F)(d) is undefined. Cocompleteness (or at least colimits of the relevant diagram size) is exactly what rescues this.
Pointwise vs. general. A subtle point: the universal property alone defines a Kan extension, but it need not be computed by the comma-category colimit unless β° has the colimits β these are the pointwise Kan extensions. Non-pointwise Kan extensions genuinely exist (e.g. in 2-categories other than Cat, or when β° lacks colimits), and they can behave badly, so most working results assume pointwise.
Fully faithful K. If K is fully faithful, the unit Ξ· : F β (Lan_K F)K is an isomorphism, so the extension really extends F. Drop full faithfulness and Ξ· is only a comparison map, not invertible β the extension may distort F on the image of K. Right Kan extensions along inclusions of dense subcategories connect to sheafification and codensity monads.
Applications and significance
Kan extensions are the engine behind a startling range of constructions. Homotopy theory: homotopy (co)limits and left/right derived functors are Kan extensions along the localization from a model category to its homotopy category (Quillen); the total derived functor πF is a Kan extension. Sheaf theory: the pushforward f_* and its adjoint f_! along a map of sites are Kan extensions, as is sheafification (a left adjoint to inclusion). Geometric realization of simplicial sets is Lan along the Yoneda embedding Ξ β sSet of a chosen interval, and its right adjoint (the singular functor) is a Ran. Algebra: induced and coinduced representations Ind_H^G and Coind_H^G are left and right Kan extensions along the inclusion of a subgroup H βͺ G viewed as one-object categories. Databases and functional programming: Kan extensions model data migration and the codensity monad (which explains why difference lists and the Church/CPS encodings speed up certain computations). Mac Lane's dictum β "the notion of Kan extensions subsumes all the other fundamental concepts of category theory" β is not hyperbole but a theorem in each instance.
| Feature | Left Kan extension Lan_K F | Right Kan extension Ran_K F |
|---|---|---|
| Universal property | Universal (initial) among (G, F β GK) | Universal (terminal) among (G, GK β F) |
| Adjointness | Left adjoint to restriction K* = (β)βK | Right adjoint to restriction K* |
| Pointwise formula at d | colim of F over comma cat (K β d) | lim of F over comma cat (d β K) |
| Coend / end formula | β«^c π(Kc, d) Β· F c | β«_c F c ^ π(d, Kc) |
| Existence needs | β° cocomplete (colimits of the right size) | β° complete (limits of the right size) |
| Special case (K to point) | colimit of F | limit of F |
Frequently asked questions
What exactly is a Kan extension in one sentence?
Given F : π β β° and a change of shape K : π β π, the left (resp. right) Kan extension is the universal functor π β β° approximating F from the left (resp. right), i.e. the left (resp. right) adjoint to restriction-along-K, K* : [π,β°] β [π,β°]. Equivalently it is the initial (resp. terminal) way to extend F to all of π.
What is the pointwise formula and when is it valid?
When β° is cocomplete, (Lan_K F)(d) = colim over the comma category (Kβd) of F, equivalently the coend β«^c π(Kc,d)Β·Fc. Dually (Ran_K F)(d) = lim over (dβK), the end β«_c Fc^{π(d,Kc)}. Validity requires those specific colimits/limits to exist in β°; a Kan extension computed this way is called pointwise.
Why do limits and colimits count as Kan extensions?
Take π to be the one-object one-morphism category π and K : π β π the unique functor. Then the comma category (Kβ*) is all of π, so Lan_K F = colim F and Ran_K F = lim F. This is Mac Lane's point that even the most basic universal constructions are instances of Kan extension.
How is a Kan extension related to adjoint functors?
Restriction K* = (β)βK always exists; Lan_K is its left adjoint and Ran_K its right adjoint, so Lan_K β£ K* β£ Ran_K. Conversely, a left adjoint to K itself (when it exists) is the right Kan extension Ran_K(id) that is preserved by all functors β an absolute Kan extension. So adjunctions both produce and are produced by Kan extensions.
Does the unit Ξ· : F β (Lan_K F)βK have to be an isomorphism?
Not in general β only when K is fully faithful is Ξ· invertible, in which case the extension genuinely restricts back to F on the image of K. If K is not fully faithful, Ξ· is merely the universal comparison map and (Lan_K F)βK can differ from F, because the colimit over (KβKc) may fold in extra objects that map to Kc.
What is a non-pointwise Kan extension and why care?
A Kan extension defined purely by the universal property need not agree with the comma-category (co)limit formula when β° lacks those (co)limits, or when one works in a 2-category other than Cat. Such non-pointwise extensions exist and can be pathological, so essentially all applications (derived functors, homotopy colimits, density) assume pointwise Kan extensions, which is where the good behavior lives.