A Kan extension proceeds from the data of three categories
and two functors
and comes in two varieties: the "left" Kan extension and the "right" Kan extension of X {\displaystyle X} along F {\displaystyle F} .
Abstractly, the functor F {\displaystyle F} gives a pullback map F ∗ : [ B , C ] → [ A , C ] {\displaystyle F^{*}:[B,C]\to [A,C]} . When they exist, the left and right adjoints to F ∗ {\displaystyle F^{*}} applied to X {\displaystyle X} gives the left and right kan extensions. Spelling the definition of adjoints out, we get the following definitions;
The right Kan extension amounts to finding the dashed arrow and the natural transformation ϵ {\displaystyle \epsilon } in the following diagram:
Formally, the right Kan extension of X {\displaystyle X} along F {\displaystyle F} consists of a functor R : B → C {\displaystyle R:\mathbf {B} \to \mathbf {C} } and a natural transformation ϵ : R F → X {\displaystyle \epsilon :RF\to X} that is terminal with respect to this specification, in the sense that for any functor M : B → C {\displaystyle M:\mathbf {B} \to \mathbf {C} } and natural transformation μ : M F → X {\displaystyle \mu :MF\to X} , a unique natural transformation δ : M → R {\displaystyle \delta :M\to R} is defined and fits into a commutative diagram:
where δ F {\displaystyle \delta _{F}} is the natural transformation with δ F ( a ) = δ ( F a ) : M F ( a ) → R F ( a ) {\displaystyle \delta _{F}(a)=\delta (Fa):MF(a)\to RF(a)} for any object a {\displaystyle a} of A . {\displaystyle \mathbf {A} .}
The functor R is often written Ran F X {\displaystyle \operatorname {Ran} _{F}X} .
As with the other universal constructs in category theory, the "left" version of the Kan extension is dual to the "right" one and is obtained by replacing all categories by their opposites.
The effect of this on the description above is merely to reverse the direction of the natural transformations.
This gives rise to the alternate description: the left Kan extension of X {\displaystyle X} along F {\displaystyle F} consists of a functor L : B → C {\displaystyle L:\mathbf {B} \to \mathbf {C} } and a natural transformation η : X → L F {\displaystyle \eta :X\to LF} that is initial with respect to this specification, in the sense that for any other functor M : B → C {\displaystyle M:\mathbf {B} \to \mathbf {C} } and natural transformation α : X → M F {\displaystyle \alpha :X\to MF} , a unique natural transformation σ : L → M {\displaystyle \sigma :L\to M} exists and fits into a commutative diagram:
where σ F {\displaystyle \sigma _{F}} is the natural transformation with σ F ( a ) = σ ( F a ) : L F ( a ) → M F ( a ) {\displaystyle \sigma _{F}(a)=\sigma (Fa):LF(a)\to MF(a)} for any object a {\displaystyle a} of A {\displaystyle \mathbf {A} } .
The functor L is often written Lan F X {\displaystyle \operatorname {Lan} _{F}X} .
The use of the word "the" (as in "the left Kan extension") is justified by the fact that, as with all universal constructions, if the object defined exists, then it is unique up to unique isomorphism. In this case, that means that (for left Kan extensions) if L , M {\displaystyle L,M} are two left Kan extensions of X {\displaystyle X} along F {\displaystyle F} , and η , α {\displaystyle \eta ,\alpha } are the corresponding transformations, then there exists a unique isomorphism of functors σ : L → M {\displaystyle \sigma :L\to M} such that the second diagram above commutes. Likewise for right Kan extensions.
Further information: limit (category theory)
Suppose X : A → C {\displaystyle X:\mathbf {A} \to \mathbf {C} } and F : A → B {\displaystyle F:\mathbf {A} \to \mathbf {B} } are two functors. If A is small and C is cocomplete, then there exists a left Kan extension Lan F X {\displaystyle \operatorname {Lan} _{F}X} of X {\displaystyle X} along F {\displaystyle F} , defined at each object b of B by
where the colimit is taken over the comma category ( F ↓ const b ) {\displaystyle (F\downarrow \operatorname {const} _{b})} , where const b : ∗ → B , ∗ ↦ b {\displaystyle \operatorname {const} _{b}\colon \ast \to \mathbf {B} ,\ast \mapsto b} is the constant functor. Dually, if A is small and C is complete, then right Kan extensions along F {\displaystyle F} exist, and can be computed as the limit
over the comma category ( const b ↓ F ) {\displaystyle (\operatorname {const} _{b}\downarrow F)} .
Further information: coend (category theory)
Suppose X : A → C {\displaystyle X:\mathbf {A} \to \mathbf {C} } and F : A → B {\displaystyle F:\mathbf {A} \to \mathbf {B} } are two functors such that for all objects a and a′ of A and all objects b of B, the copowers B ( F a ′ , b ) ⋅ X a {\displaystyle \mathbf {B} (Fa',b)\cdot Xa} exist in C. Then the functor X has a left Kan extension Lan F X {\displaystyle \operatorname {Lan} _{F}X} along F, which is such that, for every object b of B,
when the above coend exists for every object b of B.
Dually, right Kan extensions can be computed by the end formula
The limit of a functor F : C → D {\displaystyle F:\mathbf {C} \to \mathbf {D} } can be expressed as a Kan extension by
where E {\displaystyle E} is the unique functor from C {\displaystyle \mathbf {C} } to 1 {\displaystyle \mathbf {1} } (the category with one object and one arrow, a terminal object in C a t {\displaystyle \mathbf {Cat} } ). The colimit of F {\displaystyle F} can be expressed similarly by
A functor F : C → D {\displaystyle F:\mathbf {C} \to \mathbf {D} } possesses a left adjoint if and only if the right Kan extension of Id : C → C {\displaystyle \operatorname {Id} :\mathbf {C} \to \mathbf {C} } along F {\displaystyle F} exists and is preserved by F {\displaystyle F} . In this case, a left adjoint is given by Ran F Id {\displaystyle \operatorname {Ran} _{F}\operatorname {Id} } and this Kan extension is even preserved by any functor C → E {\displaystyle \mathbf {C} \to \mathbf {E} } whatsoever, i.e. is an absolute Kan extension.
Dually, a right adjoint exists if and only if the left Kan extension of the identity along F {\displaystyle F} exists and is preserved by F {\displaystyle F} .
The codensity monad of a functor G : D → C {\displaystyle G:\mathbf {D} \to \mathbf {C} } is a right Kan extension of G along itself.