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?

  • 1
    $\begingroup$ Community wiki? $\endgroup$ – Qiaochu Yuan Jan 15 '10 at 12:26
  • 1
    $\begingroup$ Whom do you ask? $\endgroup$ – Hans-Peter Stricker Jan 15 '10 at 12:35
  • 1
    $\begingroup$ As in, "shouldn't you make this community wiki?" Also, I'm not totally sure what you mean by "example." Do you want examples of presheaf categories or examples of "natural" representable functors or what? $\endgroup$ – Qiaochu Yuan Jan 15 '10 at 12:45
  • 1
    $\begingroup$ I mean "show cases" of the fact that the morphisms of an object determine its "inner structure" up to isomorphism. $\endgroup$ – Hans-Peter Stricker Jan 15 '10 at 13:27
  • 2
    $\begingroup$ @HansStricker what do you mean by $K_1$ and $K_2$ are the representable functors? $\endgroup$ – Giorgio Mossa May 21 '14 at 13:25

Determine all natural transformations (mod-$2$ cohomology operations) $H^n(-,\mathbb{Z}/2) \to H^m(-,\mathbb{Z}/2)$: We have $H^n(-,\mathbb{Z}/2) = [-, K(\mathbb{Z}/2,n)]$ by Brown representability. By Yoneda, we get $[K(\mathbb{Z},m), K(\mathbb{Z},n)] = H^n(K(\mathbb{Z}/2,m),\mathbb{Z}/2)$. So the mod-$2$ Steenrod algebra is the cohomology ring of the Eilenberg-MacLane spaces.

  • 5
    $\begingroup$ I know that "simple" is a relative notion and this example may be simple for you, but - alas - it's not for me. $\endgroup$ – Hans-Peter Stricker Jan 15 '10 at 8:20
  • $\begingroup$ You can tell me what you don't understand and we'll help you. $\endgroup$ – TKe Jan 15 '10 at 15:56
  • 4
    $\begingroup$ Even if not simple, this is a very good example. It's one of few examples where Yoneda's lemma allows you to understand something that would be much more difficult to understand without it. The details will be in any book about "Cohomology Operations", for example the one by Mosher and Tanguchi. $\endgroup$ – Ilya Grigoriev Jan 15 '10 at 17:54
  • $\begingroup$ Mosher and Tangora. $\endgroup$ – TKe Sep 5 '16 at 8:48

If you program in a pure functional programming language like Haskell then the Yoneda lemma tells you that for any functor $F$, the types $F a$ and $\forall b . (a \rightarrow b) \rightarrow F b$ are isomorphic. (Restricting attention to computable total functions.) This really is a non-trivial statement and quite surprising when you first see it. Unfortunately it's tricky to explain without some CS backround.

Nonetheless I'll risk failure and try to explain a specific example when $F$ is the 'list' functor, assuming a little computing knowledge:

Fix a type $a$. Suppose you have a (polymorphic) Haskell function $f$ that for any type $b$ maps functions $g\colon a\rightarrow b$ into a list of elements of type $b$. Then $f$ is equal to a function that applies $g$ elementwise to some fixed list of elements of $a$. It's a powerful result. Just knowing the type of the function $f$ is enough to deduce significant detail about what it does. It can reduce the amount of work required to prove the correctness of programs.

The crucial thing that makes this work is that Haskell uses "parametric polymorphism". If you write a function that is polymorphic it's impossible to use specific knowledge about the type, you have to write your function generically to work with all possible types.

  • 3
    $\begingroup$ I would rephrase this in layman's terms as "any function $X\to Y$ is uniquely determined by its pointwise action on elements of $X$, whatever $X$ and $Y$ mean". You know, the basic "a function is a rule which maps each element of $X$ to some element of $Y$". Something that is definitely true in naive set theory but fails miserably in most categories and is problematic in axiomatic set theory. Now the trick is that if you generalize your notion of "element" from a morphism $pt \to X$ to a general $\Gamma \to X$, then the naive definition of function becomes correct - by Yoneda's lemma! $\endgroup$ – Anton Fetisov May 21 '14 at 23:34
  • $\begingroup$ @AntonFetisov That is a brilliant way to motivate Yoneda! Well-done :-) $\endgroup$ – Musa Al-hassy Oct 20 '18 at 23:26

Well, here's a standard example of morphisms determining an object up to isomorphism: if $A$ is a finitely-generated integral $\mathbb{C}$-algebra, then the morphisms $A \to \mathbb{C}$ are precisely the maximal ideals $\text{MaxSpec } A$, which (by the Nullstellensatz) determine $A$ up to isomorphism.

  • $\begingroup$ Is it the case, that (one of) the interesting question(s) is always, WHICH morphisms and compositions do suffice to determine an object upto isomorphism? (And sometimes it's just the sheer number of immediate in- and out-arrows, isn't it?) $\endgroup$ – Hans-Peter Stricker Jan 15 '10 at 16:29
  • 1
    $\begingroup$ It's certainly of interest to determine, in a category, which "test objects" suffice to determine the identity of an object A given Hom(A, T) for each test object T. For certain categories finitely many or even one test object suffices. $\endgroup$ – Qiaochu Yuan Jan 15 '10 at 16:46

One of my favourite facts of this type is that in the category of simplicial sets, maps from the standard $n$-simplex to any simplicial set $S$ correspond to the $n$-simplices of $S$. Obviously this is not a surprising result, but I find it particularly nice that it comes out of Yoneda.

  • $\begingroup$ As far as I understand, it's possible to develop a lot of basic properties of homology from this one fact. In particular, you can prove that baricentric subdivision is chain homotopic to the identity on the one simplex, and this will imply that it doesn't affect homology on any simplicial complex. From this, you can get such facts as equivalence of singular and simplicial homology, homotopy invariance of homology, and I think other things I forgot. The exact details of the argument evade me, though. Does anybody remember it clearly? $\endgroup$ – Ilya Grigoriev Jan 15 '10 at 17:51

Consider the contravariant functor $\mathcal{P}_G(-):Top \longrightarrow Set $ that sends a space $X$ to the set of isomorphism classes of principal $G$-bundles over $X$. Denote by $BG$ the base space of the universal bundle.

A characteristic class can either be seen as
-A natural transformation $ \mathcal{P}_G(-) \longrightarrow H^*(-)$
-An element of $H^*(BG)$.

Indeed, the Yoneda lemma gives a bijection $H^*(BG) \cong Nat([-,BG],H^* (-))$. But by definition of the universal bundle, $[-,BG]$ is equivalent to $\mathcal{P}_G(-)$.


Not so much a showcase maybe but rather a connection to an algebraist's intuition. A particular case of Yoneda is that a monoid $M$ acting on itself (by (say) left multiplication) is a free $M$-set on one generator, $\hom_M(M,X)\approx X$ naturally in $X$.

This can be in fact of course extended to the full Yoneda lemma - viewing set-valued functors on a category $\mathcal C$ as algebras for a multi-sorted equational theory (objects of $\mathcal C$ for sorts, unary operations only), Yoneda lemma becomes the statement that representables are single-generator free algebras.


The most simple (= trivial) example is, that in the category of sets Hom(1,$A$) is isomorphic (= equipollent) to $A$ (with 1 the singleton).

The second-most simple example will probably be in the category of 2-block-partions (sets + 1 unary relation).

The third-most simple example is assumably the one given above (sets + 1 binary relation).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.