---
title: The Yoneda Embedding and Its Uses
module: Representables and the Yoneda Lemma
moduleNumber: 3
lessonNumber: 3
order: 303
summary: >
  Three corollaries turn the Yoneda lemma into working machinery. A
  representation of a presheaf is the same thing as a universal element; the
  Yoneda embedding of a category into its presheaf category is full and
  faithful; and two objects are isomorphic exactly when their representables
  are. Together they justify constructing arrows by constructing natural
  transformations between hom-functors, and they contain Cayley's theorem as
  the one-object case.
topics: [Representables and the Yoneda Lemma]
sources:
  - book: Leinster
    ref: "Ch. 4 — Representables; §4.3 Consequences of the Yoneda lemma"
  - book: Barr & Wells
    ref: "Ch. 4 §4.5 The Yoneda Lemma and universal elements; §4.5.2 The Yoneda embedding"
draft: false
---

The [Yoneda lemma](/category-theory/representables-yoneda/yoneda-lemma) is a
statement about one hom-set at a time: natural transformations $H_A \to X$
correspond to elements of $X(A)$. Its force appears when the correspondence is
applied systematically — to the question of when $X$ is representable, to the
functor $H_\bullet$ that sends each object to its representable presheaf, and to
the question of when two objects are isomorphic. Each application is a short
corollary, and the three together are among the most-used tools in the
subject.[^lein-43]

Throughout, $\mathcal{A}$ is locally small,
$H_A = \mathcal{A}(-, A)$ is the
[representable presheaf](/category-theory/representables-yoneda/representable-functors)
at $A$, and an arrow decorated with $\sim$ denotes an isomorphism.

## Representations as universal elements

A representation of a presheaf $X$ is an object $A$ with a natural isomorphism
$\alpha : H_A \xrightarrow{\ \sim\ } X$. By Yoneda, $\alpha$ is determined by the
element $u = \alpha_A(1_A) \in X(A)$; the corollary below characterizes which
elements $u$ arise from isomorphisms.

> **Corollary (Representation $=$ universal element).** Let $X :
> \mathcal{A}^{\mathrm{op}} \to \mathbf{Set}$. A representation of $X$ amounts to
> an object $A \in \mathcal{A}$ together with an element $u \in X(A)$ such that
> for every $B \in \mathcal{A}$ and every $x \in X(B)$, there is a unique map
> $\bar{x} : B \to A$ with $\big(X(\bar{x})\big)(u) = x$.

Such a $u$ is called a **universal element** of $X$; pairs $(B, x)$ with
$x \in X(B)$ are called elements of the presheaf $X$, and $u$ is the element
every other one factors through uniquely.

> **Proof.** By Yoneda, every natural transformation $H_A \to X$ is a
> map $\widetilde{u}$ for some $u \in X(A)$, so it suffices to show $\widetilde{u}$
> is an isomorphism iff $u$ satisfies the condition. Now $\widetilde{u}$ is a
> natural isomorphism iff every component
> $\widetilde{u}_B : \mathcal{A}(B, A) \to X(B)$ is a bijection, iff for every
> $B$ and every $x \in X(B)$ there is a unique $\bar{x} \in \mathcal{A}(B, A)$
> with $\widetilde{u}_B(\bar{x}) = x$. Since
> $\widetilde{u}_B(\bar{x}) = \big(X(\bar{x})\big)(u)$, this reduces to the
> stated condition. $\square$

$$
% caption: A universal element $u$ of $X$ sits at the representing object $A$;
% every element $x$ of $X(B)$ is hit from $u$ along a unique map into $A$.
\begin{tikzpicture}[>=stealth, font=\footnotesize]
  \definecolor{acc}{HTML}{4A6FA5}
  \node (B1) at (0,1.5)  {$B_1$};
  \node (B2) at (0,0)    {$B_2$};
  \node (B3) at (0,-1.5) {$B_3$};
  \node[draw, acc, thick, circle, minimum size=11mm] (A) at (3.8,0) {$A$};
  \node[acc, font=\scriptsize, anchor=west] at (4.5,0) {$u$ in $X(A)$};
  \draw[->, thick, dashed] (B1) -- (A) node[midway, above, sloped, font=\scriptsize] {unique};
  \draw[->, thick, dashed] (B2) -- (A) node[midway, above, font=\scriptsize] {unique};
  \draw[->, thick, dashed] (B3) -- (A) node[midway, below, sloped, font=\scriptsize] {unique};
  \node[font=\scriptsize, anchor=east] at (-0.4,1.5)  {$x_1$ in $X(B_1)$};
  \node[font=\scriptsize, anchor=east] at (-0.4,0)    {$x_2$ in $X(B_2)$};
  \node[font=\scriptsize, anchor=east] at (-0.4,-1.5) {$x_3$ in $X(B_3)$};
\end{tikzpicture}
$$

The shape "for every $x$ there is a unique map making it work" is the
$\forall \dots \exists!$ pattern of a
[universal property](/category-theory/universal-properties/universal-properties).
The corollary says representability is a universal property in disguise, and
conversely: every universal property can be phrased as the representability of a
suitable set-valued functor. The covariant dual reads the same way, with
$X : \mathcal{A} \to \mathbf{Set}$, $u \in X(A)$, and the unique map going
$\bar{x} : A \to B$.

**Free vector spaces.** Fix a set $S$ and consider
$X = \mathbf{Set}(S, U(-)) : \mathbf{Vect}_k \to \mathbf{Set}$, the functor of
"functions from $S$ into the underlying set." Two familiar statements about
$X$:[^lein-free]

- **Hom-set form.** There is a vector space $F(S)$ with
  $\mathbf{Vect}_k(F(S), V) \cong \mathbf{Set}(S, U(V))$ naturally in $V$; that
  is, $X \cong H^{F(S)}$, so $X$ is representable.
- **Element form.** There is a vector space $F(S)$ and a function
  $u : S \to U(F(S))$ such that every function $f : S \to U(V)$ factors as
  $U(\bar{f}\,) \circ u$ for a unique linear map $\bar{f} : F(S) \to V$. That
  is, $u \in X(F(S))$ is a universal element.

The first looks weaker: it asserts only an isomorphism of functors, while the
second exhibits a specific insertion-of-generators map $u$ through which
everything factors. The corollary says the two are equivalent: every natural
isomorphism $\mathbf{Vect}_k(F(S), V) \cong \mathbf{Set}(S, U(V))$ arises from a
universal element by $g \mapsto U(g) \circ u$, and the word "natural" in the hom-set
form already encodes all the explicit detail of the element form.

**Adjunction units.** The same dictionary applies to any adjunction
$F \dashv G$. For fixed $A$, the functor
$X = \mathcal{A}(A, G(-))$ is representable by $F(A)$, and its universal element
is the unit component $\eta_A \in \mathcal{A}(A, G(F(A)))$ — equivalently,
$\eta_A$ is an initial object of the comma category $(A \Rightarrow G)$. The
three descriptions of an adjunction (hom-set bijection, unit/counit, universal
arrows) are three phrasings of one representability statement; the details are
in [the adjunctions module](/category-theory/adjunctions/adjunctions-via-universal-arrows).

**Non-uniqueness of the isomorphism.** Representing objects are unique up to
isomorphism (below), but representations are not unique on the nose. The
forgetful functor $U : \mathbf{Grp} \to \mathbf{Set}$ has universal element
$1 \in U(\mathbb{Z})$: for every group $G$ and $x \in G$ there is a unique
homomorphism $\mathbb{Z} \to G$ with $1 \mapsto x$. But $-1 \in U(\mathbb{Z})$
is also universal, and the two induced isomorphisms
$H^{\mathbb{Z}} \xrightarrow{\ \sim\ } U$ are different. Universal elements
correspond one-to-one with representations, so $U$ has exactly as many
representations by $\mathbb{Z}$ as $\mathbb{Z}$ has generators: two.

> **Worked example (Two representations of $U : \mathbf{Grp} \to \mathbf{Set}$).**
> Both $1$ and $-1$ in $U(\mathbb{Z})$ are universal elements, and each gives a
> natural isomorphism $H^{\mathbb{Z}} \to U$. At a group $G$ the component
> $\mathbf{Grp}(\mathbb{Z}, G) \to U(G)$ is $\varphi \mapsto \varphi(1)$ for the
> first and $\varphi \mapsto \varphi(-1) = \varphi(1)^{-1}$ for the second. Test
> on $G = \mathbb{Z}/4$: the homomorphism $\varphi$ with $\varphi(1) = 1$ maps
> to $1$ under the first isomorphism and to $-1 = 3$ under the second, so the
> two representations are different maps of functors. They agree only where an
> element is its own inverse — on $\mathbb{Z}/4$, at $0$ and $2$.

## The Yoneda embedding is full and faithful

The second corollary applies the lemma with $X$ itself a representable.

> **Corollary (Yoneda embedding).** For any locally small category
> $\mathcal{A}$, the functor
> $$
> H_\bullet : \mathcal{A} \to [\mathcal{A}^{\mathrm{op}}, \mathbf{Set}]
> $$
> is full and faithful.

Informally: a map of presheaves $H_A \to H_{A'}$ is the same thing as a map
$A \to A'$ in $\mathcal{A}$.

> **Proof.** Fix $A, A' \in \mathcal{A}$. We must show
> $$
> \mathcal{A}(A, A') \to [\mathcal{A}^{\mathrm{op}}, \mathbf{Set}](H_A, H_{A'}),
> \qquad f \mapsto H_f
> $$
> is a bijection. The Yoneda lemma, applied with $X = H_{A'}$, says
> $\widetilde{(-)} : H_{A'}(A) \to [\mathcal{A}^{\mathrm{op}}, \mathbf{Set}](H_A, H_{A'})$
> is a bijection, and $H_{A'}(A) = \mathcal{A}(A, A')$. So it suffices to check
> the two maps agree: $\widetilde{f} = H_f$ for every $f : A \to A'$. Since both
> are determined by their value at the identity, it is enough that
> $\widehat{H_f} = f$, and indeed
> $\widehat{H_f} = (H_f)_A(1_A) = f \circ 1_A = f$. $\square$

A full and faithful functor deserves the name **embedding**: by fullness and
faithfulness, $\mathcal{A}$ is equivalent to the full subcategory of
$[\mathcal{A}^{\mathrm{op}}, \mathbf{Set}]$ whose objects are the representable
presheaves. Every category, however oddly presented, sits inside a category of
set-valued functors — a category with excellent properties (all
[limits and colimits](/category-theory/adjoints-limits/presheaf-limits-colimits),
computed pointwise) that $\mathcal{A}$ itself may lack.

$$
% caption: The Yoneda embedding places $A$ inside its presheaf category as the
% full subcategory of representables; non-representable presheaves surround it.
\begin{tikzpicture}[>=stealth, font=\footnotesize]
  \definecolor{acc}{HTML}{4A6FA5}
  \draw[thick] (0,0) ellipse (3.3 and 2.2);
  \node[anchor=south] at (0,2.25) {presheaves on $\mathcal{A}$};
  \draw[acc, thick, fill=acc!10] (-0.9,-0.1) ellipse (1.5 and 1.0);
  \node[acc, font=\scriptsize] at (-0.9,-0.1) {representables $H_A$};
  \node[draw, thick, minimum width=14mm, minimum height=9mm] (A) at (-5.3,-0.1) {$\mathcal{A}$};
  \draw[->, acc, thick] (A.east) -- (-2.55,-0.1) node[midway, above] {$H$};
  \fill[black] (1.5,0.9) circle (1.6pt);
  \fill[black] (2.0,-0.4) circle (1.6pt);
  \fill[black] (1.2,-1.2) circle (1.6pt);
  \node[black, font=\scriptsize, anchor=west] at (2.15,0.55) {other $X$};
\end{tikzpicture}
$$

Full subcategories are the well-behaved ones: for objects in a full subcategory,
"map" and "isomorphism" mean the same whether computed inside or outside. The
lemma that transports these notions is worth recording.

> **Lemma (Full and faithful functors reflect isomorphisms).** Let $J :
> \mathcal{A} \to \mathcal{B}$ be full and faithful and $A, A' \in \mathcal{A}$.
> Then:
>
> - a map $f$ in $\mathcal{A}$ is an isomorphism iff $J(f)$ is;
> - every isomorphism $g : J(A) \to J(A')$ in $\mathcal{B}$ is $J(f)$ for a
>   unique isomorphism $f : A \to A'$ in $\mathcal{A}$;
> - $A \cong A'$ in $\mathcal{A}$ iff $J(A) \cong J(A')$ in $\mathcal{B}$.

The practical reading of fullness, in Barr & Wells' phrasing: **to construct an
arrow $A \to A'$, it is enough to construct a natural transformation
$H_A \to H_{A'}$** — that is, to give for each object $T$ a function
$\mathcal{A}(T, A) \to \mathcal{A}(T, A')$, "a variable element of $A'$ for each
variable element of $A$," naturally in $T$. This is among the most used
techniques in the subject: many arrows (diagonal maps, evaluation maps, canonical
comparisons) are easiest to define on generalized elements, and Yoneda guarantees
a unique actual arrow inducing the definition.[^bw-45]

## Isomorphism of representables

The third corollary is the slogan "an object is determined by the maps into it."

> **Corollary (Objects determined by their representables).** For $A, A'$ in a
> locally small category $\mathcal{A}$,
> $$
> H_A \cong H_{A'}
> \iff A \cong A'
> \iff H^A \cong H^{A'}.
> $$

> **Proof.** The first equivalence is the reflection lemma applied to the full
> and faithful functor $H_\bullet$; the second follows by duality, applying the
> first in $\mathcal{A}^{\mathrm{op}}$. $\square$

Functors preserve isomorphism automatically, so the content is the direction
$H_A \cong H_{A'} \Rightarrow A \cong A'$: if
$\mathcal{A}(B, A) \cong \mathcal{A}(B, A')$ **naturally in $B$**, then
$A \cong A'$. Reading $\mathcal{A}(B, A)$ as "$A$ viewed from $B$," two objects
that look the same from every viewpoint, compatibly, are the same.

$$
% caption: If $A$ and $A_0$ receive matching hom-sets from every test object
% $B_i$, naturally, then $A$ and $A_0$ are isomorphic: no family of viewpoints
% can be fooled.
\begin{tikzpicture}[>=stealth, font=\footnotesize]
  \definecolor{acc}{HTML}{4A6FA5}
  \node (B1) at (0,1.6)  {$B_1$};
  \node (B2) at (0,0)    {$B_2$};
  \node (B3) at (0,-1.6) {$B_3$};
  \node[draw, acc, thick, circle, minimum size=10mm] (A)  at (4.2,0.9)  {$A$};
  \node[draw, thick, circle, minimum size=10mm]      (Ap) at (4.2,-0.9) {$A_0$};
  \draw[->, acc] (B1) -- (A);
  \draw[->, acc] (B2) -- (A);
  \draw[->, acc] (B3) -- (A);
  \draw[->, black] (B1) -- (Ap);
  \draw[->, black] (B2) -- (Ap);
  \draw[->, black] (B3) -- (Ap);
  \draw[<->, thick, dashed] (A) -- (Ap) node[midway, right=2pt] {iso};
\end{tikzpicture}
$$

The naturality requirement does real work. In $\mathbf{Grp}$, isolated
isomorphisms of hom-sets carry only partial information:

- $H_A(1) \cong H_{A'}(1)$ always holds (both are one-element sets) and says
  nothing;
- $H_A(\mathbb{Z}) \cong H_{A'}(\mathbb{Z})$ says the underlying sets of $A$ and
  $A'$ are isomorphic, but the group structures could still differ;
- $H_A(\mathbb{Z}/p\mathbb{Z}) \cong H_{A'}(\mathbb{Z}/p\mathbb{Z})$ for all
  primes $p$ says $A$ and $A'$ have the same number of elements of each prime
  order.

None of these alone forces $A \cong A'$; the corollary applies only when the
isomorphisms hold for all $B$ and cohere naturally. The category $\mathbf{Set}$
is unusual in this respect: $A \cong \mathbf{Set}(1, A) = H^1(A)$, so one shape
of generalized element (shape $1$) already determines a set. In a general
category no single shape suffices, and the corollary compensates by quantifying
over all of them.

**Uniqueness of representing objects and of adjoints.** If a functor $X$ is
isomorphic to both $H^A$ and $H^{A'}$, then $H^A \cong H^{A'}$, so
$A \cong A'$: representing objects are unique up to isomorphism. This licenses
"the" in definitions by universal property. The tensor product is a case in
point: there is, up to isomorphism, at most one vector space $T$ with
$\operatorname{Bilin}(U, V; W) \cong \mathbf{Vect}_k(T, W)$ naturally in $W$, so
_the_ tensor product $U \otimes V$ is well defined. Uniqueness of
[adjoints](/category-theory/adjunctions/adjunctions) follows the same way: if
$F$ and $F'$ are both left adjoint to $G$, then
$$
H^{F(A)} \cong \mathcal{A}(A, G(-)) \cong H^{F'(A)}
$$
for each $A$, so $F(A) \cong F'(A)$, and the isomorphisms are natural in $A$,
giving $F \cong F'$.

| Corollary | Statement | Typical use |
| --- | --- | --- |
| Universal elements | representation of $X$ $=$ universal element $u \in X(A)$ | recognize universal properties as representability |
| Yoneda embedding | $H_\bullet$ is full and faithful | build arrows from natural maps of hom-functors |
| Isomorphism of representables | $H_A \cong H_{A'} \iff A \cong A'$ | uniqueness of universal constructions and adjoints |

## Cayley's theorem as a special case

The Yoneda embedding generalizes Cayley's theorem from group theory, a point
Barr & Wells make explicit.[^bw-cayley] Cayley's theorem: every group $G$ embeds
in the symmetric group on its underlying set, via $g \mapsto (x \mapsto gx)$.

View $G$ as a one-object category. A set-valued functor on it is a $G$-set, and
the single representable functor is the **regular representation**
$\underline{G}$: the underlying set of $G$ acted on by multiplication. The
Yoneda embedding sends the one object of $G$ to $\underline{G}$ and each arrow
$g$ to the natural transformation "multiply by $g$." Faithfulness says distinct
group elements give distinct permutations of $\underline{G}$; functoriality says
composition is preserved. That is precisely an injective homomorphism from $G$
into the group of permutations of its underlying set — Cayley's theorem, with
Yoneda's fullness added for free: _every_ $G$-equivariant automorphism of the
regular representation is multiplication by a group element.

$$
% caption: Cayley's theorem is the Yoneda embedding of a one-object category:
% each group element $g$ becomes the permutation of $G$ given by multiplication.
\begin{tikzpicture}[>=stealth, font=\footnotesize]
  \definecolor{acc}{HTML}{4A6FA5}
  \node[draw, thick, circle, minimum size=9mm] (G) at (0,0) {};
  \fill (0,0) circle (1.8pt);
  \draw[->, thick] (G) to[out=125, in=55, loop, looseness=5] (G);
  \node[anchor=south, font=\scriptsize] at (0,1.32) {$g$, $h$, $gh$};
  \node[anchor=north, align=center, font=\scriptsize] at (0,-0.75) {group $G$ as a\\one-object category};
  \draw[->, acc, very thick] (2.0,0) -- (3.6,0) node[midway, above] {$H$};
  \begin{scope}[xshift=5.9cm]
    \node (a) at (0,1.1)  {$x_1$};
    \node (b) at (0,0)    {$x_2$};
    \node (c) at (0,-1.1) {$x_3$};
    \node (a2) at (2.2,1.1)  {$g x_1$};
    \node (b2) at (2.2,0)    {$g x_2$};
    \node (c2) at (2.2,-1.1) {$g x_3$};
    \draw[->, acc] (a) -- (a2);
    \draw[->, acc] (b) -- (b2);
    \draw[->, acc] (c) -- (c2);
    \node[anchor=north, align=center, font=\scriptsize] at (1.1,-1.6) {$g$ acts as a permutation\\of the set $G$};
  \end{scope}
\end{tikzpicture}
$$

> **Worked example (Cayley's theorem for $\mathbb{Z}/3$).** View
> $\mathbb{Z}/3 = \{0, 1, 2\}$ as a one-object category. Its regular
> representation is the set $\{0, 1, 2\}$ under addition. The element $1$ acts
> by $x \mapsto x + 1$, the $3$-cycle $(0\,1\,2)$; the element $2$ acts by
> $x \mapsto x + 2$, the cycle $(0\,2\,1)$; and $0$ acts as the identity
> permutation. The Yoneda embedding sends $\mathbb{Z}/3$ to the subgroup
> $\{e, (0\,1\,2), (0\,2\,1)\}$ of the symmetric group $S_3$ — an injective
> homomorphism $\mathbb{Z}/3 \hookrightarrow S_3$, which is Cayley's theorem
> here. Fullness adds that these three are the only permutations of the regular
> representation commuting with the action.

The one-object case displays the general mechanism in miniature. An arbitrary
category has many objects, so instead of one regular representation there is one
representable presheaf per object, and instead of a permutation group there is
the presheaf category; but the embedding works for the same reason, with the
identity arrow playing the role of the group identity in Cayley's proof.

## Presheaves as generalized objects

The embedding invites a change of attitude: identify $A$ with
$H_A$ and regard arbitrary presheaves as **generalized objects** of
$\mathcal{A}$. A presheaf $X$ assigns to each object $B$ a set $X(B)$ of
"$B$-shaped figures," exactly as $H_A$ assigns the $B$-shaped
[generalized elements](/category-theory/representables-yoneda/representable-functors)
of $A$; the difference is only that $X$ need not be realized by an actual object.
The presheaf category is then a completion of $\mathcal{A}$: it has all limits
and colimits even when $\mathcal{A}$ has few, and $\mathcal{A}$ sits inside it
fully faithfully. In
[a later module](/category-theory/adjoints-limits/presheaf-limits-colimits) this
is sharpened: every presheaf is a colimit of representables, roughly as every
positive integer is a product of primes, making
$[\mathcal{A}^{\mathrm{op}}, \mathbf{Set}]$ the free cocompletion of
$\mathcal{A}$.

Hom-functors record the maps out of and into each object; the Yoneda lemma says
a natural map out of a representable is a single element; and its corollaries
say the passage from objects to representables loses nothing, so an object may
be studied, or even defined, by its maps in.

[^lein-43]: **Leinster**, _Basic Category Theory_, §4.3 — Consequences of the Yoneda lemma: Corollaries 4.3.2 (representation $=$ universal element), 4.3.7 (the embedding is full and faithful), and 4.3.10 (isomorphism of representables), with Lemma 4.3.8 on full and faithful functors.
[^lein-free]: **Leinster**, _Basic Category Theory_, §4.3, Examples 4.3.4–4.3.6 — the free vector space in hom-set and element form, adjunction units as universal elements, and the two universal elements $\pm 1$ of the forgetful functor on groups.
[^bw-45]: **Barr & Wells**, _Category Theory for Computing Science_, §4.5.4–4.5.5 — every natural transformation of hom-functors is composition with a unique arrow, and the technique of defining an arrow by its action on variable elements.
[^bw-cayley]: **Barr & Wells**, _Category Theory for Computing Science_, §4.5 — "representable functors are a generalization of the regular representation, and the Yoneda embedding is a generalization of Cayley's Theorem."
