Solution (source code)

= Solution

Use the <covariant Yoneda embedding> $Y(A)=\mathcal C(A,-)$. An arrow $f:B\to A$, viewed as an arrow $A\to B$ in the <opposite category>, induces precomposition $h\mapsto hf$. Identities and composition are preserved because composition in $\mathcal C$ is associative.

The covariant <Yoneda lemma> is the <bijection>
$$
\operatorname{Nat}(\mathcal C(A,-),F)\longrightarrow F(A),\qquad \alpha\longmapsto\alpha_A(1_A).
$$
Its inverse sends $x\in F(A)$ to $\alpha_B(h)=F(h)(x)$. This is a <natural transformation>: for $k:B\to C$, functoriality gives $F(k)\alpha_B(h)=F(kh)(x)=\alpha_C(kh)$. Conversely, naturality of an arbitrary $\alpha$ at $h:A\to B$ gives $\alpha_B(h)=F(h)\alpha_A(1_A)$. Evaluation at the <identity morphism> therefore makes the two constructions inverse. Their formulas also prove naturality in $F$ and, contravariantly, in $A$.

Taking $F=Y(B)$ identifies <natural transformations> $Y(A)\to Y(B)$ with $\mathcal C(B,A)$. Thus $Y$ is <full and faithful>, and reflects <isomorphisms>; two image objects are isomorphic exactly when the original objects are isomorphic. It also carries existing <colimits> in $\mathcal C$ to <categorical limits> of covariant <representable functors>: maps out of a colimit are exactly compatible families of maps out of its diagram. Equivalently, this embedding preserves existing <categorical limits> in $\mathcal C^{\mathrm{op}}$. The direction matters: the paper uses covariant representables, rather than the more usual contravariant <Yoneda embedding>.