I've been given a very simple motivating and instructive show case for the Yoneda lemma:

Given the category of graphs and a graph object $G$, seen as a quadruple $(V_G,\ E_G,\ S_G:E\rightarrow V,\ T_G:E \rightarrow V)$.

Consider $K_1$ and $K_2$, the one-vertex and the one-edge graph and the two morphisms $\sigma$ and $\tau$ from $K_1$ to $K_2$.

Now consider the graph $H$ with

- $V_H = Hom(K_1,G)$
- $E_H = Hom(K_2,G)$
- $S_H(e) = e \circ \sigma: K_1 \rightarrow G$ for $e \in E_H$
- $T_H(e) = e \circ \tau: K_1 \rightarrow G$ for $e \in E_H$

It can be easily seen that $H$ is isomorphic to $G$.

I have learned that a) the category of graphs is a presheaf category and that b) $K_1$, $K_2$ are precisely the representable functors.

Now I am looking for other simple motivating and instructive show cases.

By the way: Shouldn't such an show case be added to the Wikipedia entry on Yoneda's lemma?

therepresentable functors? $\endgroup$meof the usefulness of Yoneda's lemma is the theory of affine group schemes (a.k.a. affine algebraic groups) -- essentially, Yoneda's lemma shows that studying an affine group scheme (roughly speaking, studying the independent-of-$A$ properties in things like $\mathrm{GL}_n(A)$, $\mathrm{O}_n(A)$ etc. for all $k$-algebras $A$, where $k$ is a fixed field) is equivalent to studying its coordinate Hopf algebra (which is a single object per affine group per $k$). This is, obviously, close to the functional-programming examples, with functoriality replacing polymorphy. $\endgroup$