# Yoneda lemma

In mathematics, the **Yoneda lemma** in category theory is an abstract result on functors of the type *morphisms into a fixed object*. It is a vast generalisation of Cayley's theorem from group theory (a group being a category with just one object). It allows the embedding of any category into a category of functors defined on that category. It also clarifies how the embedded category, of representable functors and their natural transformations, relates to the other objects in the larger functor category. It is an important tool that underlies several modern developments in algebraic geometry and representation theory.

## Generalities

The Yoneda lemma suggests that instead of studying the (small) category *C*, one should study the category of all functors of *C* into **Set** (the category of sets with functions as morphisms). **Set** is the category we understand best, and a functor of *C* into **Set** can be seen as a "representation" of *C* in terms of known structures. The original category *C* is contained in this functor category, but new objects appear in the functor category which were absent and "hidden" in *C*. Treating these new objects just like the old ones often unifies and simplifies the theory.

This approach is akin to (and in fact generalizes) the common method of studying a ring by investigating the modules over that ring. The ring takes the place of the category *C*, and the category of modules over the ring is a category of functors defined on *C*.

## Formal statement

We denote by Fun(*C*^{op},**Set**) the category of *contravariant* functors from *C* to **Set** (Here *C*^{op} is the opposite category of *C*). The morphisms in this category are natural transformations; we will write Nat(*F*,*G*) for the set of all natural transformations from the functor *F* to the functor *G*.

If *A* is an object of *C*, then we can assign to every object *X* of *C* the set of morphisms Mor(*X*,*A*). Every morphism φ : *X* → *Y* in *C* induces a map **Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \mathrm{Mor}(-, A)(\phi) : \mathrm{Mor}(Y, A) \to \mathrm{Mor}(X, A) : f \mapsto f \phi}**
. We have thus defined a contravariant functor Mor(-, *A*) from *C* to **Set**, i.e., an element of Fun(*C*^{op},**Set**). Such a functor is called a *representable functor* for *C*; often denoted *h*_{A}.

The covariant functor

**Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle Y : \mathcal{C} \to \mathrm{Fun}(\mathcal{C}^{\mathrm{op}}, \mathbf{Set}) : A \mapsto h_A := \mathrm{Mor}(-, A)}**

is called the *Yoneda embedding* and it is "natural" in the sense that every functor *C* → *D* induces a commutative diagram of the corresponding Yoneda embeddings:

The content of the Yoneda lemma is that Y is indeed a full embedding, i.e., for all objects *A*, *B* in *C*, the functor Y induces a *bijection*:

**Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \mathrm{Mor}_C(A, B) \rightarrow \mathrm{Nat}(Y(A), Y(B)) \ }**

In other words: the morphisms between *A* and *B* in the original category *C* are "the same" as the ones between the two corresponding objects Y(*A*), Y(*B*) in the extended category Fun(*C*^{op},**Set**).

And even more: for any contravariant functor *F* : *C* → **Set** and for any object *A* in *C*, there is a natural bijection:

**Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle F(A) \rightarrow \mathrm{Nat}(Y(A), F) \ }**

This means that, if you know how the functor *F* behaves on *C*, then you also know how it relates to the image of *C* in the extended category.

## Preadditive categories, rings and modules

A *preadditive category* is a category where the morphism sets form abelian groups and the composition of morphisms is bilinear; examples are categories of abelian groups or modules.
In a preadditive category, there are both a "multiplication" and an "addition" of morphisms, and that's why preadditive categories are viewed as generalizations of rings. Rings are preadditive categories with one object.

The Yoneda lemma remains true for preadditive categories if we choose as our extension the category of *additive* contravariant functors from the original category into the category of abelian groups; these are functors which are compatible with the addition of morphisms and should be thought of as forming a *module category* over the original category. The Yoneda lemma then yields the natural procedure to enlarge a preadditive category so that the enlarged version remains preadditive — in fact, the enlarged version is an abelian category, a much more powerful condition. In the case of a ring *R*, the extended category is the category of all left modules over *R*, and the statement of the Yoneda lemma reduces to the well-known isomorphism

*M*= Hom_{R}(*R*,*M*) for all left modules*M*over*R*.