### An Exegesis of Yoneda Structures

#### Posted by Emily Riehl

*Guest post by Alexander Campbell*

We want to develop category theory in a general 2-category, in order to both generalise and clarify our understanding of category theory. The key to this endeavour is to express the basic notions of the theory of categories in a natural 2-categorical language. In this way we are continuing a theme present in previous posts from the Kan Extension Seminar, wherein monads and adjunctions were given a 2-categorical setting, and by analogy, in our very first paper, whose purpose was to express basic notions of the theory of sets in a natural categorical language. In this post we consider a concept very central and special to category theory: the Yoneda lemma.

**So what’s the Yoneda Lemma again?**

The Yoneda lemma says that for any object $a$ of a category $A$, the diagram $\begin{matrix} 1 & \overset{a}{\rightarrow} & A \\ {}_{\ast} \searrow & \overset{\iota}{\Rightarrow} & \swarrow_{A(a,-)} \\ & Set \\ \end{matrix}$ is a left extension.

In this post I will give a motivation for the notion of Yoneda structure, as defined in the paper *Yoneda Structures on 2-Categories* of Ross Street and Bob Walters.
But before we begin I would like to take this opportunity to thank Emily for inviting me to join the Kan Extension Seminar and for her support and encouragement throughout the course. This has been and continues to be a singularly valuable experience in my first year as a category theorist.

### Liftings and extensions

After the various compositions available in a 2-category (nicely unified as the operation of pasting), the most basic notions of two-dimensional algebra are liftings and extensions. A diagram
$\begin{matrix}
& A \\
{}^h \swarrow & \overset{\alpha}{\Leftarrow} & \searrow^{g} \\
C & \overset{f}{\rightarrow} & B \\
\end{matrix}$
in a 2-category $\mathcal{K}$ is said to be a *left lifting* if pasting along $h$ effects a bijection of 2-cells
$\frac{h \Rightarrow k}{g \Rightarrow f k}.$

There is a similar elementary definition of *left extension*, but we can simply say that a left extension is a left lifting in $\mathcal{K}^{op}$ (reverse 1-cells). Hence these are just dual versions of a single notion. Left liftings in $\mathcal{K}^{co}$ and $\mathcal{K}^{coop}$ are right liftings and right extensions respectively, but these will not concern us here.

An elementary result of 2-categorical algebra is the **pasting lemma**. This tells us that given a diagram
$\begin{matrix}
& & A \\
{}^h \swarrow & \overset{\beta}{\Leftarrow} & \downarrow^{g} & \overset{\alpha}{\Leftarrow} & \searrow^{f} \\
D & \underset{l}{\rightarrow} & C & \underset{k}{\rightarrow} & B \\
\end{matrix}$
in which $\alpha$ is a left lifting, $\beta$ is a left lifting if and only if the composite is a left lifting. By duality, we immediately get a corresponding result for left extensions.

### The Yoneda lemma and Yoneda structures

A Yoneda structure on a 2-category consists of two pieces of data satisfying three axioms. We will see that the data is what is necessary to naturally express the Yoneda lemma in the 2-category, and that the axioms are expressions of familiar results of category theory.

In a general 2-category, following the philosophy of generalised elements, it is natural to consider arrows $X \longrightarrow A$ with arbitrary domain (not just restricted to the terminal object 1) as objects of $A$. In order to state the Yoneda lemma for such generalised objects, we must replace $\ast \colon 1 \longrightarrow \text{Set}$ with some arrow $y_X \colon X \longrightarrow P X$. Here $P X$ could be loosely thought of as “sets freely varying over $X$”; in CAT, it is the category of presheaves over $X$ and $y_X$ is the Yoneda embedding.

But now we must address the issue of size. Firstly, in CAT, the Yoneda embedding $y_X$ exists only for locally small $X$. Secondly, in the wish for a snappy statement of the Yoneda lemma, I left an important condition unmentioned: it is not true for a general category $A$ that the hom-functor $A(a,-)$ exists for every object $a$. (It would be true if $A$ were locally small, but we do not want CAT to consist only of locally small categories; for if $X$ is not small, then $P X$ is not locally small.) Hence we must restrict those elements for which we state the Yoneda lemma.

We can now specify the data of a Yoneda structure on a 2-category. The first piece of data is a class of **admissible arrows** in the 2-category; the only property we require of this class is that it be a right ideal, meaning that if $g$ is admissible, then so is $g f$ for every such composable $f$. We say that an object $A$ is admissible if the identity arrow $1_A \colon A \longrightarrow A$ is admissible; in the Yoneda structure on CAT, the admissible objects are the locally small categories. Hence we see that there is nothing mysterious about size; it is just part of the structure. The other piece of a Yoneda structure is the **Yoneda arrows**: an admissible arrow $y_A \colon A \longrightarrow P A$ for each admissible object $A$.

With this structure we can naturally state the Yoneda lemma in a 2-category. We take this as our first axiom for a Yoneda structure.

**Axiom 1.** For $X$, $a$ both admissible, the left extension
$\begin{matrix}
X & \overset{a}{\rightarrow} & A \\
{}_{y_X} \searrow & \overset{\chi^a}{\Rightarrow} & \swarrow_{A(a,1)} \\
& P X \\
\end{matrix}$
exists.

The universal property of this extension is indicated by $\frac{A(a,1) \Rightarrow f}{y_X \Rightarrow f a}.$

So we have used the Yoneda lemma as a definition of the hom-functors $A(a,1)$; the axiom asserts their existence. We can further define the hom-functors on 1-cells and 2-cells in both variables: in the first variable by the universal property of extension, and in the second variable by composition. In particular, for (suitably admissible) $f \colon A \longrightarrow B$, we can define $P f \colon P B \longrightarrow P A$ as $P f = (P B)(B(1,f),1)$, with a similar definition on 2-cells. This all just follows from Axiom 1, hence is part of any Yoneda structure.

All further use of the admissibility notion is just to ensure the existence of the data of Axiom 1. So I will make minimal explicit mention of it from here; it can be easily filled in as necessary.

### Universal arrows and absolute liftings

The second axiom of a Yoneda structure is expressed in terms of liftings. I will now exhibit the presence of liftings in category theory.

The first formalisation of the notion of universal property that Mac Lane gives in *Categories for the Working Mathematician* is that of *universal arrow* (I will deal with the ‘left’ sense here). Given a functor $f \colon A \longrightarrow B$ and an object $b$ of $B$, he defines what it means for a “pair” consisting of an object $a$ of $A$ and an arrow $\theta \colon b \longrightarrow fa$ to be a universal arrow from $b$ to $f$. This definition says precisely that
$\begin{matrix}
& 1 \\
{}^a \swarrow & \overset{\theta}{\Leftarrow} & \searrow^{b} \\
A & \underset{f}{\rightarrow} & B \\
\end{matrix}$
is a left lifting diagram.

In a general 2-category, the restriction of our consideration to such ‘global objects’ is untenable. So how do we express the universal property of a ‘generalised arrow’ from a ‘generalised object’ $b \colon X \longrightarrow B$ to $f$? It is **not enough** to say that the corresponding diagram
$\begin{matrix}
& X \\
{}^a \swarrow & \overset{\theta}{\Leftarrow} & \searrow^{b} \\
A & \underset{f}{\rightarrow} & B \\
\end{matrix}$
is a left lifting diagram; we must consider the object $b$ at **all its stages of development**. Hence we define a 2-cell $\theta$ to be a universal arrow from $b$ to $f$ when for every earlier stage $Y \longrightarrow X$, the diagram
$\begin{matrix}
& Y \\
& \downarrow \\
& X \\
{}^a \swarrow & \overset{\theta}{\Leftarrow} & \searrow^{b} \\
A & \underset{f}{\rightarrow} & B \\
\end{matrix}$
is a left lifting. That is, we require our corresponding diagram to be an *absolute* left lifting (meaning that the property of being a left lifting is preserved when composed with any arrow into $X$).

Hence absolute liftings give a natural 2-categorical expression of the notion of universal arrow. This slogan can help us to interpret some basic facts of the algebra of 2-categories as they relate to category theory. For instance, the result that a 2-cell $\begin{matrix} & A \\ {}^f \swarrow & \overset{\eta}{\Leftarrow} & \searrow^{1} \\ B & \underset{g}{\rightarrow} & A \\ \end{matrix}$ is the unit of an adjunction $f \dashv g$ if and only if it is an absolute left lifting corresponds to the familiar result of basic category theory that states that a functor $g \colon B \longrightarrow A$ is a right adjoint if and only if there is a universal arrow to $g$ from every object of $A$.

### Universal elements and representability

Now, observe that the 2-cell in the ordinary Yoneda lemma, in addition to being a left extension, is trivially a left lifting; for this just means that there is a bijection between arrows $a \longrightarrow b$ and elements of the set $A(a,b)$. In familiar terms, this says that $\iota$ is a universal element of the functor $A(a,-)$, and by the above discussion we can immediately incorporate this into our setting as the second axiom for a Yoneda structure.

**Axiom 2.** The 2-cell $\chi^a$ of Axiom 1 is an absolute left lifting.

The universal property of this absolute left lifting is indicated by $\frac{a x \Rightarrow b}{X(1,x) \Rightarrow A(a,b)}.$

The combination of these two universal properties of the 2-cells $\chi^a$ is the ignition that allows us to begin to develop category theory in our 2-category. Together they give a bijection of 2-cells $\pi$ and $\eta$ as indicated by the bijections $\frac{\frac{B(s,1) \Rightarrow C(j,t)}{y_A \Rightarrow C(j,t s)}}{j \Rightarrow t s}$ and as displayed in the diagram $\begin{matrix} & A \\ {}^s \swarrow & \overset{\chi^s}{\Leftarrow} & \searrow^{y_A} \\ B & \overset{B(s,1)}{\rightarrow} & P A \\ {}_t \searrow & \Downarrow^{\pi} & \nearrow_{C(j,1)} \\ & C \\ \end{matrix} \qquad = \qquad \begin{matrix} & & A \\ {}^s \swarrow & \overset{\eta}{\Leftarrow} & \downarrow^{j} & \overset{\chi^j}{\Leftarrow} & \searrow^{y_A} \\ B & \underset{t}{\rightarrow} & C & \underset{C(j,1)}{\rightarrow} & P A \\ \end{matrix}$ From Axiom 2 and the pasting lemma, we get that the LHS is an absolute left lifting (with base $C(j,t) = C(j,1)t$) if and only if $\eta$ is an absolute left lifting. This is exactly the realisation in our setting of the familiar correspondence between universal elements of $C(j,t)$ and universal arrows from $j$ to $t$. In particular, if $\pi$ is an isomorphism, then this condition holds, and we have a universal element of $C(j,t)$. Note that we can understand $\pi$ being an isomorphism as meaning that $C(j,t)$ is representable.

Now, recall the representability condition of ordinary category theory that says that a functor $f \colon B \longrightarrow \text{Set}$ is representable if and only if it has a universal element. We have seen that one half of this implication follows from the first two axioms of a Yoneda structure. We could take the other half as an axiom, being a basic result of category theory that we wish to incorporate into our setting.

**Axiom 3*.** If a 2-cell $\sigma \colon A(a,1) \Rightarrow f \colon A \longrightarrow P X$ yields an absolute left lifting diagram when pasted onto $\chi^a$, then $\sigma$ is an isomorphism.

Understood in our interpretation, this is indeed the other implication of the representability condition.

However this axiom is **too strong** to capture all the examples we want! While it does hold in ordinary category theory and in 2-categories of internal categories and variable (=indexed=parametrized) categories, it is does not hold in general in enriched category theory. For in enriched category theory, representability of a functor is expressed as an isomorphism in the base of enrichment, and the bijection of sets of the universal element condition is not enough to capture this.

Hence we do not take Axiom 3* as an axiom for Yoneda structures. Instead we take a couple of special cases. By Axiom 1 for $y_A$ and $gf$ in place of $a$, we have the bijections of 2-cells $\frac{P1_A \Rightarrow 1_{P A}}{y_A \Rightarrow y_A} \qquad \frac{C(g f,1) \Rightarrow P f.C(g,1)}{y_A \Rightarrow P f.C(g,1).g f}.$ Let $\iota_A$ correspond to $1_{y_A}$ in the first bijection, and $\theta_{f,g}$ correspond to the 2-cell $\begin{matrix} A & \overset{f}{\rightarrow} & B & \overset{g}{\rightarrow} & C \\ {}^{y_A} \downarrow & \overset{\chi^{B(1,f)}}{\Rightarrow} & {}^{y_B} \downarrow & \overset{\chi^g}{\Rightarrow} & \swarrow_{C(g,1)} \\ P A & \underset{P f}{\leftarrow} & P B \\ \end{matrix}$ in the second. These corresponding 2-cells are an identity and a pasting of two absolute left liftings respectively. Hence (by the pasting lemma in the second case) they are both absolute left liftings, and Axiom 3* would imply that they are isomorphisms. We take these special cases as our third and final axiom.

**Axiom 3.** The 2-cells $\iota_A$ and $\theta_{f,g}$ are isomorphisms.

In summary, a **Yoneda structure** on a 2-category consists of admissible arrows and Yoneda arrows satisfying Axioms 1, 2, and 3.

### Formal category theory

Now that we have established the notion of a Yoneda structure on a 2-category, we can begin to develop category theory within such a 2-category. What is remarkable is that everything follows formally and naturally from the Yoneda structure and from the elementary two-dimesional algebra of pasting, liftings, extensions and adjunctions. In their paper, Street and Walters develop results concerning adjunctions, weighted colimits, EM objects and Kleisli objects for monads, and they introduce the notion of totality. I will now briefly survey some of these results; I refer the reader to the paper for details.

They show that the 2-categorical definition of an adjunction $f\dashv g$ in terms of its unit and counit is equivalent to the condition $B(f,1) \cong A(1,g)$, which expresses the classical hom-set definition of an adjunction. This is an isomorphism of modules, and indeed, one benefit of a Yoneda structure is that it equips our 2-category with a notion of modules (a.k.a. profunctors): modules from $A$ to $B$ are arrows $A \longrightarrow P B$.

It is well known that a satisfactory theory of colimits in enriched category theory requires the consideration of colimits weighted by presheaves. However the natural generality of the theory calls for weighting by modules (presheaves on $A$ are modules from $I$ to $A$). Given a module $j\colon M \longrightarrow P A$ and an arrow $s\colon A \longrightarrow C$ (suitably admissible), we define the colimit $\text{colim}(j,s) \colon M \longrightarrow C$ of $s$ weighted by $j$ by the formula $C(\text{colim}(j,s),1) \cong (P A)(j,C(s,1))$. From this formula we can derive many familiar results such as the fact that left adjoints preserve colimits, associativity of colimits in the weight, and the Yoneda isomorphisms. Also we can introduce the notion of pointwise extension in terms of colimits and show that they are indeed extensions. Thus all the results of the calculus of colimits, which in enriched category theory depend on a “complicated machinery” involving enriched extranatural transformations, coends, enriched functor categories etc., in fact follow easily and formally in the context of the elementary notion of a 2-category with a Yoneda structure.

Street and Walters show that a certain result from Street’s earlier paper, the characterisation of the Eilenberg-Moore category of a monad in CAT as certain sheaves on the Kleisli category of the monad, holds for any Yoneda structure. They also show that in the presence of more properties of the 2-category (particularly a bo-ff factorisation of its arrows), we can make sense of the idea of the Kleisli object as a “full subcategory” of the Eilenberg-Moore object.

This paper introduced the notion of totality. An arrow $s \colon A \longrightarrow C$ is said to be total when $A$ and $s$ are admissible and the module $C(s,1) \colon C \longrightarrow P A$ has an admissible left adjoint. It follows immediately from the developed theory that this left adjoint $z$ must be given by $z j = \text{colim}(j,s)$ and be the pointwise left extension of $s$ along the Yoneda arrow $y_A$ (note that these assertions require all the admissibility assumptions in the definition). Such adjunctions are absolutely fundamental to the use of category theory; they sometimes go by the name of nerve and realization.

An object $A$ is said to be total when the identity arrow $1_A$ is total; this is the same as saying the Yoneda arrow $y_A \colon A \longrightarrow P A$ has a left adjoint. This can be thought of as a sort of strong cocompleteness property. In particular we get a “very satisfactory” adjoint functor theorem: if $A$ is total, an arrow $f \colon A \longrightarrow B$ has a right adjoint if and only if $B(f,1)$ is admissible and $f$ preserves the colimit $\text{colim}(B(f,1),1)$.

### Examples

Important motivating examples of 2-categories with Yoneda structures are 2-categories of internal categories (see the papers of Street and Weber) and enriched categories, in particular CAT is the 2-category of categories internal to SET. Given categories $\mathcal{E}$ and $\mathcal{V}$ suitably nice and approriate for internalisation and enrichment respectively, we get Yoneda structures on the 2-categories Cat$(\mathcal{E}$) and $\mathcal{V}$-Cat roughly as follows. For such a category $\mathcal{C}$, the size structure arises from an object $S$ of $\mathcal{C}$ which is in some way understood as a “full subcategory” of $\mathcal{C}$; for internal categories, this can be characterised as an internal full subcategory, or equivalently, a classifying discrete opfibration. Then the objects $P A$ arise as exponentials $S^{A^{op}}$, and the Yoneda arrows are exponential adjoints of hom-functors.

The 2-category LEX of finitely complete categories and finitely continuous functors inherits a Yoneda structure from CAT. This example is of interest because the total objects are (almost) Grothendieck toposes.

Another example, not treated in this paper but in this later paper of Street, are 2-categories of variable categories. These are of the form $\mathcal{K}$ = Hom($\mathcal{E}^{op}$,CAT), consisting of pseudofunctors, pseudonatural transformations, and modifications. I mention this example here for the interesting way in which the size structure arises. An arrow $f \colon A \longrightarrow B$ in $\mathcal{K}$ is admissible if for every $a\colon U \longrightarrow A$ and $b \colon V \longrightarrow B$ where $U$ and $V$ are representables on objects of $\mathcal{E}$, the comma object $f a/b$ is representable.

## Re: An Exegesis of Yoneda Structures

This is awesome, Alex. Thanks a lot!