The Yoneda Lemma is a fundamental result in category theory, establishing a deep relationship between objects in a category and functors from that category to the category of sets. This document provides a formal definition, proof, and implications of the lemma.
-
Categories: A category
$\mathcal{C}$ consists of objects and morphisms (arrows) satisfying composition and identity laws. -
Functors: A functor
$F: \mathcal{C} \to \mathbf{Set}$ maps objects of$\mathcal{C}$ to sets and morphisms to functions. -
Hom-Functor: For a fixed object
$A \in \mathcal{C}$ , the hom-functor$\mathcal{C}(A, -): \mathcal{C} \to \mathbf{Set} $ sends an object$X$ to the set of morphisms$\mathcal{C}(A, X)$ .
Let:
-
$\mathcal{C}$ be a locally small category (i.e.,$\mathcal{C}(A, B)$ is a set). -
$F: \mathcal{C} \to \mathbf{Set}$ be a functor. -
$A \in \mathcal{C}$ be an object.
Yoneda Lemma: There is a bijection, natural in both
where
- Given a natural transformation
$ \alpha: \mathcal{C}(A, -) \to F$ , define$\Phi(\alpha) = \alpha_A(\mathrm{id}_A) \in F(A)$ . - Conversely, given
$u \in F(A)$ , define$\Psi(u): \mathcal{C}(A, -) \to F$ by:
- Check that
$\Psi(u)$ is a natural transformation: For any morphism$g: X \to Y$ in$\mathcal{C}$ , the following diagram commutes:
- Show
$\Phi(\Psi(u)) = u$ for$u \in F(A)$ :
- Show
$\Psi(\Phi(\alpha)) = \alpha$ for $ $ \alpha: \mathcal{C}(A, -) \to F$ : For any$X$ and$f \in \mathcal{C}(A, X)$ ,
The functor:
is fully faithful. This embeds
If
The Yoneda Lemma underlies "Yoneda embedding" in functional programming:
data Yoneda f a = Yoneda (forall b. (a -> b) -> f b)