Solution (source code)

= Solution

For a <categorical presheaf> $X:\mathcal C^{\mathrm{op}}\to\mathbf{Set}$ and $A\in\mathcal C$, the <Yoneda lemma> gives a <natural bijection>
$$
\operatorname{Nat}(\mathcal C(-,A),X)\cong X(A),\qquad \theta\longmapsto\theta_A(1_A).
$$
To construct its inverse, take $x\in X(A)$ and <set> $\theta^x_U(h)=X(h)x$ for $h:U\to A$. For $k:V\to U$, the <functor> law gives $X(k)\theta^x_U(h)=X(hk)x=\theta^x_V(hk)$, so $\theta^x$ is a <natural transformation>. Conversely, <naturality> of any $\theta$ at $h:U\to A$ gives $\theta_U(h)=X(h)\theta_A(1_A)$. Thus the two constructions are inverse, proving the <bijection>.

The <bijection> is natural in $X$: a <natural transformation> $t:X\to Y$ sends the distinguished element $x$ to $t_A(x)$ on either side. It is natural in $A$: for $f:A\to B$, precomposing a transformation $\mathcal C(-,B)\to X$ with postcomposition by $f$ sends its distinguished element $x\in X(B)$ to $X(f)x$. These equations prove the claimed <naturality>, rather than just an objectwise correspondence. Reversing <morphisms> gives the covariant form $\operatorname{Nat}(\mathcal C(A,-),Z)\cong Z(A)$ for $Z:\mathcal C\to\mathbf{Set}$.