# How does $h_C(f) : h_C(X) \to h_C(Y)$ an isomorphism imply $f$ is (Yoneda Lemma)?

This is from Categories & Sheaves by Kashiwara & Schapira.

Let $C$ be a category, $f : X \to Y$ a morphism in $C$. Assume that for each $W \in C$, the morphism $\text{Hom}_C(W, X) \xrightarrow{f\circ} \text{Hom}_C(W, Y)$ is an isomorphism. Then $f$ is an isomorphism.

Proof. By hypothesis, $h_C(f): h_C(X) \to h_C(Y)$ is an isomorphism. Hence the result follows from Corollary 1.4.4. to the Yoneda Lemma.

Corollary 1.4.4. The functor $h_C$ is fully faithful.

Proof. For $X$ and $Y$ in $C$ we have $\text{Hom}_{C^{\wedge}}(h_C(X), h_C(Y)) \simeq h_C(Y)(X) = \text{Hom}_C(X, Y)$.

Reason I'm confused: how can we say that $f$ is an isomorphism if the Yoneda Lemma says that the hom-set $\text{Hom}_{C^{\wedge}}(h_C(X), A) \simeq A(X)$ i.e. there is a bijection of sets. I'm not sure how you can deduce from this that $f$ is an isomorphism.

Suppose $F:C\to D$ is any fully faithful functor and $f:X\to Y$ is such that $F(f)$ is an isomorphism. Let $g:F(Y)\to F(X)$ be the inverse of $F(f)$. Since $F$ is full, there is a map $h:Y\to X$ such that $g=F(h)$. Then $F(fh)=F(f)g=1_{F(Y)}$ and $F(hf)=gF(f)=1_{F(X)}$. Since $F$ is faithful, this implies $fh=1_Y$ and $hf=1_X$. Thus $f$ and $h$ are inverses and $f$ is an isomorphism.
Note that it's a corollary of Yoneda that every natural transformation between two representable functors is given by composition with a morphism. Hence the inverse of $f\circ -:h_C(X)\to h_C(Y)$ is of the form $g\circ -:h_C(Y)\to h_C(X)$ for some $g$.
Because these transformations are isomorphisms, this means $f\circ g\circ id_Y=id_Y$, and $g\circ f\circ id_X=id_X$. But this is exactly the statement that $f$ is an isomorphism.