Solution (source code)

= Solution

Working with a <small category> $\mathcal C$ (or in a fixed ambient universe), for a <categorical presheaf> $X$ and fixed $U$, apply the <categorical coend> construction to $T(A,B)=\mathcal C(U,B)\times X(A)$. It is the quotient of the <disjoint union> of pairs $(h:U\to W,x\in X(W))$ by the relations
$$
(fh,x)\sim(h,X(f)x)\qquad(f:W\to V,\ x\in X(V)).
$$
Define $\Phi_U([h,x])=X(h)x$. It respects every relation because $X(fh)x=X(h)X(f)x$. Define $\Psi_U(y)=[1_U,y]$. Then $\Phi_U\Psi_U(y)=y$. Conversely the relation with $f=h:U\to W$ gives $[h,x]=[1_U,X(h)x]$, so $\Psi_U\Phi_U$ is the <identity morphism>. Therefore
$$
\boxed{X(U)\cong\int^W\mathcal C(U,W)\times X(W).}
$$
For $k:V\to U$, restriction on the <categorical coend> sends $[h,x]$ to $[hk,x]$, and $\Phi_V([hk,x])=X(k)\Phi_U([h,x])$. A <natural transformation> $X\to Y$ likewise acts on the second coordinate and commutes with $\Phi$. Thus the <density formula for presheaves> is a <natural isomorphism>, not just a family of unrelated <bijections>.