The Yoneda Lemma is a simple result of category theory, and its proof is very straightforward.

Yet I feel like I do not truly understand what it is about; I have seen a few comments here mentioning how it has deeper implications into how to think about representable functors.

What are some examples of this? How should one think of the Yoneda Lemma?

  • 3
    $\begingroup$ Representables are projective? $\endgroup$ – Fernando Muro Feb 4 '14 at 21:39
  • 2
    $\begingroup$ @FernandoMuro — Excuse me, but what do you mean with that comment? $\endgroup$ – jmc Feb 5 '14 at 8:06
  • 6
    $\begingroup$ @jmc I mean that Yoneda's lemma can be interpreted as saying that representables in the functor category are projective objects. I like this interpretation! $\endgroup$ – Fernando Muro Feb 5 '14 at 8:12
  • 2
    $\begingroup$ @FernandoMuro — I see! Thanks; I didn't know that yet. I would however like to see (in an answer?) why you think it is the “philosophical” meaning of the Yoneda lemma. $\endgroup$ – jmc Feb 5 '14 at 8:28

11 Answers 11


One way to look at it is this:

for $C$ a category, one wants to look at presheaves on $C$ as being "generalized objects modeled on $C$" in the sense that these are objects that have a sensible rule for how to map objects of $C$ into them. You can "probe" them by test objects in $C$.

For that interpretation to be consistent, it must be true that some $X$ in $C$ regarded as just an object of $C$ or regarded as a generalized object is the same thing. Otherwise it is inconsistent to say that presheaves on $C$ are generalized objects on $C$.

The Yoneda lemma ensures precisely that this is the case.

I wrote up a more detailed expository version of this story at motvation for sheaves, cohomology and higher stacks.

  • 22
    $\begingroup$ More specifically, the category of presheaves on C is the free cocomplete category on C. This fact is probably about as fundamental as Yoneda's lemma. So the Yoneda lemma is a kind of categorification of the fact that the map from a set to the free commutative monoid on that set is an injection. $\endgroup$ – Reid Barton Oct 29 '09 at 2:08
  • 4
    $\begingroup$ Good point. By the way, a gentle introduction by John Baez on what "free cocompletion" means is here: ncatlab.org/nlab/show/free+cocompletion $\endgroup$ – Urs Schreiber Oct 29 '09 at 2:14
  • 1
    $\begingroup$ So, for example (if I understand what you're getting at), sometimes you want to add "Pro-objects" and "Ind-objects" to your favorite category C which lacks limits over (co-)filtered systems, and you can do this by identifying C with its image under the Yoneda embedding (which implicitly uses Yoneda's Lemma). $\endgroup$ – John Goodrick Feb 13 '10 at 20:50
  • 3
    $\begingroup$ @Hans, the precise statement that you are looking for is simply the Yoneda lemma. Those words are meant to highlight its "philosophical meaning", as requested. Those "objects modeled on C" are precisely presheaves on C. Their "set of probes" by some X in C is the value of the presheaf on X. Plenty of further technical details are linked to at ncatlab.org/nlab/show/… $\endgroup$ – Urs Schreiber Feb 16 '12 at 10:29
  • 2
    $\begingroup$ @HansStricker: The nLab article on "Space and Quantity" (ncatlab.org/nlab/show/space+and+quantity) is my favorite exposition of these ideas. The "Details" section talks a little about the role of the Yoneda lemma. $\endgroup$ – Vectornaut Feb 10 '13 at 21:45

In his Algebraic Geometry class a few years back, Ravi Vakil explained Yoneda's lemma like this: You work at a particle accelerator. You want to understand some particle. All you can do are throw other particles at it and see what happens. If you understand how your mystery particle responds to all possible test particles at all possible test energies, then you know everything there is to know about your mystery particle.

  • 99
    $\begingroup$ To me, this is a beautiful explanation of particle physics in the familiar terms of Yoneda's lemma! $\endgroup$ – Thanos D. Papaïoannou Oct 29 '09 at 9:31
  • 3
    $\begingroup$ It is, indeed, to some extent also good explanation of some string theoretic thinking is suggesting: that whatever space is, you find out by testing it by throwing worldsheets of strings into it. One can make this Yoneda-way of thinking about string theory sigma-models pretty precise in cases. One rarely sees string theorists talk this way, of course. One exception is Eric Sharpe, who promoted that point of view here: golem.ph.utexas.edu/string/archives/000677.html $\endgroup$ – Urs Schreiber Oct 29 '09 at 9:53
  • 20
    $\begingroup$ A lower-level manifestation of the same idea: a locally integrable function on an open domain is determined by the knowledge of the values of the integrals against test functions. $\endgroup$ – Gian Maria Dall'Ara Nov 1 '09 at 15:51
  • 2
    $\begingroup$ I think this is a good idea, but in fact the Yoneda lemma says just the opposite, doesn't it? It allows you to identify your particle A with hom(A,_) . So what you are seeing are not the particles that "hit" your particle A, but what A "hits". Am I wrong? $\endgroup$ – Agustí Roig Feb 13 '10 at 18:41
  • 7
    $\begingroup$ @Agusti: There are, of course, two Yoneda lemmas. One says you can recover A from hom(A,-) and the other says you can recover it from hom(-,A). The latter is covariant in A, so makes a better statement. But, yes, from the hom(A,-) perspective, I'd say "you can know your particle by looking at its emissions". $\endgroup$ – Theo Johnson-Freyd Feb 14 '10 at 18:16

Lazily, I'll just point to some notes on this question: What's the Yoneda Lemma all about?

  • $\begingroup$ Could you explain the last statement on page 8? (Any functor C^op \mapsto Set can be built out of representables Hom(-,A) in very roughly the same way that any number is built as a product of primes). Should I make it a separate question? $\endgroup$ – Max M Nov 2 '09 at 1:34
  • 4
    $\begingroup$ This refers to the "co-Yoneda lemma", which says that every presheaf is a colimit of representable presheaves: ncatlab.org/nlab/show/co-Yoneda+lemma $\endgroup$ – Urs Schreiber Nov 17 '09 at 17:04
  • $\begingroup$ Max M, sorry, I only just saw your question. Urs is right: I was referring to the fact that every presheaf is a colimit, in a canonical way, of representable presheaves. I'd call it that the 'Density formula'. Another reference is Theorem 5.1.16 of these notes: maths.gla.ac.uk/~tl/msci . Don't take the analogy with prime factorization too seriously. $\endgroup$ – Tom Leinster Nov 18 '09 at 1:26
  • $\begingroup$ @Tom: Do you know some applications of Yoneda lemma to combinatorics? $\endgroup$ – Yannic Apr 19 '12 at 7:16
  • $\begingroup$ Not off the top of my head. The only thing I can think of is that Joyal's theory of species is a categorical approach to enumerative combinatorics, and is almost certain to involve the Yoneda lemma in its development. $\endgroup$ – Tom Leinster Apr 19 '12 at 13:45

If you have basic experience with abstract algebra, the ideas in the Yoneda lemma should be quite familiar and even intuitive; the apparent difficulty is only in recognizing them in this new presentation.

You can think of "category" as meaning the same thing as "algebraic theory in a multisorted language with only unary functions"—the objects of the category being the sorts of the language, the morphisms being the definable functions, and the equalities between (composites of) morphisms being the laws of the theory. From this perspective, a functor from $C$ to $\mathrm{Set}$ is simply a model of the theory corresponding to $C$, and natural transformations of such functors are homomorphisms of models. The Yoneda lemma then is about free models. Specifically, it says that for every sort $s$, the "term model" of terms with a single variable, of sort $s$ (equivalently definable functions with domain $s$) is the free model on a single generator of sort $s$. It may be unfamiliar when expressed as "$\mathrm{Nat}(\mathrm{Hom}(s, {-}), M) \cong M(s)$ naturally in $M$", but that is indeed all this categorical expression is saying

The so-called co-Yoneda lemma mentioned in the other comments also has a nice interpretation from this perspective, amounting to the demonstration that every model can be specified by generators and relations.

I wouldn't say this is The One Right Way to think about the Yoneda lemma, because it's useful to view it from many different perspectives, but this is certainly One Right Way to think about the Yoneda lemma.

  • 3
    $\begingroup$ Neat! And under this analogy, representable functors (with representing object s) are just models that are freely generated by a single element (of sort s). To me, at least, this clears things up a lot. $\endgroup$ – John Goodrick Feb 13 '10 at 20:55
  • 1
    $\begingroup$ This algebraic perspective is articulated in Vaugh Pratt's The Yoneda Lemma without Category Theory. $\endgroup$ – Derek Elkins left SE Feb 6 '16 at 3:29

Barr and Wells (Toposes, Triples, and Theories, 84) talks about arrows as a general kind of elements. In $\mathbf{Set}$, arrows from $\{\ast\}\to A$ are the usual elements of $A$, and arrows from bigger sets $X\to A$ are the $X$-elements of $A$, or elements of $A$ parameterised in $X$. Of course the latter makes sense in any category, so we can use this language the state the Yoneda lemma as:

The $\mathsf{Hom}(-,A)$-elements of $F$ are just the usual elements of $FA$.

I find this to be, at least, a useful mnemonic, but also justifies the intuition that an object "is" its collection of probes.

  • 2
    $\begingroup$ Nice interpretation! $\endgroup$ – Martin Brandenburg Feb 18 '11 at 19:05
  • $\begingroup$ This interpretation is very close to what Leinster proposes in his book Basic Category Theory. $\endgroup$ – user 170039 Oct 2 '19 at 5:50

When explaining the Yoneda lemma, I always like to use the Dutch saying

Tell me who your friends are, and I will tell you who you are.

I think this is a pretty good approximation of the “philosophical” meaning of the Yoneda lemma. A more precise statement would be “tell me how you relate to everything else, and I will tell you who you are (up to unique isomorphism)”.

This is really close to the particle accelerator analogy mentioned by Theo Johnson-Freyd (https://mathoverflow.net/a/3223/21815). Nevertheless, I just wanted to share the slogan.

Edit: I just realised that I did not actually mention any motivation for the slogan. Here it is.

The whole point of the Yoneda lemma is that an object $x$ in a category $C$ is fully determined by the functor $\textrm{Hom}(\_, x)$. [Equivalently and dually, one can also take $\textrm{Hom}(x, \_)$.] This is useful in a lot of different settings. For example in algebraic geometry it often happens that one has a particularly easy description of $\textrm{Hom}(\_, x)$, while describing $x$ directly may be a lot harder [e.g., when $x$ is a group scheme].

Obviously, the slogan means to interpret $\textrm{Hom}(y,x)$ as how $y$ relates to $x$. And if you tell me $\textrm{Hom}(y,x)$ for all $y$ [in a functorial manner!] then I can tell you what $x$ is. Hence: “tell me who your friends are, and I will tell you who you are.”


A good and frequent use of the Yoneda lemma is internalization: If e.g. I have monoid valued representable contravariant functor Hom(-,A):C-->Set, then the representing object A must be a monoid object in C. This is because the structure morphism Hom(-,A)xHom(-,A)=Hom(-,AxA)-->Hom(-,A) is a natural transformation and thus, by Yoneda comes from a morphism AxA-->A inside C, same for the other structure morphisms and the commuting diagrams.

The same goes through for other algebraic (or limit) structures and also for covariant Hom-functors which, if they are algebra-valued are represented by an coalgebra-object. An excellent example for the latter is the fact that affine algebraic groups are represented by Hopf algebras.


If you don't mind thinking of category theory in terms of functional programming there is an interpretation here. Fix a type A and a functor F. If you have a machine that can give you back an object of type FB every time you give it a function of type A->B, can you reverse engineer fully what the machine is doing? Essentially the machine must contain an element of FA and you can recover that FA from how it responds to your functions. This is very similar to Theo's physical perspective.


Another way to think about the Yoneda lemma is in terms of universal things. Consider, for instance, the existence of classifying spaces for bundles. The statement is that for any suitable group G, there is a space BG such that for any nice enough space X, homotopy classes of maps X → BG are in natural bijection with isomorphism classes of G-structured bundles over X. In categorical terms, that means there is a natural isomorphism between the functors

X ↦ {G-structured bundles over X}


X ↦ [X,BG]

The Yoneda lemma implies that this natural isomorphism is uniquely determined by a specific G-structured bundle over BG. That is, the existence of a "classifying space" BG with the above property implies the existence of a universal bundle EG → BG such that every bundle over any space X is the pullback of the universal one along a map X → BG, unique up to homotopy.

The search for representing objects, and hence for universal data, lies at the heart of a lot of modern algebraic topology, algebraic geometry, and even category theory.

  • $\begingroup$ Why do you say "G-structured bundle" instead of G-principal bundle? $\endgroup$ – Urs Schreiber Oct 29 '09 at 7:39
  • 1
    $\begingroup$ It could be a vector bundle with transition functions in G. $\endgroup$ – Mike Shulman Oct 30 '09 at 0:42

Here is an example on representable functors. Yoneda's lemma gives down-to-earth, morpshim oriented interpretation of representable functors, and vice versa.

I will explain this with an example.

In a category $\mathscr{C}$, the product of $A$ and $B$ is the pair of object $A\times B$ in $\mathscr{C}$ and a fixed natural isomorphism $$ \sigma \colon \mathrm{Hom}(-,A\times B)\to \mathrm{Hom}(-,A)\times \mathrm{Hom}(-,B). $$

This definition of products only uses terminology of functors. By applying Yoneda's lemma, we arrive at a morphism oriented definiton of products. Yoneda's lemma says that there is a bijection $$ \Psi \colon \mathrm{Hom}\left( \mathrm{Hom}(-,A\times B),\mathrm{Hom}(-,A)\times \mathrm{Hom}(-,B)\right) \to \mathrm{Hom}(A\times B,A)\times \mathrm{Hom}(A\times B,B). $$ In particular, we apply this to $\sigma$ and denote $$ \Psi(\sigma)=\sigma(A\times B)(\mathrm{id}_{A\times B})=(\pi^{A}\colon A\times B\to A,\pi^{B}\colon A\times B\to B). $$ Next, by applying the inverse of $\Psi$, we compute $$ \sigma(X)=\Psi^{-1}\left( \Psi(\sigma)\right)(X):\mathrm{Hom}(X,A\times B)\to \mathrm{Hom}(X,A)\times \mathrm{Hom}(X,B) $$ $$ f\colon X\to A\times B\mapsto (\pi^{A}\circ f,\pi^{B}\circ f). $$ Since $\sigma$ is a natural isomorphism, $\sigma(X)$ is a bijection. This bijectivity is the usual definition of product based on morphisms (universality):

For any pair of morphisms $f^{A}\colon X\to A$ and $f^{B}\colon X\to B$, there exists a unique morphism $f\colon X\to A\times B$ with $\pi^{A}\circ f=f^{A}$ and $\pi^{B}\circ f=f^{B}$.

I think the Philosophy behind Yoneda's lemma is that, it connects the world of functors (and natural transformations) $\mathfrak{Set}^{\mathscr{C}^{\mathrm{op}}}$ and the world of morphisms $\mathscr{C}$.


You might also want to think about the Yoneda Lemma as a statement about functors.

A locally small category $\mathcal{C}$ is embedded by the $\mathrm{hom}$ functor in the category $\mathrm{Hom}(\mathcal{C}^{\mathrm{op}},\mathrm{set})$. This is called the Yoneda embedding. Thus, the $\mathrm{hom}$ functor is fully faithful (this itself is a corollary of the Yoneda lemma), but is not an equivalence of categories, because it isn't essentially surjective. In other words, not every functor $F$ from $\mathcal{C}^{\mathrm{op}}$ to $\mathrm{set}$ is representable- for example, the empty functor which maps each object in $\mathcal{C}$ to the empty set, is never representable. The problem is that the Yoneda embedding does not commute with colimits. But the Yoneda lemma tells you that every functor $F\in \mathrm{Hom}(\mathcal{C}^{\mathrm{op}},\mathrm{set})$ becomes representable when extended appropriately. In other words, every functor $F$ from $\mathcal{C}^{\mathrm{op}}$ to $\mathrm{set}$ extends to a functor from $\left(\mathrm{Hom}(\mathcal{C}^{\mathrm{op}},\mathrm{set})\right)^{\mathrm{op}}$ to $\mathrm{set}$ (this is a special case of the Yoneda extension) which does commute with colimits, and is representable.

So one ``philosophical interpretation'' of the Yoneda lemma is the following:

Every functor $F$ from $\mathcal{C}^{\mathrm{op}}$ to $\mathrm{set}$ can be extended to a representable functor from $\left(\mathrm{Hom}(\mathcal{C}^{\mathrm{op}},\mathrm{set})\right)^{\mathrm{op}}$ to $\mathrm{set}$.

One reference for this point of view is these notes by Akhil Mathew.

  • 1
    $\begingroup$ Not only is it not essentially surjective in general, it's never essentially surjective, because the functor $C^{op} \to Set$ that is constantly empty cannot be isomorphic to a representable. (I must confess: I don't understand what you are trying to say in your answer.) $\endgroup$ – Todd Trimble Feb 11 '13 at 20:26
  • $\begingroup$ Thank you for your comment. I've used it to clarify and expand this answer- does it make more sense now? $\endgroup$ – Daniel Moskovich Feb 12 '13 at 8:39

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.