Help understand Yoneda's lemma

Given each element $a\in F(X)$, we want to define a the natural transformation $\eta: Hom_\mathcal{C}(X,-) \rightarrow F$. Now for each object $Y$ in $\mathcal C$, we will define the component of the natural transformation \begin{align*} \eta_Y : Hom(X,Y) &\rightarrow F(Y)\\ f &\mapsto F(f)(a) \end{align*} First, observe the special case that $\eta_X(id_X) = F(id_X)(a) = a$. We see that this is indeed a natural transformation, for any morphism $i: M\rightarrow N$ in $\mathcal C$, we have \begin{align*} \eta_N \circ Hom_\mathcal{C} (X, f) (g) = &\eta_N ((Hom_\mathcal{C}(X,f)(g))\\ = &\eta_N (f\circ g) = F(f\circ g) (a) = F(f)\circ F(g) (a)\\ =& F(f)( F(g) (a)) = F(f)(\eta_N(g)) = F(f) \circ \eta_N(g) \end{align*}

Suppose there exists another natural transformation $\tau$ such that $\tau_X(id_X) = a$, then using the property of natural transformation, we have $$\tau_Y(f) = \tau_Y(f\circ id_X) = (\tau_Y\circ Hom_\mathcal{C}(X,f))(id_X) = (F(f) \circ \tau_X)(id_X) = F(f)(a) = \eta_Y(f).$$

I think I understood this proof. Below is the proof for contravarient functor $F$, and I am not sure what I wrote this is correct.

Given each element $a\in F(X)$, we want to define a the natural transformation $\eta: Hom_\mathcal{C}(,X) \rightarrow F$. Now for each object $Y$ in $\mathcal C$, we will define the component of the natural transformation \begin{align*} \eta_Y : Hom(Y,X) &\rightarrow F(Y)\\ f &\mapsto F(f)(a) \end{align*} First, observe the special case that $\eta_X(id_X) = F(id_X)(a) = a$. We see that this is indeed a natural transformation, for any morphism $i: M\rightarrow N$ in $\mathcal C$, we have \begin{align*} \eta_N \circ Hom_\mathcal{C} (f, X) (g) = &\eta_N ((Hom_\mathcal{C}(f,X)(g))\\ = &\eta_N (g\circ f) = F(g\circ f) (a) = F(f)\circ F(g) (a)\\ =& F(f)( F(g) (a)) = F(f)(\eta_N(g)) = F(f) \circ \eta_N(g) \end{align*}

Suppose there exists another natural transformation $\tau$ such that $\tau_X(id_X) = a$, then using the property of natural transformation, we have $$\tau_Y(f) = \tau_Y(id_X\circ f) = (\tau_Y\circ Hom_\mathcal{C}(f,X))(id_X) = (F(f) \circ \tau_X)(id_X) = F(f)(a) = \eta_Y(f).$$

• I'm not sure what distinction you're trying to make between the set $\hom(X,Y)$ and the value of the functor $\hom(X, -)$ at $Y$; they're the same thing. ($\hom_\mathcal{C}$ means the same thing as $\hom$; it just makes the category explicit in the notation; if you really need that explicit, the functor should be written $\hom_\mathcal{C}(X, -)$) – Hurkyl Jan 24 '17 at 12:36
• Also, the quoted statement is misstated? Or at least awkwardly stated. The correct statement is that the expression $\operatorname{Nat}(\hom(X, -), F)$ defines a functor in the variable $X$, and is of type $\mathcal{C} \to \mathbf{Set}$; the aim is to prove a natural isomorphism between that functor and $F$ -- that is, a bijection $\operatorname{Nat}(\hom(X, -), F) \cong F(X)$ that is natural in $X$. – Hurkyl Jan 24 '17 at 14:17
• Incidentally, you should get out of the habit of reading "isomorphism" and thinking "injective and surjective" -- in a great many situations (such as this one, IMO) it's easier to prove something is an isomorphism directly via writing down the inverse. And also, in many categories, there exist morphisms that are both monic and epic but are not isomorphic. – Hurkyl Jan 24 '17 at 14:57
• @Hurkyl Thank you for the reply, so if we pick $f\in hom_\mathcal{C}(X,Y) \in SET$ as an element of an object in $SET$, we can still use $f$ as an actual morphism between $X, Y$ in $\mathcal{C}$ correct? – Xiao Jan 24 '17 at 17:08
• Yes. $\hom(X,Y)$ is usually thought of as being literally the set of morphisms from $X$ to $Y$, so each of its elements is an actual morphism from $X$ to $Y$. Or even if you want to relax that, there is still a bijective correspondence between the two notions. Think of this as being the essential flavor of what "locally small" means. – Hurkyl Jan 26 '17 at 13:09