Yoneda lemma : Let \(\mathcal{C}\) be a (locally) small category. Then
naturally in \(A\in \mathcal{C}\) and \(X\in [\mathcal{C}^{\rm{op}},\rm{Set}]\).
Terminology :
Now that we have defined terminology used in the statement, we will now prove the statement. We will first give a bijection
and then prove that it is natural in \(A\) and \(X\).
Construction of Bijective map : Let \(\eta\in [\mathcal{C}^{\rm{op}},\rm{Set}](H_A,X)\) i.e., \(\eta:H_A\rightarrow X\) is a natural transformation. We want to assign an element in \(X(A)\) with this \(\eta\). It is only natural to consider the map \(\eta(A):H_A(A)\rightarrow X(A)\). The set \(H_A(A)\) has a special element namely \(1_A\in H_A(A)\), its image \(\eta(A)(1_A)\in X(A)\). Define \(\Phi(\eta)=\eta(A)(1_A)\). This give a map
We have
.
So,
Thus, \(\Phi:[\mathcal{C}^{\rm{op}},\rm{Set}](H_A,X)\rightarrow X(A)\) is injective.
So, we have bijective correspondence
Bijection is natural in \(A\) : We prove that the above bijection is natural in \(A\) i.e., given \(A,B\in \mathcal{C}\) with \(f:B\rightarrow A\) the following diagram is commutative
where, for \(\eta\in [\mathcal{C}^{\rm{op}},\rm{Set}](H_A,X)\), \(\varphi(f)\) sends \(\eta\) to the composition \(\eta\circ f^*: H_B\xrightarrow{f^*} H_A\xrightarrow{\eta} X\).
For \(\eta\in [\mathcal{C}^{\rm{op}},\rm{Set}](H_A,X)\) we have \(\varphi(f)(\eta) :H_B\rightarrow X\). Let \(C\in \mathcal{C}\) then, we have
We now prove that
We have
The following commutative diagram
says that \(X(f)(\eta(A)(1_A))=\eta(B)(H_A(f)(1_A))\). As \(H_A(f)(1_A)=f\), we have
Now,
We have defined \(\varphi(f)\) as \(\varphi(f)(\eta)(C)(g)=\eta(C)(f\circ g)\).
So,
So, we see that
So, the bijection \(\Phi:[\mathcal{C}^{\rm{op}},\rm{Set}](H_A,X)\rightarrow X(A)\) is natural in \(A\).
Bijection is natural in \(X\) : We prove that the above bijection is natural in \(X\) i.e., for functors \(X,Y:\mathcal{C}^{\rm{op}}\rightarrow \rm{Set}\) and a natural transformation \(\tilde{\eta}:X\rightarrow Y\) we prove that the following diagram is commutative
Let \(\eta:H_A\rightarrow X\) be a natural transformation. Then, \(\varphi(\eta)=\tilde{\eta}\circ \eta:H_A\rightarrow Y\).
We have
So,
So, the bijection \(\Phi:[\mathcal{C}^{\rm{op}},\rm{Set}](H_A,X)\rightarrow X(A)\) is natural in \(X\).
Special case:
We have seen that \(\Phi:[\mathcal{C}^{\rm{op}},\rm{Set}](H_A,X)\rightarrow X(A)\) is natural in \(A\) and \(X\). Let \(X=H_B\) for some \(B\in \mathcal{C}\) then, we have \(\Phi:[\mathcal{C}^{\rm{op}},\rm{Set}](H_A,H_B)\rightarrow H_B(A)=\mathcal{C}(A,B)\). So, let \(\mathcal{D}\) denote the category \([\mathcal{C}^{\rm{op}},\rm{Set}]\). Then,
Here \(\mathcal{C}(A,B)\) denotes the collection of morphisms and \(\mathcal{D}(H_A,H_B)\) denotes the collection of all natural transformations.
We have
Covariant version of Yoneda lemma : Let \(\mathcal{C}\) be a (locally) small category. Then
naturally in \(A\in \mathcal{C}\) and \(X\in [\mathcal{C},\rm{Set}]\), where \(H^A:\mathcal{C}\rightarrow \rm{Set}\) is given by \(B\mapsto \mathcal{C}(A,B)\).
As a special case when \(X=H^B\) for some \(B\in \mathcal{C}\) we have
Here \(\mathcal{C}(B,A)\) denotes the collection of morphisms and \(\mathcal{D}(H^A,H^B)\) denotes the collection of all natural transformations. We have 
- \(\mathcal{C}\) is a category mentioned in the lemma, \(\mathcal{C}^{\rm{op}}\) is the opposite category associated to \(\mathcal{C}\).
- \(\rm{Set}\) is the category with elements as sets and morphisms as functions.
- \(X:\mathcal{C}^{op}\rightarrow \rm{Set}\) is a functor.
- Given \(A\in \mathcal{C}\), \(H_A\) is the functor \(H_A:\mathcal{C}^{\rm{op}}\rightarrow \rm{Set}\) given by $B\mapsto \mathcal{C}(B,A)$.
- \([\mathcal{C}^{\rm{op}},\rm{Set}]\) is the category with functors from \(\mathcal{C}^{\rm{op}}\) to $\rm{Set}$ as elements and natural transformations between these functors as morphisms.
- \([\mathcal{C},\rm{Set}]\) is the category with functors from \(\mathcal{C}\) to \(rm{Set}\) as elements and natural transformations between these functors as morphisms.
Now that we have defined terminology used in the statement, we will now prove the statement. We will first give a bijection\(\Phi:[\mathcal{C}^{\rm{op}},\rm{Set}](H_A,X)\rightarrow X(A)\).
We will now prove that this map is injective and surjective. Surjectivity of \(\Phi\) : Let \(a\in X(A)\). We want to assign a natural trasformation \(\eta:H_A\rightarrow X\) with this \(a\) such that \(\Phi(\eta)=a\). We need to define \(\eta(B):H_A(B)\rightarrow X(B)\) for each \(B\in \rm{Ob}(\mathcal{C})\). Let \(B\in \rm{Ob}(\mathcal{C})\) be fixed and \(f\in H_A(B)\) i.e., \(f:B\rightarrow A\). The functor \(X:\mathcal{C}^{\rm{op}}\rightarrow \text{Set}\) induces \(X(f):X(A)\rightarrow X(B)\). We have \(X(f)(a)\in X(B)\). Define \(\eta(B)(f)=X(f)(a)\). This gives a natural transformation \(\eta:H_A\rightarrow X\) and\(\eta(A)(1_A)=X(1_A)(a)=1_{X(A)}(a)=a\).
So, \(\Phi:[\mathcal{C}^{\rm{op}},\rm{Set}](H_A,X)\rightarrow X(A)\) is surjective.
Injectivity of \(\Phi\) : Suppose \(\eta_1,\eta_2\in [\mathcal{C}^{\rm{op}},\rm{Set}](H_A,X)\) be such that \(\Phi(\eta_1)=\Phi(\eta_2)\) i.e., \(\eta_1(A)(1_A)=\eta_2(A)(1_A)\). We prove that $\eta_1=\eta_2$ i.e., \(\eta_1(B)=\eta_2(B)\) for every \(B\in \mathcal{C}\) i.e., \(\eta_1(B)(f)=\eta_2(B)(f)\) for every \(f\in H_A(B)\).
Fix \(B\in \mathcal{C}\) and \(f\in H_A(B)\) i.e., \(f:B\rightarrow A\) in \(\mathcal{C}\). We then have following commutative diagrams
We have
.
So,
where, for \(\eta\in [\mathcal{C}^{\rm{op}},\rm{Set}](H_A,X)\), \(\varphi(f)\) sends \(\eta\) to the composition \(\eta\circ f^*: H_B\xrightarrow{f^*} H_A\xrightarrow{\eta} X\).
For \(\eta\in [\mathcal{C}^{\rm{op}},\rm{Set}](H_A,X)\) we have \(\varphi(f)(\eta) :H_B\rightarrow X\). Let \(C\in \mathcal{C}\) then, we have
says that \(X(f)(\eta(A)(1_A))=\eta(B)(H_A(f)(1_A))\). As \(H_A(f)(1_A)=f\), we have
Let \(\eta:H_A\rightarrow X\) be a natural transformation. Then, \(\varphi(\eta)=\tilde{\eta}\circ \eta:H_A\rightarrow Y\).
We have
So,