This is a request for a formal statement and explanation of the Yoneda lemma, one of the most important results in category theory. Let me structure this carefully.
Formal Statement of the Yoneda Lemma
The Yoneda lemma comes in two forms - for contravariant functors and for covariant functors. Let me state both.
Covariant Version (most common)
Let C be a locally small category, and let F:C→Set be a functor. For an object X in C, the representation functor (or hom-functor) is:
HomC(X,−):C→Set
Yoneda Lemma (Covariant): Let C be a locally small category, X∈Ob(C), and F:C→Set a functor. Then there is a natural isomorphism:
Nat(HomC(X,−),F)≅F(X)
where Nat(HomC(X,−),F) denotes the set of natural transformations from Hom to .
Contravariant Version: Let C be a locally small category, X∈Ob(C), and G:C a functor.
Then there is a natural isomorphism:
Nat(HomC(−,X),G)≅G(X)
The Isomorphism Explicitly
The core of the lemma lies in understanding how this bijection works. For the covariant case, any natural transformation η:HomC(X,−)⇒F is completely determined by where it sends the identity morphism .
Going the other direction, given an element a∈F(X), I can reconstruct the entire natural transformation by defining ηaY(f)= for each morphism . This construction respects naturality: for any , the diagram with and commutes because applying after equals applying .
These two directions are inverses of each other—starting with a natural transformation η, extracting ηX(idX), and reconstructing recovers η itself, and the same holds in reverse for elements of .
The core insight is that natural transformations from HomC(X,−) to F are entirely determined by where the identity morphism lands, making them equivalent to elements of F(X). This captures the categorical principle that objects are fundamentally characterized by their morphisms to and from everything else. The lemma has deep consequences: it characterizes when functors are representable and underlies the theory of universal properties.
The Yoneda Lemma
Formal Statement
Yoneda Lemma (Covariant Version): Let C be a locally small category, X∈Ob(C), and F:C→Set any functor. Then there is a natural isomorphism:
Nat(HomC(X,−),F)≅F(X
where Nat(HomC(X,−),F) is the set of natural transformations from the representable functor to F.
Contravariant Version: For G:Cop→Set:
Nat(HomC(−,X),G)≅G(X)
The Isomorphism Explicated
Forward Direction: η↦ηX(idX)
Given a natural transformation η:HomC(X,−)⇒F, extract a single element:
η⟼ηX(idX)∈F(X)
We simply evaluate η at X and apply it to the identity morphism.
Reverse Direction: a↦ηa
Given any element a∈F(X), reconstruct the entire natural transformation ηa:Hom by:
For each object Y, define:
ηaY:HomC
Naturality check: For any g:Y→Z, this diagram commutes:
\text{Hom}(X,Y) & \xrightarrow{g \circ -} & \text{Hom}(X,Z) \\
\eta_a^Y \downarrow & & \downarrow \eta_a^Z \\
F(Y) & \xrightarrow{F(g)} & F(Z)
\end{array}$$
This holds because:
$$F(g)(\eta_a^Y(f)) = F(g)(F(f)(a)) = F(g \circ f)(a) = \eta_a^Z(g \circ f)$$
### Verification of Inverse
- **Forward then reverse:** Starting with $\eta$, extract $\eta_X(\text{id}_X) = a$, then reconstruct: $(η_a)^Y(f) = F(f)(\eta_X(\text{id}_X))$. By naturality of $\eta$: this equals $\eta_Y(f)$ ✓
- **Reverse then forward:** Starting with $a \in F(X)$, construct $\eta_a$, then extract: $(\eta_a)_X(\text{id}_X) = F(\text{id}_X)(a) = a$ ✓
## Conceptual Meaning
The Yoneda lemma states that **a natural transformation between $\text{Hom}(X,-)$ and $F$ is completely rigidly determined by a single element of $F(X)$**.
### Why?
The representable functor $\text{Hom}(X,-)$ is "maximally generic"—it just records all morphisms *from* $X$. A natural transformation must respect this structure. The constraints of:
- Evaluating at each object $Y$
- Respecting compositions and identity
- Maintaining naturality
are so rigid that the entire transformation is forced once we specify where the identity goes.
## Key Consequences
1. **Representability Criterion:** A functor $F$ is representable (isomorphic to $\text{Hom}(X,-)$ for some $X$) if and only if $F(X)$ is nonempty and has exactly one natural transformation to $F$ from the universal element.
2. **Yoneda Embedding:** Every locally small category embeds fully and faithfully:
$$y: \mathcal{C} \to [\mathcal{C}^{\text{op}}, \mathbf{Set}], \quad X \mapsto \text{Hom}(-, X)$$
3. **Universal Properties:** Many mathematical structures are defined by representability. For example, products, limits, and adjoint functors all have characterizations via Yoneda.
This is perhaps category theory's most indispensable tool.