SOME WORDS ON KAN EXTENSIONS.

MARCO VERGURA

We start with what is, in many respects, a fundamental example for Kan extensions. Let C be a small and let PSh(C) be the category of presheaves (of sets) over C, i.e. the op category SetC of contravariant from C to Set. Such a category comes equipped with a fully faithful functor y: C −→ PSh(C),A 7→ C(−,A), the Yoneda embedding. Given a presheaf P : Cop −→ Set, recall that the category of elements of P is the category Z P C with objects given by pairs (A, x), for A ∈ Ob(C) and x ∈ P (A), and (A, x) → (B, y) between two such pairs given by morphisms A → B in C such that (P (A → B))(y) = x. Yoneda’s lemma implies that the category of elements of P is isomorphic to the category (y ↓ P ) having as objects pairs (A, τ), where A ∈ Ob(C) and τ : yA → P is a , and as morphisms (A, τ) → (B, σ) those arrows A → B in C such that σ ◦ y(A → B) = τ. Note that there is a projection (or forgetful) functor

πP :(y ↓ P ) −→ C, (A, τ) 7→ A. We can now state the of the category PSh(C) or, better, of the pair (PSh(C), y). Theorem 1. Let C be a small category and let F : C −→ D be a functor into a cocomplete category D. Then there exist a unique (up to isomorphisms) cocontinuous functor LF : PSh(C) −→ D such ∼ that LF ◦ y = F , i.e. such that the following diagram commute y C / PSh(C)

L F F  D =∼ up to an invertible natural transformation LF ◦ y −→ F . In fact, LF can be defined as

LF (P ) := colim(F ◦ πP ), for each P ∈ PSh(C). Furthermore, LF has a right adjoint RF given by D(F (−), ?): D −→ PSh(C),X 7→ (D(F (−),X): Cop −→ Set).

A proof of this classical result can be found (for example) in [MLM94, §1.5]. As a byproduct, we get another well-known fact about presheaves, usually referred to by saying that every presheaf is a colimit of representables Corollary 2. Let C be a small category and let P ∈ PSh(C). Then there is a canonical isomorphism =∼ colim(y ◦ πP ) → P.

Date: January 21, 2016. 1 Proof. With respect to the situation in Theorem1, take D := PSh(C) and F := y. Then the ∼ identity functor IdPSh(C) : PSh(C) −→ PSh(C) certainly verifies IdPSh(C) ◦y = y and is cocontinuous, so there must be a canonical isomorphism Ly → IdPSh(C). 

Here are two fundamental examples of Theorem1, which are both instances of what is sometimes called the nerve-realization paradigm. Example 3. Let ∆ be the whose objects are the finite non-empty ordinals [n] = {0, 1, . . . , n}, for n ∈ N and whose morphisms are monotone maps between them. Presheaves ∆op −→ Set are commonly known as simplicial sets and the category PSh(∆) is denoted by sSet. There are embeddings ( n ) n n+1 X ∆ −→ Top, [n] 7→ ∆ := (t0, . . . , tn) ∈ R : ti = 1 and ∀i ∈ {0, . . . , n} (ti ≥ 0) i=0 and ∆ −→ Cat, [n] 7→ [n], where [n] ∈ Cat is seen as a category having as sets of object {0, . . . , n} and with a i → j (for i, j ∈ {0, . . . , n}) precisely when i ≤ j. We have then diagrams of functors y y ∆ / sSet ∆ / sSet

Top Cat Thus, applying Theorem1, we get pairs of

|·| τ1 & & sSet⊥ Top sSet⊥ Cat d d Sing N The functor |·| is usually called the geometric realization functor, whereas Sing is called the singular complex functor. Furthermore, τ1 is known as the fundamental category functor, while N is the nerve functor. Note, that, for each X ∈ Top, C ∈ Cat and [n] ∈ ∆, we have, by definition n Sing(X)n = Top(∆ ,X),NCn = Cat([n], C), where, for a S, Sn denotes S([n]), the set of n−simplices of S. These adjoint pairs play a fundamental role in the homotopy theory of spaces.

Kan extensions allow one to generalize (to some extent) the situation of Theorem1 by replacing the Yoneda embedding C −→ PSh(C) with an arbitrary functor C −→ B. Before seeing how this generalization works, we first need to introduce the core concept of these notes. Definition 4. Let F : A −→ B and G: A −→ D be functors.

(1) A pair (K, α), where K : B −→ D is a functor and α: G −→ KF is a natural transfor- mation, is a left Kan extension of G along F if it satisfies the following universal property. Given any pair (H, β) where H : B −→ D is a functor and β : G −→ HF is a natural trans- formation, there exists a unique natural transformation γ : K −→ H such that γF ◦ α = β.

(2) Dually, a pair (K, τ), where K : B −→ D and τ : KF −→ G, is a right Kan extension of G along F if it satisfies the following universal property. Given any pair (H, σ) where H : B −→ D and σ : HF −→ G is a natural transformation, there exists a unique natural transformation δ : H −→ K such that τ ◦ δF = σ. 2 As usual when dealing with universal properties, a left and a right Kan extension of G along F , if they exist, are unique up to within a unique isomorphism. One then commonly talks about the left and right Kan extension of G along F and denote them by LanF (G) and RanF (G) respectively. Also, one commonly uses the term ”left Kan extension“ and the notation LanF (G) both to mean the pair (K, α) as in Definition4 and to just indicate the underlying functor K. The same holds for right Kan extensions. The promised (partial) generalization of Theorem1 comes in terms of the existence of left Kan extensions along a functor into a cocomplete category. Theorem 5. Let F : A −→ B and G: A −→ D be functors, where A is small.

(1) Suppose D is a cocomplete category. Then LanF (G) exists and is given, for B ∈ B, by F (LanF (G)) (B) := colim(G ◦ πB ), F where πB :(F ↓ B) −→ A is the projection functor (A, F A → B) 7→ A. Here (F ↓ B) is the category having as objects pairs (A, F A → B), where A ∈ A and FA → B is a morphism in B, and as morphism (A, t: FA → B) → (A0, t0 : FA0 → B) those morphisms a: A → A0 in A such that t0 ◦ F (a) = t.

(2) Dually, suppose D is a complete category. Then RanF (G) exists and is given, for B ∈ B, by 0F (RanF (G)) (B) := lim(G ◦ πB ), 0F where πB :(B ↓ F ) −→ A is the projection functor (A, B → FA) 7→ A and (B ↓ F ) is the opposite of (F ↓ B) above.

Proof. The proof is quite formal. We only prove (1), as (2) follows dually. First of all we show how F 0 the assignment B 7→ colim(G ◦ πB ) extends to a functor B −→ D. Fix then g : B → B in B. To F F get a map colim(G ◦ πB ) → colim(G ◦ πB0 ) in D, by the universal property of the colimit, we need F F to find a cocone from G ◦ πB over colim(G ◦ πB0 ). If we let 0  0 F  λ = λ(A,f 0) : GA → colim(G ◦ πB0 ) (A,f 0)∈(F ↓B0) be the colimiting cocone, we can take our needed cocone to be

 0 F  λ(A,gf) : GA → colim(G ◦ πB0 ) . (A,f)∈(F ↓B) F F We then get a uniquely induced map colim(G ◦ πB ) → colim(G ◦ πB0 ) which we take to define 0 (LanF (G))(g) and which is such that, for each (A, f) ∈ (F ↓ B), (LanF (G))(g) ◦ λ(A,f) = λ(A,gf). Here λ : GA → colim(G ◦ πF ) (A,f) B (A,f)∈(F ↓B) is the colimiting cocone. The uniqueness property of (LanF (G))(g) ensures that we get a functor LanF (G): B −→ D.

We can find a natural transformation α: G −→ LanF (G) ◦ F by simply taking the family α = α := λ : GA → colim(G ◦ πF ) , A (A,1FA) FA A∈A whose naturality follows from the definition of LanF (G) on arrows of B.

Finally, we need to show the universal property of the pair (LanF (G), α). Let then H : B −→ D be a functor and β : G −→ HF be a natural transformation. We are going to define the required F factorization γ : LanF (G) −→ H as follows. Given B ∈ B, we have a cocone from the functor G◦πB given by  β Hf  GA −→A HFA −→ HB (A,f)∈(F ↓B) 3 F and thus, we get a unique map γB : colim(G ◦ πB ) → HB such that γB ◦ λ(A,f) = Hf ◦ βA, for each (A, f) ∈ (F ↓ B). To see that the familiy of maps (γB)B∈B gives rise indeed to a 0 natural transformation γ : LanF (G) −→ H, let g : B → B be a map in B and consider, for any (A, f) ∈ (F ↓ B), the following diagram

F γB colim(G ◦ πB ) / HB O O

(LanF (G))(g) Hg

" γB0 | λ F 0 Hf (A,f) colim(G ◦ πB0 ) / HB < b 0 H(gf) λ(A,gf)

GA / HFA HF A βA

Here the outer square and the lower trapezoid commute by definition of γB and of γB0 respectively, whereas the left triangle is commutative by definition of (LanF (G))(g) and the right triangle com- mutes because H is a functor. A diagram chasing gives then that, for any (A, f) ∈ (F ↓ B), γB0 ◦ (LanF (G))(g) ◦ λ(A,f) = (Hg) ◦ γB ◦ λ(A,f). Since λ is a colimiting cocone, this gives 0 γB0 ◦ (LanF (G))(g) = (Hg) ◦ γB, as required. By taking B := FA and f := 1FA in the dia- gram above, we see that each γB is completely determined by β and H, so γ is indeed unique and it is indeed the desired factorization because, for A ∈ A, we have

(γF ◦ α)A = γFA ◦ λ(A,1FA) = H(1FA) ◦ βA = βA. 

Remark 6. Note that the functor named LF in Theorem1 is indeed the left Kan extension Lany(F ) due to Theorem5 above. However, the existence of the right adjoint RF is peculiar to the specific situation of Theorem1. Corollary 7 (The Yoneda Lemma). Let C be a locally small category and let T : C −→ Set be a functor. Then there is a bijection Nat(C(C, −),T ) =∼ T (C) natural in C ∈ C. Here Nat(C(C, −),T ) denotes the collection of all natural transformations C(C, −) −→ T .

Proof. Given any category C and any functor F : C −→ D, it follows immediately from the definition of left and right Kan extensions that LanIdC (F ) = F = RanIdC (F ). By taking F to be our functor T and using the formula for right Kan extensions in Theorem5, we then have, for a fixed C ∈ C, ∼ T (C) = (RanId (F )) (C) = lim T (D). C (C→D)∈C/C Now, the limit in the right hand side above is precisely Nat(C(C, −),T ) with limiting cone, for (f : C → D) ∈ C/C, given by τf : Nat(C(C, −),T ) −→ T (D) sending α ∈ Nat(C(C, −),T ) to αD(f). For, if we have a cone (σf : S → T (D))(f : C→D)∈C/C, then we get a function β : S → Nat(C(C, −),T ) mapping s ∈ S to the natural transformation βs : C(C, −) −→ T sending f : C → D to σf (s). It is immediate to see that, for f : C → D, τf ◦β = σf and that β is the unique map S → Nat(C(C, −),T ) with this property. This allows us to conclude.  Example 8. Let M be a and let F : M −→ D be a functor into any category D. Let γ : M −→ Ho(M) be the localization functor into the homotopy category of M. Then a left (respectively a right derived functor) of F is a right Kan extension (respectively a left Kan extension) of F along γ. Note the mismatch in the directions. 4 Example 9. Let 1 be the terminal category, which is the discrete category with a single object. A functor 1 −→ A into any category A is simply given by an object A ∈ A. Let now A be a small category and fix A ∈ A and X ∈ Set. Thus we have functors A: 1 −→ A and X : 1 −→ Set. Note that, for each A0 ∈ A, the category (A ↓ A0) is just the discrete category on the set A(A, A0). Therefore, 0  0 X  a (LanA(X)) (A ) = colim (A ↓ A ) −→ 1 −→ Set = X, A(A,A0) 0 0 0 i.e. LanA(X) sends A to the copower of X by A(A, A ), sometimes denoted as A(A, A ) · X. In particular, (LanA({0})) (−) = A(A, −). Similarly, 0 Y A(A0,A) (RanA(X)) (A ) = X =: X . A(A0,A) Note also that we can substitute Set with any cocomplete (for left Kan extensions) or complete (for right Kan extensions) category D.

As witnessed by the above example, Kan extensions does not extend, strictly speaking, any functor whatsoever, in the sense that in general we only have a natural transformation G −→ LanF G ◦ F , which may not be an isomorphism. However, there is an important case where we do get an isomorphism. Proposition 10. Let F : A −→ B be a fully faithful functor from a small category A. Then, for every functor G: A −→ D into a cocomplete category D, the natural transformation G −→ LanF G ◦ F is an isomorphism. Dually, for every functor H : A −→ E into a complete category E, the natural transformation RanF H ◦ F −→ H is an isomorphism.

Proof. Since F is fully faithful, for each A ∈ A,(A, 1FA) is a terminal object of (F ↓ FA). Therefore, F ∼ F colim(F ◦ πFA) = (G ◦ πFA)((A, 1FA)) = GA. 

A typical case in which the above Proposition applies is obtained by taking F to be the inclusion of a full (small) A into a category B. Then every functor from A into a cocomplete (or into a complete) category D admits an extension to a functor from B.

Example 11 (Free T−model functor). We can use Kan extensions to provide a left adjoint to the forgetful functor from set-theoretic models of an algebraic theory to the . We first set up the context and the notation.

Let T be a single-sorted algebraic theory and let C`(T) be its classifying category. The basic theory of algebraic theories tells us that C`(T) is a Lawvere theory. Therefore, if we denote with N the full subcategory of Set spanned by the natural numbers, there is a unique map of Lawvere theories op op (•): N −→ C`(T), because N - being a skeleton of the opposite of the category of finite sets - is the initial object in the category of Lawvere theories. By definition, such a functor is bijective on objects, so that we can write every object in C`(T) as n, for n ∈ N. The category of models of T is (up to equivalence of categories) the category FP(C`(T), Set), which C`( ) is the full subcategory of Set T spanned by the finite-product preserving functors from C`(T) to Set. This category is cocomplete (see [ARV11][Theorem 4.5]) There is a forgetful functor U : FP(C`(T), Set) −→ Set, given by evaluation at 1 ∈ C`(T), i.e. U(P ) = P (1) for P ∈ FP(C`(T), Set). U admits a left adjoint, constructed as follows. Let i: N −→ Set be the inclusion of N into Set. We have a composite functor (•)op op Y G: N −→ C`(T) −→ FP(C`(T), Set), n 7→ C`(T)(n, −). 5 Here Y is the contravariant Yoneda embedding, which lands into FP(C`(T), Set) because, for each n ∈ N, C`(T)(n, −) preserves (finite) products. We have then the following diagram of functors i N / Set

G FP(C`(T), Set)

Since FP(C`(T), Set) is cocomplete, by Theorem5 we have the existence of Lani(G): Set −→ FP(C`(T), Set) given, for X ∈ Set, by

(1) (Lani(G)) (X) = colim(f : n→X)∈(i↓X) C`(T)(n, −). ∼ Note that, for each X ∈ Set, colim(f : n→X)∈(i↓X) n = X (this is why we choose to take the left Kan extension along i) and, when X is a finite set, any isomorphism |X| → X (where |X| is ∼ the cardinality of X) is a terminal object in (i ↓ X) and then (Lani(G)) (X) = C`(T)(|X|, −). In particular, the canonical natural transformation G −→ Lani(G) ◦ i given by the definition of the left Kan extension is an isomorphism (which also follows from Proposition 10 above, because i is fully faithful). We have thus constructed a functor F := Lani(G): Set −→ FP(C`(T), Set). A straightforward computation shows now that F is the left adjoint to U. Indeed, given P ∈ FP(C`(T), Set) and X ∈ Set, we have the following chain of natural isomorphism

 ∼ FP(C`(T), Set)(FX,P ) = FP(C`(T), Set) colim(f : n→X)∈(i↓X) C`(T)(n, −) ,P =

∼ = lim FP(C`(T), Set)(C`(T)(n, −) ,P ) = (f : n→X)∈(i↓X)

(i) C`(T) ∼ ∼ = lim Set (C`(T)(n, −) ,P ) = lim P (n) = (f : n→X)∈(i↓X) (f : n→X)∈(i↓X)

(ii) (iii) =∼ lim P (1n) =∼ lim (P (1))n =∼ (f : n→X)∈(i↓X) (f : n→X)∈(i↓X)

∼ ∼  = lim Set (n, P (1)) = Set colim(f : n→X)∈(i↓X) n, P (1) (f : n→X)∈(i↓X)

=∼ Set (X,P (1)) = Set (X,UP ) , where the isomorphism marked as (i) is given by Yoneda’s Lemma, (ii) holds because C`(T) is a Lawvere theory and finally (iii) follows because P is a finite product preserving functor. The composite of the natural isomorphisms above witnesses that F a U and we can conclude.

We can characterize Kan extensions globally via adjunctions as follows. Proposition 12. Let F : A −→ B be a functor between small categories and let D be a category. Consider the functor F ∗ : DB −→ DA,P 7→ P ◦ F given by precomposition with F . Then the following hold.

∗ (1) F has a left adjoint if and only if LanF (G) exists for each G: A −→ D. More precisely, if ∗ A F has a left adjoint F!, then F!(G) is a left Kan extension of G along F , for each G ∈ D . Viceversa, if for every such a G, LanF (G) exists, then the assignment G 7→ LanF (G) extends A B ∗ to a functor LanF : D −→ D such that LanF a F . 6 ∗ (2) F has a right adjoint if and only if RanF (G) exists for each G: A −→ D. More precisely, if ∗ F has a right adjoint F∗, then F∗(G) is a right Kan extension of G along F , for each G ∈ A D . Viceversa, if for every such a G, RanF (G) exists, then the assignment G 7→ RanF (G) A B ∗ extends to a functor RanF : D −→ D such that F a RanF .

Proof. As usual, it is enough to prove the version for left Kan extension, as the other follows by G A duality. Suppose then that (LanF (G), α : G −→ LanF (G) ◦ F ) exists for each functor G ∈ D . Given a natural transformation δ : G −→ G0, for G, G0 ∈ DA, the pair

 0 G0 0  LanF (G ), α ◦ δ : G −→ LanF (G ) ◦ F

G 0 0 must factor through (LanF (G), α ), i.e. there is a unique δ : LanF (G) −→ LanF (G ) such that 0 G G0 0 δF ◦ α = α ◦ δ and we take this δ to be LanF (δ). This uniqueness property assures us that we get a functor A B LanF (−): D −→ D . Now, any pair (H : B −→ D, β : G −→ HF ) as in Definition4, gives a natural transformation B A ∗ β∗ : D (H, −) −→ D (G, F (−)) 0 G sending σ : H −→ H to (β∗)H0 (σ) := σF ◦ β. The universal property of (LanF (G), α ) says that G (α )∗ is an isomorphism. This means that, for each H : B −→ D, we have a natural isomorphism B ∼ A ∗ D (LanF (G),H) = D (G, F (H)), ∗ i.e. LanF (−) a F (−). The uniqueness up to isomorphisms of left adjoints implies that each left ∗ adjoint to F provides left Kan extensions along F .  Remark 13. As anticipated, Proposition 12 gives a global characterization of Kan extensions via adjunctions, in the sense that the existence of left or right adjoints for F ∗ (notations as in Proposition 12) provides left or right Kan extensions along F for every functor G: A −→ D and in fact posit Kan extensions along F as functors of those G’s. By contrast, Definition4 is what we could call a local definition of Kan extensions, because, for a fixed functor F : A −→ B, it says what it means for a single functor G: A −→ D to have a Kan extension along F . In particular, there may be G, G0 : A −→ D such that the left (say) Kan extension of F along G exists, but the left Kan extension of F along G0 does not. This is totally analogous to what happens to limits and colimits: there is a local definition of them in terms of the universal property for the (co)limit of a single functor F and a global one as adjoints to the constant diagram functor. Example 14. Let f :(Y, O(Y )) → (X, O(X)) be a continuous map between topological spaces (so O(Y ) is the given topology on the set Y which makes (Y, O(Y )) into a topological space). Let O(f): O(X) −→ O(Y ),U 7→ f −1(U) be the induced functor between the posetal categories O(X) and O(Y ). We then get an induced composition functor f ∗ := (O(f)op)∗ : PSh(Y ) −→ PSh(X),P 7→ P ◦ O(f)op : X ⊇ U 7→ P (f −1(U)) .

op By definition, PSh(Y ) = SetO(Y ) , therefore, by Proposition 12, we have a diagram of adjoint functors

f! w PSh(Y ) f ∗ / PSh(X) g

f∗ op where f! and f∗ are given by left and right Kan extension along (O(f)) respectively. The functor ∗ f is usually known as the direct image functor, whereas the left adjoint f! is called the inverse 7 image functor (although notations for them may vary significantly). The latter is explicitely given, for G ∈ PSh(X) and V ∈ O(Y ), as

(f!(G))(V ) = colimU∈O(Y ): V ⊆f −1(U) G(U).

In Theorem5 and in Proposition 12 we saw that, in some circumstances, we can get Kan extensions via (co)limits and adjunctions. Actually, (co)limits and adjunctions are themselves specific cases of Kan extensions, as we are going to see in the next two Propositions. This ubiquity of Kan extensions and their holistic capablity of subsuming most of the other basic notions in led MacLane to claim that “All concepts are Kan extensions” (cf. [ML98, §X.7]). Proposition 15. Let 1 be the terminal category and let B, D be categories. Denote with ! the unique functor B −→ 1. Then, for any functor G: B −→ D, the following hold.

(1) G has a colimit in D if and only if the left Kan extension of G along ! exists. (2) Dually, G has a limit in D if and only if the right Kan extension of G along ! exists.

Proof. This follows immediately from the fact that a pair (K : 1 −→ D, α: G −→ K◦!) (resp. a pair (K : 1 −→ D, τ : K◦! −→ G)) is just a cocone from G over K(∗) (resp. a cone to G under K(∗)), where ∗ is the unique object of 1. Then, the universal property for left Kan extensions (resp. right Kan extensions) is precisely the universal property for colimits (resp. for limits). 

Before giving the analogous characterization of adjoints in terms of Kan extensions, we need to introduce the following concept.

Definition 16. Let A −→G D −→K C be composable functors and let F : A −→ B be any functor.

(1) We say that K preserves the left Kan extension of G along F if (K ◦ LanF (G), Kα) is the left Kan extension of KG along F , where (LanF (G), α) is the left Kan extension of G along F .

(2) We say that K preserves the right Kan extension of G along F if (K ◦ RanF (G), Kτ) is the right Kan extension of KG along F , where (RanF (G), τ) is the right Kan extension of G along F . Proposition 17. Let F : A −→ B be a functor. Then the following hold.

(1) F has a left adjoint if and only if the right Kan extension

(RanF (IdA), τ : RanF (IdA) ◦ F −→ IdA)

of F along IdA exists. In this case, RanF (IdA) a F with counit given by τ. (2) Dually, F has a right adjoint if and only if the left Kan extension

(LanF (IdA), α: IdA −→ LanF (IdA) ◦ F )

of F along IdA exists. In this case, F a LanF (IdA) with unit given by α.

References [ARV11] J. Ad´amek,J. Rosick´y,and E. M. Vitale, Algebraic theories, Cambridge Tracts in Mathematics, vol. 184, Cambridge University Press, Cambridge, 2011, A categorical introduction to general algebra, With a foreword by F. W. Lawvere. [Bor94] Francis Borceux, Handbook of categorical algebra. 1, Encyclopedia of Mathematics and its Applications, vol. 50, Cambridge University Press, Cambridge, 1994, Basic category theory. [ML98] , Categories for the working mathematician, second ed., Graduate Texts in Mathematics, vol. 5, Springer-Verlag, New York, 1998. [MLM94] Saunders Mac Lane and Ieke Moerdijk, Sheaves in geometry and logic, Universitext, Springer-Verlag, New York, 1994, A first introduction to theory, Corrected reprint of the 1992 edition.

8