The Yoneda lemma is a foundational result in category theory that describes natural transformations from a representable functor to an arbitrary set-valued functor. It states that such a transformation is completely determined by its value on a single identity morphism. Its principal consequence, the Yoneda embedding, expresses a category faithfully inside a category of functors: an object can be studied through all the morphisms into it, without losing information about either objects or morphisms. The lemma is named after the Japanese mathematician Nobuo Yoneda.
Background and notation
A category consists of objects, morphisms between objects, and associative composition with identity morphisms. Write
for the collection of morphisms from to . The category is locally small if each such collection is a set, rather than a proper class.
A covariant functor assigns a set to every object and a function
to every morphism , preserving identities and composition. Here denotes the category of sets and functions.
For a fixed object , the covariant hom-functor
assigns to the set of arrows . For , its action is postcomposition:
A natural transformation consists of functions satisfying
for every morphism . This compatibility requirement is what makes the Yoneda lemma possible: arbitrary families of functions between the same sets would not satisfy its conclusion.
Statement of the lemma
Let be a locally small category, let be an object of , and let be a covariant functor. There is a canonical bijection
where denotes the natural transformations from to .
The bijection is given by evaluation at the identity morphism:
Conversely, an element determines a natural transformation whose component at is
Thus the lemma says more than that two sets have the same size. It specifies mutually inverse constructions, and these constructions are themselves natural in both and .
For example, if , then applying to a natural transformation corresponds under the bijection to applying
Likewise, a morphism induces a transformation
by precomposition. Precomposing with this transformation corresponds to the map .
Proof
The proof follows directly from naturality and the identity law.
Suppose
is a natural transformation. For any morphism , naturality gives
Consequently, every component of is forced by the one element
This establishes uniqueness.
For existence, take any and define
If , functoriality implies
Hence is natural. Finally,
The two constructions are therefore inverse.
The decisive step is that every arrow is the image of under postcomposition by . Naturality then forces the value of the transformation at .
Contravariant form
A contravariant functor on is equivalently a covariant functor from the opposite category , whose arrows are those of with their directions reversed.
For
the corresponding form of the lemma is
Again, the forward map evaluates at . An element determines the transformation
A set-valued contravariant functor is called a presheaf. In this language, the lemma says that a map from the representable presheaf into is exactly an element of .
Both forms are standard. Keeping track of variance is essential: is covariant in its displayed argument, whereas is contravariant.
The Yoneda embedding
For a small category , the Yoneda embedding is the functor
where the bracket notation denotes the category of presheaves and natural transformations.
A morphism is sent to the natural transformation whose component at is
Taking in the contravariant Yoneda lemma gives
Thus is fully faithful: it induces a bijection on each set of morphisms.
In particular:
- Every natural transformation between these representable presheaves comes from a unique morphism in .
- Two objects have naturally isomorphic representable presheaves if and only if they are isomorphic.
- A morphism is an isomorphism if and only if is an isomorphism of presheaves.
This is the precise sense in which an object is determined by its relationships to all other objects. It is not enough to know only the cardinalities of the hom-sets; their functorial behavior under composition is essential.
There is also a covariant version of the embedding,
The opposite category appears because a morphism induces a transformation .
Representability and universal elements
A functor is representable if there is an object and a natural isomorphism
By the Yoneda lemma, specifying such an isomorphism amounts to finding an element such that, for every object , the function
is bijective.
The element is called a universal element. Every element of arises uniquely from it along a morphism . This formulation connects representable functors with universal properties: the representing object encodes a family of constructions together with their uniqueness conditions.
The lemma also explains uniqueness of representation. If both and represent the same functor, their representations determine an isomorphism between and . Once the representing isomorphisms, or equivalently the universal elements, are fixed, the compatible isomorphism is unique.
Examples
Sets and the identity functor
Let be a singleton set. Choosing the image of its unique element gives a natural bijection
Thus the identity functor on is represented by .
The Yoneda lemma consequently gives
There is exactly one natural endotransformation of the identity functor: the identity itself.
Equivalently, a family of functions that commutes with every function between sets must satisfy for every and .
Vector spaces and scalar multiplication
Fix a field , and let
be the functor taking each vector space to its underlying set. A linear map is uniquely determined by the image of , so
naturally in .
Yoneda therefore identifies natural transformations with elements of , namely scalars . The associated transformation is
Although its components were initially required only to be set functions, naturality with respect to all linear maps forces each component to be scalar multiplication.
Natural transformations between powers
For sets and , regard
and as functors on sets. Yoneda gives
A function produces the transformation
Every natural transformation between these power functors has this form. Such operations can select, repeat, or reorder coordinates, but cannot introduce an operation on the elements of that arbitrary functions would fail to preserve.
Applications and scope
In algebraic geometry, the functor of points of a scheme assigns to a test scheme the set
Yoneda shows that this functor, including its action on morphisms of test schemes, determines up to isomorphism. This perspective also supports the study of moduli functors, where a classification problem is first formulated as a functor and then investigated for representability.
In algebraic topology and related fields, universal constructions are often specified through natural bijections involving hom-sets. Yoneda allows such descriptions to identify objects and maps without choosing explicit coordinates or presentations.
The lemma does not assert that every set-valued functor is representable. It describes transformations out of representable functors and supplies a criterion for representability through universal elements. Nor is the Yoneda embedding generally an equivalence with the whole presheaf category: most presheaves need not be representable.
There are also size qualifications. For a small category, the presheaf category has ordinary sets of natural transformations. For a large locally small category, unrestricted collections of natural transformations between arbitrary functors can present foundational difficulties; universe conventions or restrictions on the functors are commonly used. Transformations from a representable functor to a set-valued functor are nevertheless explicitly parametrized by the set appearing in the lemma.
Enriched versions replace ordinary hom-sets with hom-objects in a suitable monoidal category. Higher-categorical versions replace sets of morphisms with mapping spaces and natural bijections with equivalences. These generalizations retain the same central mechanism: maps from a representable object are controlled by evaluation.