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.

Open visualization fullscreen β†—

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.

Left vs. right Kan extension along K : π’ž β†’ π’Ÿ, extending F : π’ž β†’ β„°
FeatureLeft Kan extension Lan_K FRight Kan extension Ran_K F
Universal propertyUniversal (initial) among (G, F β‡’ GK)Universal (terminal) among (G, GK β‡’ F)
AdjointnessLeft adjoint to restriction K* = (βˆ’)∘KRight adjoint to restriction K*
Pointwise formula at dcolim 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 Flimit 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.