{
  "id": "yoneda-lemma",
  "title": "Yoneda Lemma",
  "lang": "en",
  "source_lang": "en",
  "summary": "The Yoneda lemma identifies natural transformations from a representable functor with elements of another functor, making objects recoverable from their morphisms.",
  "category": "mathematics",
  "subcategory": "algebra",
  "type": "concept",
  "aliases": [
    "Yoneda's lemma"
  ],
  "generated_at": "2026-11-05",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/yoneda-lemma/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/yoneda-lemma/",
      "json": "https://aiwiki.page/zh/yoneda-lemma.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "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."
    },
    {
      "heading": "Background and notation",
      "text": "A category \\(\\mathcal C\\) consists of objects, morphisms between objects, and associative composition with identity morphisms. Write\n\n\\[\\mathcal C(A,X)=\\operatorname{Hom}_{\\mathcal C}(A,X)\\]\n\nfor the collection of morphisms from \\(A\\) to \\(X\\). The category is locally small if each such collection is a set, rather than a proper class.\n\nA covariant functor \\(F:\\mathcal C\\to\\mathbf{Set}\\) assigns a set \\(F(X)\\) to every object \\(X\\) and a function\n\n\\[F(f):F(X)\\longrightarrow F(Y)\\]\n\nto every morphism \\(f:X\\to Y\\), preserving identities and composition. Here \\(\\mathbf{Set}\\) denotes the category of sets and functions.\n\nFor a fixed object \\(A\\), the covariant hom-functor\n\n\\[h^A=\\mathcal C(A,-)\\]\n\nassigns to \\(X\\) the set of arrows \\(A\\to X\\). For \\(f:X\\to Y\\), its action is postcomposition:\n\n\\[h^A(f)(g)=f\\circ g.\\]\n\nA natural transformation \\(\\alpha:H\\Rightarrow F\\) consists of functions \\(\\alpha_X:H(X)\\to F(X)\\) satisfying\n\n\\[F(f)\\circ\\alpha_X=\\alpha_Y\\circ H(f)\\]\n\nfor every morphism \\(f: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."
    },
    {
      "heading": "Statement of the lemma",
      "text": "Let \\(\\mathcal C\\) be a locally small category, let \\(A\\) be an object of \\(\\mathcal C\\), and let \\(F:\\mathcal C\\to\\mathbf{Set}\\) be a covariant functor. There is a canonical bijection\n\n\\[\\operatorname{Nat}\\bigl(\\mathcal C(A,-),F\\bigr)\\cong F(A),\\]\n\nwhere \\(\\operatorname{Nat}(H,F)\\) denotes the natural transformations from \\(H\\) to \\(F\\).\n\nThe bijection is given by evaluation at the identity morphism:\n\n\\[\\Phi_{A,F}(\\alpha)=\\alpha_A(\\operatorname{id}_A).\\]\n\nConversely, an element \\(x\\in F(A)\\) determines a natural transformation \\(\\alpha^x\\) whose component at \\(X\\) is\n\n\\[\\alpha^x_X:\\mathcal C(A,X)\\longrightarrow F(X), \\qquad \\alpha^x_X(f)=F(f)(x).\\]\n\nThus 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 \\(A\\) and \\(F\\).\n\nFor example, if \\(\\theta:F\\Rightarrow G\\), then applying \\(\\theta\\) to a natural transformation corresponds under the bijection to applying\n\n\\[\\theta_A:F(A)\\longrightarrow G(A).\\]\n\nLikewise, a morphism \\(u:A\\to B\\) induces a transformation\n\n\\[\\mathcal C(B,-)\\Rightarrow\\mathcal C(A,-)\\]\n\nby precomposition. Precomposing with this transformation corresponds to the map \\(F(u):F(A)\\to F(B)\\)."
    },
    {
      "heading": "Proof",
      "text": "The proof follows directly from naturality and the identity law.\n\nSuppose\n\n\\[\\alpha:\\mathcal C(A,-)\\Rightarrow F\\]\n\nis a natural transformation. For any morphism \\(f:A\\to X\\), naturality gives\n\n\\[F(f)\\bigl(\\alpha_A(\\operatorname{id}_A)\\bigr) = \\alpha_X\\bigl(f\\circ\\operatorname{id}_A\\bigr) = \\alpha_X(f).\\]\n\nConsequently, every component of \\(\\alpha\\) is forced by the one element\n\n\\[x=\\alpha_A(\\operatorname{id}_A).\\]\n\nThis establishes uniqueness.\n\nFor existence, take any \\(x\\in F(A)\\) and define\n\n\\[\\alpha^x_X(f)=F(f)(x).\\]\n\nIf \\(g:X\\to Y\\), functoriality implies\n\n\\[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).\\]\n\nHence \\(\\alpha^x\\) is natural. Finally,\n\n\\[\\alpha^x_A(\\operatorname{id}_A) = F(\\operatorname{id}_A)(x) = x.\\]\n\nThe two constructions are therefore inverse.\n\nThe decisive step is that every arrow \\(f:A\\to X\\) is the image of \\(\\operatorname{id}_A\\) under postcomposition by \\(f\\). Naturality then forces the value of the transformation at \\(f\\)."
    },
    {
      "heading": "Contravariant form",
      "text": "A contravariant functor on \\(\\mathcal C\\) is equivalently a covariant functor from the opposite category \\(\\mathcal C^{\\mathrm{op}}\\), whose arrows are those of \\(\\mathcal C\\) with their directions reversed.\n\nFor\n\n\\[P:\\mathcal C^{\\mathrm{op}}\\to\\mathbf{Set},\\]\n\nthe corresponding form of the lemma is\n\n\\[\\operatorname{Nat}\\bigl(\\mathcal C(-,A),P\\bigr)\\cong P(A).\\]\n\nAgain, the forward map evaluates at \\(\\operatorname{id}_A\\). An element \\(x\\in P(A)\\) determines the transformation\n\n\\[\\beta^x_X(f)=P(f)(x), \\qquad f:X\\to A.\\]\n\nA set-valued contravariant functor is called a presheaf. In this language, the lemma says that a map from the representable presheaf \\(\\mathcal C(-,A)\\) into \\(P\\) is exactly an element of \\(P(A)\\).\n\nBoth forms are standard. Keeping track of variance is essential: \\(\\mathcal C(A,-)\\) is covariant in its displayed argument, whereas \\(\\mathcal C(-,A)\\) is contravariant."
    },
    {
      "heading": "The Yoneda embedding",
      "text": "For a small category \\(\\mathcal C\\), the Yoneda embedding is the functor\n\n\\[y:\\mathcal C\\longrightarrow[\\mathcal C^{\\mathrm{op}},\\mathbf{Set}], \\qquad A\\longmapsto\\mathcal C(-,A),\\]\n\nwhere the bracket notation denotes the category of presheaves and natural transformations.\n\nA morphism \\(u:A\\to B\\) is sent to the natural transformation whose component at \\(X\\) is\n\n\\[\\mathcal C(X,A)\\longrightarrow\\mathcal C(X,B), \\qquad f\\longmapsto u\\circ f.\\]\n\nTaking \\(P=\\mathcal C(-,B)\\) in the contravariant Yoneda lemma gives\n\n\\[\\operatorname{Nat}\\bigl(\\mathcal C(-,A),\\mathcal C(-,B)\\bigr) \\cong \\mathcal C(A,B).\\]\n\nThus \\(y\\) is fully faithful: it induces a bijection on each set of morphisms.\n\nIn particular:\n\n- Every natural transformation between these representable presheaves comes from a unique morphism in \\(\\mathcal C\\).\n- Two objects have naturally isomorphic representable presheaves if and only if they are isomorphic.\n- A morphism \\(u\\) is an isomorphism if and only if \\(y(u)\\) is an isomorphism of presheaves.\n\nThis 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.\n\nThere is also a covariant version of the embedding,\n\n\\[\\mathcal C^{\\mathrm{op}}\\longrightarrow[\\mathcal C,\\mathbf{Set}], \\qquad A\\longmapsto\\mathcal C(A,-).\\]\n\nThe opposite category appears because a morphism \\(A\\to B\\) induces a transformation \\(\\mathcal C(B,-)\\Rightarrow\\mathcal C(A,-)\\)."
    },
    {
      "heading": "Representability and universal elements",
      "text": "A functor \\(F:\\mathcal C\\to\\mathbf{Set}\\) is representable if there is an object \\(A\\) and a natural isomorphism\n\n\\[\\mathcal C(A,-)\\cong F.\\]\n\nBy the Yoneda lemma, specifying such an isomorphism amounts to finding an element \\(u\\in F(A)\\) such that, for every object \\(X\\), the function\n\n\\[\\mathcal C(A,X)\\longrightarrow F(X), \\qquad f\\longmapsto F(f)(u)\\]\n\nis bijective.\n\nThe element \\(u\\) is called a universal element. Every element of \\(F(X)\\) arises uniquely from it along a morphism \\(A\\to X\\). This formulation connects representable functors with universal properties: the representing object encodes a family of constructions together with their uniqueness conditions.\n\nThe lemma also explains uniqueness of representation. If both \\(A\\) and \\(B\\) represent the same functor, their representations determine an isomorphism between \\(A\\) and \\(B\\). Once the representing isomorphisms, or equivalently the universal elements, are fixed, the compatible isomorphism is unique."
    },
    {
      "heading": "Examples",
      "text": "Sets and the identity functor\n\nLet \\(1\\) be a singleton set. Choosing the image of its unique element gives a natural bijection\n\n\\[\\operatorname{Hom}_{\\mathbf{Set}}(1,X)\\cong X.\\]\n\nThus the identity functor on \\(\\mathbf{Set}\\) is represented by \\(1\\).\n\nThe Yoneda lemma consequently gives\n\n\\[\\operatorname{Nat}(\\operatorname{Id}_{\\mathbf{Set}}, \\operatorname{Id}_{\\mathbf{Set}}) \\cong 1.\\]\n\nThere is exactly one natural endotransformation of the identity functor: the identity itself.\n\nEquivalently, a family of functions \\(\\alpha_X:X\\to X\\) that commutes with every function between sets must satisfy \\(\\alpha_X(x)=x\\) for every \\(X\\) and \\(x\\in X\\).\n\nVector spaces and scalar multiplication\n\nFix a field \\(k\\), and let\n\n\\[U:\\mathbf{Vect}_k\\to\\mathbf{Set}\\]\n\nbe the functor taking each vector space to its underlying set. A linear map \\(k\\to V\\) is uniquely determined by the image of \\(1\\), so\n\n\\[\\operatorname{Hom}_k(k,V)\\cong U(V)\\]\n\nnaturally in \\(V\\).\n\nYoneda therefore identifies natural transformations \\(U\\Rightarrow U\\) with elements of \\(U(k)\\), namely scalars \\(\\lambda\\in k\\). The associated transformation is\n\n\\[v\\longmapsto\\lambda v.\\]\n\nAlthough its components were initially required only to be set functions, naturality with respect to all linear maps forces each component to be scalar multiplication.\n\nNatural transformations between powers\n\nFor sets \\(A\\) and \\(B\\), regard\n\n\\[X\\longmapsto X^A=\\operatorname{Hom}(A,X)\\]\n\nand \\(X\\longmapsto X^B\\) as functors on sets. Yoneda gives\n\n\\[\\operatorname{Nat}\\bigl((-)^A,(-)^B\\bigr) \\cong \\operatorname{Hom}(B,A).\\]\n\nA function \\(r:B\\to A\\) produces the transformation\n\n\\[f\\longmapsto f\\circ r.\\]\n\nEvery 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 \\(X\\) that arbitrary functions would fail to preserve."
    },
    {
      "heading": "Applications and scope",
      "text": "In algebraic geometry, the functor of points of a scheme \\(X\\) assigns to a test scheme \\(T\\) the set\n\n\\[\\operatorname{Hom}(T,X).\\]\n\nYoneda shows that this functor, including its action on morphisms of test schemes, determines \\(X\\) 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.\n\nIn 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.\n\nThe 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.\n\nThere 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.\n\nEnriched 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."
    }
  ],
  "links": [
    "category-theory",
    "set-mathematics",
    "functor",
    "bijective-function",
    "isomorphism",
    "universal-property",
    "field-mathematics",
    "vector-space",
    "linear-map",
    "algebraic-geometry",
    "algebraic-topology"
  ],
  "sources": [],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}