# The Yoneda Embedding

/Last week we began a discussion about the Yoneda lemma. Though rather than stating the lemma (sans motivation)*, *we took a leisurely stroll through an implication of its corollaries - the *Yoneda perspective, *as we called it*:*

### An object is completely determined by its relationships to other objects,

i.e.

### by what the object "looks like" from the vantage point of each object

in the category.

But this left us wondering, *What are the mathematics** behind this idea?* *And w**hat are the actual corollaries?* In this post, we'll work to discover the answers. To begin, let's put concrete math behind these three abstract expressions:

- "...a
*relationship*between two objects..." - "...the
*vantage point of**each object*in a category..." - "...an object is
*completely characterized*by..."

## A *"relationship between two objects"*

is a morphism.

*relationship*if there is a morphism between them. For example, if $X$ is a topological space with the discrete topology, there are lots of relationships - lots continuous functions - from $X$ to $Y$ for any space $Y$. In fact,

*all*maps out of a discrete space are continuous.

On the other hand, there are very few relationships between objects in the category of fields - there are no field homomorphisms between fields of different characteristics!

*to and from*$X$, i.e. the sets

*"...the vantage point of each object..."*** **

is encoded by a functor

*each*$Z$ in $\mathsf{C}$. An efficient way to handle this is via the contravariant functor $ \text{hom}(-,X):\mathsf{C}^{op}\to\mathsf{Set} $ that sends $Z$ to the set $\text{hom}(Z,X)$ and a morphism $f:Z\to W$ to its pullback $f^*$ (defined by precomposing with $f$). Likewise, the sets $\text{hom}(X,Z)$ for all $Z$ in $\mathsf{C}$ lie in the image of the (covariant) functor $\text{hom}(X,-):\mathsf{C}\to\mathsf{Set}$.

*"...an object is 'completely determined by'..."*** **

means you know it

up to isomorphism.

*completely determined by*..." means that $X$ is - up to isomorphism - the only object characterized by whatever comes after the ellipsis. In the first paragraph of this post, it was "...their relationships to other objects." (Though typically, a universal property follows the ellipsis. This is no surprise. In light of the Yoneda perspective the two addendums go hand in hand!)

*relates*to

*all*other objects in $\mathsf{C}$ in the

*same*way that $X$ does - that is, if $Y$ looks just like $X$ from the vantage point of the full category - then $X$ and $Y$ must be isomorphic, and conversely.

For example, suppose $X$ and $Y$ are topological spaces and let $\bullet$ denote the one-point space and $I$ and $S^1$ the unit interval and the circle. Then,

- $X$ and $Y$ have the same cardinality if and only if $\text{hom}(\bullet,X)\cong\text{hom}(\bullet,Y)$.
- $X$ and $Y$ have the same path space if and only if $\text{hom}(I,X)\cong\text{hom}(I,Y)$.
- $X$ and $Y$ have the same (free) loop space if and only if $\text{hom}(S^1,X)\cong\text{hom}(S^1,Y)$.

*all*spaces.

**point #1.**

Everything we need to know about X

is encoded in hom(--, X). In effect,

the object X **represents*** *the functor hom(--, X).

**point #2. **

X and Y are isomorphic

*if and only if* their represented functors

hom(--,X) and hom(--,Y) are isomorphic.

*object*with a

*functor*? There's clearly an assignment $$ X\mapsto \text{hom}(-,X) $$ since

*any*object $X$ in the category $\mathsf{C}$ gives rise to a functor $\text{hom}(-,X)$ in... well... in what?

*Where does $\text{hom}(-,X)$ live?*It, too, lives in a category! As we mentioned long ago, there is a category $\mathsf{Set}^{\mathsf{C}^{op}}$ whose objects are functors $\mathsf{C}^{op}\to\mathsf{Set}$ and whose morphisms are natural transformations.

Therefore (and you should verify this) there is a functor $\mathscr{Y}:\mathsf{C}\to \mathsf{Set}^{\mathsf{C}^{op}}$ that sends an object $X$ to $\text{hom}(-,X)$ and a morphism $f:X\to Y$ to the natural transformation $f_*: \text{hom}(-,X)\to \text{hom}(-,Y)$. (Each component of this natural transformation is given by postcomposing with $f$.)

Functors in the category $\mathsf{Set}^{\mathsf{C}^{op}}$ are called

**presheaves**, and the presheaves

*we're*interested in (i.e. those of the form $\text{hom}(-,X)$) are called

**representable functors**. But we need to justify this nomenclature. Does $X$ truly, faithfully, and to the fullest extent

*represent*the functor $\text{hom}(-,X)$?

The answer is "yes" under one condition: as $\mathscr{Y}$ sends $X$ to the presheaf category, it should *preserve* relationships that $X$ shares with objects in $\mathsf{C}$. In other words, for each relationship (morphism) between $X$ and $Y$, there should exist exactly *one* relationship (natural transformation) between $\text{hom}(-,X)$ and $\text{hom}(-,Y)$. More formally, for every pair $X,Y$ in $\mathsf{C}$, the function
$$\text{hom}(X,Y)\to\mathsf{Nat}(\text{hom}(-,X),\text{hom}(-,Y))$$ defined by $f\mapsto f_*$ should be a bijection. (The notation $\mathsf{Nat}(-,-)$ means the set of natural transformations from [blank] to [blank].) If $\mathscr{Y}$ satisfies this condition, then it is called **fully faithful*** and is said to **embed** the category $\mathsf{C}$ into $\mathsf{Set}^{\mathsf{C}^{op}}$.

*Is*the function $$\text{hom}(X,Y)\to\mathsf{Nat}(\text{hom}(-,X),\text{hom}(-,Y))$$ that sends $f$ to $f_*$ a bijection? Injectivity is clear: if $f,g:X\to Y$ are distinct morphisms, then their pushforwards $f_*$ and $g_*$ are distinct. But what about surjectivity? Given any natural transformation $\eta:\text{hom}(-,X)\to\text{hom}(-,Y)$, is there a morphism $f:X\to Y$ so that $\eta=f_*$? That is,

**does ***every* natural transformation between representable functors arise from a morphism between their representing objects?

*every*natural transformation between representable functors arise from a morphism between their representing objects?

*tons*of natural transformations $\text{hom}(-,X)$ and $\text{hom}(-,Y)$! And there's no good reason to expect any of them should come from a morphism $X\to Y$.

*Except there is.*

Because the answer is yes!

** YES!**

For every natural transformation $\eta:\text{hom}(-,X)\to \text{hom}(-,Y)$ there is *exactly one* morphism $f:X\to Y$ such that $\eta=f_*$.

And THIS is an immediate consequence of the Yoneda lemma. In fact, some folks might call *this* the Yoneda lemma.

The result is that $\mathscr{Y}$ fully and faithfully embeds $\mathsf{C}$ into $\mathsf{Set}^{\mathsf{C}^{op}}$. (This is the formal way of phrasing "point #1" above.) And for this reason, $\mathscr{Y}$ is called the

**Yoneda embedding.**

But this - the fact that morphisms $X\to Y$ are in bijection with natural transformations $\text{hom}(-,X)\to\text{hom}(-,Y)$ - is merely a

*consequence*of the Yoneda lemma. As we'll see next week, it says something

*much*stronger!

*It tells us something about natural transformations $\text{hom}(-,X)\to F$ for*

**any**functor $F:\mathsf{C}^{op}\to\mathsf{Set}$.**faithful**, if it is a surjection, $F$ is called

**full**, and if it is a bijection, $F$ is called

**fully faithful.**And here's a handy chart for naming other types functors.

IN THIS SERIES