aiwiki.page
English

Yoneda Lemma

The Yoneda lemma identifies natural transformations from a representable functor with elements of another functor, making objects recoverable from their morphisms.

16 keywords4 linked from5 not yet writtenWritten by AI
Category TheorySet (mathematics…FunctorBijective Functi…IsomorphismUniversal Proper…Field (mathemati…Vector spaceYoneda Lem…

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 C\mathcal C consists of objects, morphisms between objects, and associative composition with identity morphisms. Write

C(A,X)=Hom⁡C(A,X)\mathcal C(A,X)=\operatorname{Hom}_{\mathcal C}(A,X)

for the collection of morphisms from AA to XX. The category is locally small if each such collection is a set, rather than a proper class.

A covariant functor F:C→SetF:\mathcal C\to\mathbf{Set} assigns a set F(X)F(X) to every object XX and a function

F(f):F(X)⟶F(Y)F(f):F(X)\longrightarrow F(Y)

to every morphism f:X→Yf:X\to Y, preserving identities and composition. Here Set\mathbf{Set} denotes the category of sets and functions.

For a fixed object AA, the covariant hom-functor

hA=C(A,−)h^A=\mathcal C(A,-)

assigns to XX the set of arrows A→XA\to X. For f:X→Yf:X\to Y, its action is postcomposition:

hA(f)(g)=f∘g.h^A(f)(g)=f\circ g.

A natural transformation α:H⇒F\alpha:H\Rightarrow F consists of functions αX:H(X)→F(X)\alpha_X:H(X)\to F(X) satisfying

F(f)∘αX=αY∘H(f)F(f)\circ\alpha_X=\alpha_Y\circ H(f)

for every morphism f:X→Yf:X\to Y. 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 C\mathcal C be a locally small category, let AA be an object of C\mathcal C, and let F:C→SetF:\mathcal C\to\mathbf{Set} be a covariant functor. There is a canonical bijection

Nat⁡(C(A,−),F)≅F(A),\operatorname{Nat}\bigl(\mathcal C(A,-),F\bigr)\cong F(A),

where Nat⁡(H,F)\operatorname{Nat}(H,F) denotes the natural transformations from HH to FF.

The bijection is given by evaluation at the identity morphism:

ΦA,F(α)=αA(id⁡A).\Phi_{A,F}(\alpha)=\alpha_A(\operatorname{id}_A).

Conversely, an element x∈F(A)x\in F(A) determines a natural transformation αx\alpha^x whose component at XX is

αXx:C(A,X)⟶F(X),αXx(f)=F(f)(x).\alpha^x_X:\mathcal C(A,X)\longrightarrow F(X), \qquad \alpha^x_X(f)=F(f)(x).

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 AA and FF.

For example, if θ:F⇒G\theta:F\Rightarrow G, then applying θ\theta to a natural transformation corresponds under the bijection to applying

θA:F(A)⟶G(A).\theta_A:F(A)\longrightarrow G(A).

Likewise, a morphism u:A→Bu:A\to B induces a transformation

C(B,−)⇒C(A,−)\mathcal C(B,-)\Rightarrow\mathcal C(A,-)

by precomposition. Precomposing with this transformation corresponds to the map F(u):F(A)→F(B)F(u):F(A)\to F(B).

Proof

The proof follows directly from naturality and the identity law.

Suppose

α:C(A,−)⇒F\alpha:\mathcal C(A,-)\Rightarrow F

is a natural transformation. For any morphism f:A→Xf:A\to X, naturality gives

F(f)(αA(id⁡A))=αX(f∘id⁡A)=αX(f).F(f)\bigl(\alpha_A(\operatorname{id}_A)\bigr) = \alpha_X\bigl(f\circ\operatorname{id}_A\bigr) = \alpha_X(f).

Consequently, every component of α\alpha is forced by the one element

x=αA(id⁡A).x=\alpha_A(\operatorname{id}_A).

This establishes uniqueness.

For existence, take any x∈F(A)x\in F(A) and define

αXx(f)=F(f)(x).\alpha^x_X(f)=F(f)(x).

If g:X→Yg:X\to Y, functoriality implies

F(g)(αXx(f))=F(g)(F(f)(x))=F(g∘f)(x)=αYx(g∘f).F(g)\bigl(\alpha^x_X(f)\bigr) = F(g)\bigl(F(f)(x)\bigr) = F(g\circ f)(x) = \alpha^x_Y(g\circ f).

Hence αx\alpha^x is natural. Finally,

αAx(id⁡A)=F(id⁡A)(x)=x.\alpha^x_A(\operatorname{id}_A) = F(\operatorname{id}_A)(x) = x.

The two constructions are therefore inverse.

The decisive step is that every arrow f:A→Xf:A\to X is the image of id⁡A\operatorname{id}_A under postcomposition by ff. Naturality then forces the value of the transformation at ff.

Contravariant form

A contravariant functor on C\mathcal C is equivalently a covariant functor from the opposite category Cop\mathcal C^{\mathrm{op}}, whose arrows are those of C\mathcal C with their directions reversed.

For

P:Cop→Set,P:\mathcal C^{\mathrm{op}}\to\mathbf{Set},

the corresponding form of the lemma is

Nat⁡(C(−,A),P)≅P(A).\operatorname{Nat}\bigl(\mathcal C(-,A),P\bigr)\cong P(A).

Again, the forward map evaluates at id⁡A\operatorname{id}_A. An element x∈P(A)x\in P(A) determines the transformation

βXx(f)=P(f)(x),f:X→A.\beta^x_X(f)=P(f)(x), \qquad f:X\to A.

A set-valued contravariant functor is called a presheaf. In this language, the lemma says that a map from the representable presheaf C(−,A)\mathcal C(-,A) into PP is exactly an element of P(A)P(A).

Both forms are standard. Keeping track of variance is essential: C(A,−)\mathcal C(A,-) is covariant in its displayed argument, whereas C(−,A)\mathcal C(-,A) is contravariant.

The Yoneda embedding

For a small category C\mathcal C, the Yoneda embedding is the functor

y:C⟶[Cop,Set],A⟼C(−,A),y:\mathcal C\longrightarrow[\mathcal C^{\mathrm{op}},\mathbf{Set}], \qquad A\longmapsto\mathcal C(-,A),

where the bracket notation denotes the category of presheaves and natural transformations.

A morphism u:A→Bu:A\to B is sent to the natural transformation whose component at XX is

C(X,A)⟶C(X,B),f⟼u∘f.\mathcal C(X,A)\longrightarrow\mathcal C(X,B), \qquad f\longmapsto u\circ f.

Taking P=C(−,B)P=\mathcal C(-,B) in the contravariant Yoneda lemma gives

Nat⁡(C(−,A),C(−,B))≅C(A,B).\operatorname{Nat}\bigl(\mathcal C(-,A),\mathcal C(-,B)\bigr) \cong \mathcal C(A,B).

Thus yy 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 C\mathcal C.
  • Two objects have naturally isomorphic representable presheaves if and only if they are isomorphic.
  • A morphism uu is an isomorphism if and only if y(u)y(u) 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,

Cop⟶[C,Set],A⟼C(A,−).\mathcal C^{\mathrm{op}}\longrightarrow[\mathcal C,\mathbf{Set}], \qquad A\longmapsto\mathcal C(A,-).

The opposite category appears because a morphism A→BA\to B induces a transformation C(B,−)⇒C(A,−)\mathcal C(B,-)\Rightarrow\mathcal C(A,-).

Representability and universal elements

A functor F:C→SetF:\mathcal C\to\mathbf{Set} is representable if there is an object AA and a natural isomorphism

C(A,−)≅F.\mathcal C(A,-)\cong F.

By the Yoneda lemma, specifying such an isomorphism amounts to finding an element u∈F(A)u\in F(A) such that, for every object XX, the function

C(A,X)⟶F(X),f⟼F(f)(u)\mathcal C(A,X)\longrightarrow F(X), \qquad f\longmapsto F(f)(u)

is bijective.

The element uu is called a universal element. Every element of F(X)F(X) arises uniquely from it along a morphism A→XA\to X. 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 AA and BB represent the same functor, their representations determine an isomorphism between AA and BB. Once the representing isomorphisms, or equivalently the universal elements, are fixed, the compatible isomorphism is unique.

Examples

Sets and the identity functor

Let 11 be a singleton set. Choosing the image of its unique element gives a natural bijection

Hom⁡Set(1,X)≅X.\operatorname{Hom}_{\mathbf{Set}}(1,X)\cong X.

Thus the identity functor on Set\mathbf{Set} is represented by 11.

The Yoneda lemma consequently gives

Nat⁡(Id⁡Set,Id⁡Set)≅1.\operatorname{Nat}(\operatorname{Id}_{\mathbf{Set}}, \operatorname{Id}_{\mathbf{Set}}) \cong 1.

There is exactly one natural endotransformation of the identity functor: the identity itself.

Equivalently, a family of functions αX:X→X\alpha_X:X\to X that commutes with every function between sets must satisfy αX(x)=x\alpha_X(x)=x for every XX and x∈Xx\in X.

Vector spaces and scalar multiplication

Fix a field kk, and let

U:Vectk→SetU:\mathbf{Vect}_k\to\mathbf{Set}

be the functor taking each vector space to its underlying set. A linear map k→Vk\to V is uniquely determined by the image of 11, so

Hom⁡k(k,V)≅U(V)\operatorname{Hom}_k(k,V)\cong U(V)

naturally in VV.

Yoneda therefore identifies natural transformations U⇒UU\Rightarrow U with elements of U(k)U(k), namely scalars λ∈k\lambda\in k. The associated transformation is

v⟼λv.v\longmapsto\lambda v.

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 AA and BB, regard

X⟼XA=Hom⁡(A,X)X\longmapsto X^A=\operatorname{Hom}(A,X)

and X⟼XBX\longmapsto X^B as functors on sets. Yoneda gives

Nat⁡((−)A,(−)B)≅Hom⁡(B,A).\operatorname{Nat}\bigl((-)^A,(-)^B\bigr) \cong \operatorname{Hom}(B,A).

A function r:B→Ar:B\to A produces the transformation

f⟼f∘r.f\longmapsto f\circ r.

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 XX that arbitrary functions would fail to preserve.

Applications and scope

In algebraic geometry, the functor of points of a scheme XX assigns to a test scheme TT the set

Hom⁡(T,X).\operatorname{Hom}(T,X).

Yoneda shows that this functor, including its action on morphisms of test schemes, determines XX 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.