Yoneda's lemma concerns functors from a fixed category \mathcal{C} to a
category of sets, \mathbf{Set} . If \mathcal{C} is a
locally small category (i.e. the
hom-sets are actual sets and not
proper classes), then each object A of \mathcal{C} gives rise to a functor to \mathbf{Set} called a
hom-functor. This functor is denoted: :h_A(-) \equiv \mathrm{Hom}(A,-). The (
covariant) hom-functor h_A sends X \in \mathcal{C} to the set of
morphisms \mathrm{Hom}(A,X) and sends a morphism f \colon X \to Y (where Y \in \mathcal{C} ) to the morphism f \circ - (composition with f on the left) that sends a morphism g in \mathrm{Hom}(A,X) to the morphism f \circ g in \mathrm{Hom}(A,Y). That is, : h_A(f) = \mathrm{Hom}(A,f), \text{ or} : h_A(f)(g) = f \circ g Yoneda's lemma says that: {{Math theorem|Let F be a functor from a locally small category \mathcal{C} to \mathbf{Set} . Then for each object A of \mathcal{C} , the
natural transformations \mathrm{Nat}(h_A,F)\equiv \mathrm{Hom}(\mathrm{Hom}(A,-),F) from h_A to F are in one-to-one correspondence with the elements of F(A) ; rather intuitively, there exists a bijection between \mathrm{Hom}(\mathrm{Hom}(A,-),F) and F(A). That is, :\mathrm{Nat}(h_A,F) \cong F(A) Moreover, this isomorphism is
natural in A and F when both sides are regarded as functors from \mathcal{C} \times \mathbf{Set}^\mathcal{C} to \mathbf{Set} . }} Here the notation \mathbf{Set}^\mathcal{C} denotes the category of functors from \mathcal{C} to \mathbf{Set} . Given a natural transformation \Phi from h_A to F, the corresponding element of F(A) is u = \Phi_A(\mathrm{id}_A);{{efn|Recall that \Phi_A : \mathrm{Hom}(A,A) \to F(A) so the last expression is well-defined and sends a morphism from A to A, to an element in F(A).}} and given an element u of F(A), the corresponding natural transformation is given by \Phi_{X}(f) = F(f)(u) which assigns to a morphism f \colon A \to X a value of F(X).
Contravariant version There is a contravariant version of Yoneda's lemma, which concerns
contravariant functors from \mathcal{C} to \mathbf{Set} (also known as
presheaves). This version involves the contravariant hom-functor :h^A(-) \equiv \mathrm{Hom}(-, A), which sends X to the hom-set \mathrm{Hom}(X,A) . Given an arbitrary contravariant functor G from \mathcal{C} to \mathbf{Set} , Yoneda's lemma asserts that :\mathrm{Nat}(h^A,G) \cong G(A).
Naturality The bijections provided in the (covariant) Yoneda lemma (for each A and F) are the components of a
natural isomorphism between two certain functors from \mathcal{C} \times \mathbf{Set}^\mathcal{C} to \mathbf{Set} . One of the two functors is the evaluation functor :-(-)\colon \mathcal{C} \times \mathbf{Set}^\mathcal{C} \to \mathbf{Set} :-(-)\colon (A,F)\mapsto F(A) that sends a pair (f,\Phi) of a morphism f\colon A\to B in \mathcal C and a
natural transformation \Phi\colon F\to G to the map :\Phi_B\circ F(f)=G(f)\circ\Phi_A\colon F(A)\to G(B). This is enough to determine the other functor since we know what the natural isomorphism is. Under the second functor :\operatorname{Nat}(\hom(-,-),-)\colon\mathcal C\times\operatorname{Set}^{\mathcal C}\to\operatorname{Set}, :\operatorname{Nat}(\hom(-,-),-)\colon(A,F)\mapsto\operatorname{Nat}(\hom(A,-),F), the image of a pair (f,\Phi) is the map :\operatorname{Nat}(\hom(f,-),\Phi)=\operatorname{Nat}(\hom(B,-),\Phi)\circ\operatorname{Nat}(\hom(f,-),F)=\operatorname{Nat}(\hom(f,-),G)\circ\operatorname{Nat}(\hom(A,-),\Phi) that sends a natural transformation \Psi\colon\hom(A,-)\to F to the natural transformation \Phi\circ\Psi\circ\hom(f,-)\colon\hom(B,-)\to G, whose components are :(\Phi\circ\Psi\circ\hom(f,-))_C(g)=(\Phi\circ\Psi)_C(g\circ f)\qquad(g\colon B\to C).
Naming conventions The use of h_A for the covariant hom-functor and h^A for the contravariant hom-functor is not completely standard. Many texts and articles either use the opposite convention or completely unrelated symbols for these two functors. However, most modern algebraic geometry texts starting with
Alexander Grothendieck's foundational
EGA use the convention in this article. The mnemonic "falling into something" can be helpful in remembering that h_A is the covariant hom-functor. When the letter A is
falling (i.e. a subscript), h_A assigns to an object X the morphisms from A
into X .
Proof Since \Phi is a natural transformation, we have the following
commutative diagram: This diagram shows that the natural transformation \Phi is completely determined by \Phi_A(\mathrm{id}_A)=u since for each morphism f \colon A \to X one has :\Phi_X(f) = (Ff)u. Moreover, any element u \in F(A) defines a natural transformation in this way. The proof in the contravariant case is completely analogous.
The Yoneda embedding An important special case of Yoneda's lemma is when the functor F from \mathcal{C} to \mathbf{Set} is another hom-functor h_B . In this case, the covariant version of Yoneda's lemma states that :\mathrm{Nat}(h_A,h_B) \cong \mathrm{Hom}(B,A). That is, natural transformations between hom-functors are in one-to-one correspondence with morphisms (in the reverse direction) between the associated objects. Given a morphism f \colon B \to A the associated natural transformation is denoted \mathrm{Hom}(f,-). Mapping each object A in \mathcal{C} to its associated hom-functor h_A = \mathrm{Hom}(A,-) and each morphism f \colon B \to A to the corresponding natural transformation \mathrm{Hom}(f,-) determines a contravariant functor h_{\bullet} from \mathcal{C}^{\text{op}} to \mathbf{Set}^\mathcal{C} , the
functor category of all (covariant) functors from \mathcal{C} to \mathbf{Set} . One can interpret h_{\bullet} as a
covariant functor: :h_{\bullet}\colon \mathcal{C}^{\text{op}} \to \mathbf{Set}^\mathcal{C}. The meaning of Yoneda's lemma in this setting is that the functor h_{\bullet} is
fully faithful, and therefore gives an embedding of \mathcal{C}^{\mathrm{op}} in the category of functors to \mathbf{Set} . The collection of all functors \{h_A | A \in C\} is a subcategory of \mathbf{Set}^{\mathcal{C}} . Therefore, Yoneda embedding implies that the category \mathcal{C}^{\mathrm{op}} is isomorphic to the category \{h_A | A \in C \}. The contravariant version of Yoneda's lemma states that :\mathrm{Nat}(h^A,h^B) \cong \mathrm{Hom}(A,B). Therefore, h^{\bullet} gives rise to a covariant functor from \mathcal{C} to the category of contravariant functors to \mathbf{Set} : :h^{\bullet}\colon \mathcal{C} \to \mathbf{Set}^{\mathcal{C}^{\mathrm{op}}}. Yoneda's lemma then states that any locally small category \mathcal{C} can be embedded in the category of contravariant functors from \mathcal{C} to \mathbf{Set} via h^{\bullet}. This is called the
Yoneda embedding. The Yoneda embedding is sometimes denoted by よ, the
hiragana Yo.
Representable functor The Yoneda embedding essentially states that for every (locally small) category, objects in that category can be
represented by
presheaves, in a full and faithful manner. That is, :\mathrm{Nat}(h^A,P) \cong P(A) for a presheaf
P. Many common categories are, in fact, categories of pre-sheaves, and on closer inspection, prove to be categories of
sheaves, and as such examples are commonly topological in nature, they can be seen to be
topoi in general. The Yoneda lemma provides a point of leverage by which the topological structure of a category can be studied and understood.
In terms of (co)end calculus Given two categories \mathbf{C} and \mathbf{D} with two functors F, G : \mathbf{C} \to \mathbf{D}, natural transformations between them can be written as the following
end. :\mathrm{Nat}(F, G) = \int_{c \in \mathbf{C}} \mathrm{Hom}_\mathbf{D}(Fc, Gc) For any functors K \colon \mathbf{C}^{op} \to \mathbf{Sets} and H \colon \mathbf{C} \to \mathbf{Sets} the following formulas are all formulations of the Yoneda lemma. : K \cong \int^{c \in \mathbf{C}} Kc \times \mathrm{Hom}_\mathbf{C}(-,c), \qquad K \cong \int_{c \in \mathbf{C}} (Kc)^{\mathrm{Hom}_\mathbf{C}(c,-)}, : H \cong \int^{c \in \mathbf{C}} Hc \times \mathrm{Hom}_\mathbf{C}(c,-), \qquad H \cong \int_{c \in \mathbf{C}} (Hc)^{\mathrm{Hom}_\mathbf{C}(-,c)}.
Yoneda extension Let \mathcal{C} be a small category, F:\mathcal{C} \rightarrow \mathcal{D} a functor, and [\mathcal{C}^{op}, \mathbf{Set}] the
category of presheaves, its Yoneda extension \tilde F:[\mathcal{C}^{op}, \mathbf{Set}] \rightarrow \mathcal{D} is the left
Kan extension \mathrm{Lan}_{H^{\bullet}} F:[\mathcal{C}^{op},\mathbf{Set}] \rightarrow \mathcal{D} of F along the Yoneda embedding H^{\bullet}: \tilde F :=\mathrm{Lan}_{H^{\bullet}} F == Preadditive categories, rings and modules ==