Category Theory
The Yoneda Lemma: How Objects Are Known by Their Relationships
The Yoneda Lemma says something that sounds like philosophy but is a precise theorem: an object is completely determined — up to isomorphism — by the totality of maps into (or out of) it. You never need to look inside an object; you only need to know how everything else relates to it. This single fact, proved by Nobuo Yoneda around 1954, is the reason category theorists can say "it suffices to check on representable functors" and get away with it.
Precisely: for a locally small category C, an object c ∈ C, and any functor F: C → Set, there is a bijection Nat(Hom(c, −), F) ≅ F(c), natural in both c and F. The natural transformations out of the "probe" functor Hom(c, −) are in one-to-one correspondence with the mere elements of F(c).
- FieldCategory theory
- Named for / yearNobuo Yoneda, c. 1954 (via Mac Lane)
- StatementNat(Hom(c,−), F) ≅ F(c), natural in c and F
- Key hypothesisC locally small; F: C → Set
- Proof techniqueTrack where id_c goes; explicit inverse bijections
- UnlocksYoneda embedding is full & faithful; universal properties; density
Interactive visualization
Press play, or step through manually. The visualization is yours to drive — try it before reading on.
Watch the 60-second explainer
A condensed visual walkthrough — narrated, captioned, under a minute.
The precise statement
Fix a locally small category C — meaning Hom(x, y) is a genuine set for all objects x, y. For each object c, the assignment x ↦ Hom(c, x) is a functor hᶜ = Hom(c, −): C → Set, sending a morphism g: x → y to post-composition g ∘ (−).
The Yoneda Lemma asserts: for every functor F: C → Set,
- there is a bijection Nat(Hom(c, −), F) ≅ F(c);
- this bijection is natural in c ∈ C and in F ∈ [C, Set].
The left side is a set of natural transformations; the right side is a plain set. The content is that specifying an entire natural transformation α: Hom(c, −) ⇒ F requires no more data than choosing a single element of F(c). The contravariant twin replaces Hom(c, −) by Hom(−, c) and functors C → Set by presheaves Cᵒᵖ → Set.
Intuition: an object is its web of relationships
Think of Hom(c, −) as a universal probe. To understand any structure F, you interrogate it with maps: an element of F(x) is a "generalized point of shape c" once you know how c maps around. The lemma says the probe hᶜ is so faithful that a compatible family of answers over all objects and morphisms — a natural transformation — collapses to one answer at c itself.
The slogan is: you know an object by its relationships. Two objects with the same pattern of incoming (or outgoing) morphisms, functorially, are isomorphic. This is the categorical version of "a point is determined by the functions on it" (Gelfand duality), "a space by its open sets," or "a group by its representations." In physics-flavored language, you never observe the object directly; you observe how it interacts, and Yoneda promises those interactions carry the complete information — nothing is lost by refusing to look inside.
The key idea of the proof
The proof is short and is driven entirely by one element: the identity morphism id_c.
Given a natural transformation α: Hom(c, −) ⇒ F, its component α_c: Hom(c, c) → F(c) can eat id_c. Define
- Φ(α) = α_c(id_c) ∈ F(c).
Conversely, given u ∈ F(c), define a transformation Ψ(u) whose component at x sends f: c → x to F(f)(u) ∈ F(x).
The naturality square for α says exactly that α_x(f) = α_x(f ∘ id_c) = F(f)(α_c(id_c)). That is, α is forced everywhere by its value on id_c — so Ψ ∘ Φ = id. And Φ(Ψ(u)) = F(id_c)(u) = u, since F preserves identities, so Φ ∘ Ψ = id. The clever step is realizing that naturality does all the work: the single value at the identity propagates by functoriality to a fully determined transformation.
Worked example: the fullness of the embedding
The most-used special case takes F = Hom(d, −) itself. Then the lemma reads
- Nat(Hom(c, −), Hom(d, −)) ≅ Hom(d, c).
So natural transformations between representable functors are exactly morphisms of C (with direction reversed). Unwinding Φ and Ψ: a morphism k: d → c corresponds to the transformation "pre-compose with k," i.e. f ↦ f ∘ k. This says the Yoneda embedding よ: C ↪ [Cᵒᵖ, Set], c ↦ Hom(−, c), is full and faithful.
Concretely in Set: take c = 1, the one-point set. Then Hom(1, −) is (naturally) the identity functor, and Yoneda gives Nat(Hom(1,−), F) ≅ F(1) = the elements of F(1). "A generalized element of shape 1" is just an ordinary element — the lemma recovers the naïve notion of an element as a map from a point.
Why the hypotheses matter, and connections
Local smallness is essential. If Hom(c, x) is a proper class rather than a set, then Hom(c, −) is not a functor to Set, Nat(Hom(c,−), F) may not even form a set, and the statement fails to typecheck. For large categories one must pass to a larger universe or restrict to Set-valued functors carefully; this is why size conditions pervade category theory.
The target must be Set. The proof crucially evaluates α_c at the specific element id_c ∈ Hom(c, c) — an argument about elements. Enriched versions (Yoneda over a monoidal base V) hold, but you must reformulate "elements" via the unit object and prove an enriched analogue; you cannot just repeat the set-level argument.
Connections: Yoneda underlies the uniqueness of objects satisfying a universal property (a representing object is unique up to unique isomorphism), the theory of adjunctions (Hom(Fa, b) ≅ Hom(a, Gb) naturally), and density: every presheaf is a colimit of representables. It is the categorical shadow of Cayley's theorem — every group embeds into a symmetric group by acting on itself.
Applications and significance
Yoneda is the workhorse lemma of modern structural mathematics. A few payoffs:
- Universal properties are rigorous. Products, limits, tensor products, free objects, and quotients are defined by representing a functor; Yoneda guarantees the representing object is unique up to canonical isomorphism, so "the" product is well-defined.
- Proof by representables. To show two constructions agree, it suffices to show they induce the same functor of points Hom(−, X). This is the daily technique in algebraic geometry: a scheme is studied through its functor of points, and moduli problems are phrased as representability questions.
- Adjunctions and the calculus of Kan extensions are built on the embedding being full and faithful.
- Presheaf topoi. [Cᵒᵖ, Set] is the free cocompletion of C; the Yoneda embedding is the universal way to add colimits.
Philosophically, Yoneda formalizes structuralism: identity is relational. That single, one-page proof is why category theorists can insist you never need to know what an object is, only what it does.
| Version | Probe functor | Statement | Embedding consequence |
|---|---|---|---|
| Covariant Yoneda | hᶜ = Hom(c, −): C → Set | Nat(Hom(c,−), F) ≅ F(c) | c ↦ Hom(c,−) gives Cᵒᵖ ↪ [C, Set], full & faithful |
| Contravariant Yoneda | h_c = Hom(−, c): Cᵒᵖ → Set | Nat(Hom(−,c), G) ≅ G(c) | c ↦ Hom(−,c) gives C ↪ [Cᵒᵖ, Set], the presheaf embedding |
| Specialize F = Hom(d,−) | hᶜ probing hᵈ | Nat(Hom(c,−), Hom(d,−)) ≅ Hom(d,c) | Morphisms d→c ↔ natural transformations; fullness & faithfulness |
| Naturality corollary | vary c and F | Bijection commutes with C- and Set-morphisms | Yoneda is an isomorphism of functors, not just of sets |
Frequently asked questions
Why does the proof only need the value of a natural transformation on the identity morphism?
Naturality of α: Hom(c,−) ⇒ F forces, for any f: c → x, the equation α_x(f) = F(f)(α_c(id_c)), because f = f ∘ id_c and the naturality square commutes. So once α_c(id_c) is known, every component is determined by applying F to morphisms. The identity is the universal element that generates the whole representable functor.
What exactly does 'natural in c and F' add beyond the bijection?
It says the family of bijections assembles into an isomorphism of functors, not just a set-indexed collection of coincidences. Concretely, the bijection commutes with morphisms g: c → c′ in C and with natural transformations F ⇒ F′. This is what lets you use Yoneda inside larger diagrammatic arguments, e.g. to prove the embedding is a functor and is full and faithful.
Why must the category be locally small?
Hom(c, −) must land in Set, and Nat(Hom(c,−), F) must be a set for the statement to make sense. If some Hom-set is a proper class, Hom(c,−) is not a Set-valued functor and the collection of natural transformations may be too big to be a set. One repairs this with Grothendieck universes or by restricting attention to accessible/small functors.
How is the Yoneda Lemma related to Cayley's theorem in group theory?
View a group G as a one-object category. The contravariant Yoneda embedding sends the single object to the presheaf Hom(−, ⋆), which is exactly the regular representation: G acting on itself by right multiplication. Fullness and faithfulness say this action is a faithful embedding into permutations of the underlying set — precisely Cayley's theorem, that every group embeds in Sym(G).
What is a representable functor, and why does Yoneda make representability so important?
A functor F: Cᵒᵖ → Set is representable if F ≅ Hom(−, c) for some object c. Yoneda shows that such a c is unique up to unique isomorphism, since Nat(Hom(−,c), Hom(−,d)) ≅ Hom(c,d). Thus 'F is representable' pins down a genuine object with a universal property — this is how products, limits, and moduli spaces are defined and shown to be well-defined.
Does the Yoneda Lemma hold for functors valued in categories other than Set?
Not verbatim: the proof evaluates a component at the element id_c, which is a Set-level operation. There is an enriched Yoneda Lemma over any (complete, cocomplete) symmetric monoidal closed base V, where 'elements' are replaced by maps out of the unit object I and Nat becomes a V-object of natural transformations. It holds, but requires reformulating the statement and reproving it in the enriched setting.