Yoneda lemma : Let \(\mathcal{C}\) be a (locally) small category. Then ql_5d7a52d15b0bc85c34de3666351c92e9_l3 naturally in \(A\in \mathcal{C}\) and \(X\in [\mathcal{C}^{\rm{op}},\rm{Set}]\). Terminology :
  1.  \(\mathcal{C}\) is a category mentioned in the lemma, \(\mathcal{C}^{\rm{op}}\) is the opposite category associated to \(\mathcal{C}\).
  2.  \(\rm{Set}\) is the category with elements as sets and morphisms as functions.
  3.  \(X:\mathcal{C}^{op}\rightarrow \rm{Set}\) is a functor.
  4.  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)$.
  5.  \([\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.
  6.  \([\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.
Given \(X,A\) as above, \(X(A)\) is a set and \([\mathcal{C}^{\rm{op}},\rm{Set}](H_A,X)\) is a set. Yoneda lemma says that there is a bijection between these sets, natural bijection in both \(A\) and \(X\). Natural transformation : Let \(\mathcal{A},\mathcal{B}\) be two categories and \(F,G:\mathcal{A}\rightarrow \mathcal{B}\) be both contravariant or both covariant functors. A natural transformation \(\eta:F\rightarrow G\) is a family of arrows (morphisms) \(F(A)\xrightarrow{\eta(A)}G(A)\) such that for each \(A\xrightarrow{f}A'\) in \(\mathcal{A}\) the following appropriate diagram commutes.ql_f5f1b45cf5b9428b42e7bcfd77134d7e_l3 Now that we have defined terminology used in the statement, we will now prove the statement. We will first give a bijectionql_d75b467242e412c976d496142aba4b20_l3and 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

\(\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 diagramsql_9ae4d01e872f982000796aef89e2f7d6_l3 We haveql_8dd72c9387c05456c8f6a94ef4bb8635_l3. So,ql_c0e33f46172dff406d44cfb73daa5e8d_l3 Thus, \(\Phi:[\mathcal{C}^{\rm{op}},\rm{Set}](H_A,X)\rightarrow X(A)\) is injective. So, we have bijective correspondence ql_d75b467242e412c976d496142aba4b20_l3 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 commutativeql_a7dce34a06e3d903e27c7dd5e3e86312_l3where, 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 ql_060824c44451a3b04c5bcde7d803071f_l3We now prove thatql_9f3bc291ab81ece72b86ee4750e96b4c_l3We haveql_65c2456da3aa09e1f7d87fe4b183e2bf_l3The following commutative diagramql_ec375e8f1d8b7efa8bca8e04d5295373_l3says that \(X(f)(\eta(A)(1_A))=\eta(B)(H_A(f)(1_A))\). As \(H_A(f)(1_A)=f\), we have ql_222e9c46a46aba171941c297dcca115a_l3Now,ql_de696bbc85f9ee2c9f573ae340f0cb1b_l3We have defined \(\varphi(f)\) as \(\varphi(f)(\eta)(C)(g)=\eta(C)(f\circ g)\). So,ql_94511882a111b1d933ae899e9e7ce269_l3So, we see that ql_9f3bc291ab81ece72b86ee4750e96b4c_l3 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 commutativeql_bcc85b77d21e8dcdb72eac4665076b29_l3Let \(\eta:H_A\rightarrow X\) be a natural transformation. Then, \(\varphi(\eta)=\tilde{\eta}\circ \eta:H_A\rightarrow Y\). We haveql_bed391786bb6afe9101e5a5d37298891_l3So,ql_d30809591411d5775371f5f168aa49c1_l3So, 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, ql_f12de94500b30be43dba0d2c9737f724_l3Here \(\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 ql_9ac5cde38934e6cbb301e537dcdc5102_l3 Covariant version of Yoneda lemma : Let \(\mathcal{C}\) be a (locally) small category. Then ql_7164090df8bba9c38b139d6d84672e03_l3naturally 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 ql_3ad4986eed17d2a43225e21114020ad8_l3Here \(\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 ql_2ae1f3dad654c466b7ac1339a0849818_l3