### Metric Spaces as Enriched Categories I

#### Posted by Simon Willerton

Last November I gave a talk entitled “Looking at metric spaces as enriched categories ” at the African Mathematics Seminar at the invitation of Café regular Bruce Bartlett. You may remember that John gave a seminar the month before me.

The talk was aimed at general pure mathematicians, with my main assumption being that the audience knew what a group action, a representation, a metric space and a category were.

My talk was in two halves, the first half was about enriched categories in general and how metric spaces can be viewed as enriched categories. The second half was about ‘applications’ of this that I’d been involved in, that was mainly an overview of the theory of magnitude of metric spaces and a little bit on directed tight spans because of the involvement of some African mathematicians.

I decided that I would write up the first half of the talk and that is what this post and the next post will be on. The definition of enriched category will come in the next post. Hopefully it is clear from the above that these two posts are likely to be rather basic as far as the regulars at the Café are concerned!

# Some category theory background

## Two general types of categories

As a mathematician you come across categories of various flavours; two general types of categories are the following.

Firstly there are the categories which consist of specific mathematical structures and structure preserving map. Here are some examples:

${\mathbf{\mathcal{V}ect}}$, vector spaces and linear maps;

${\mathbf{\mathcal{S}et}}$, sets and function;

${\mathbf{\mathcal{A}b}}$, abelian groups and group homomorphisms;

${\mathbf{\mathcal{T}op}}$, topological spaces and continuous maps;

${\mathbf{\mathcal{A}ct}}_G$, sets with right $G$-actions and equivariant maps, for a finite groups $G$;

${\mathbf{\mathcal{R}ep}}_A$, representations and intertwining maps for an algebra $A$.

In this post, for concreteness, we will work with vector spaces over the complex numbers, so in particular, an algebra means a complex vector space with an associative unital product; a good example of such an algebra is the group algebra $\mathbb{C}G$ for a finite group $G$.

Secondly, there are the categories that are themselves manifestations of standard mathematical structures. Here are some examples.

When $G$ is a finite group there is the one object category ${\mathbf{\mathcal{B}}}G$ with $G$ as its set of morphisms and with composition corresponding to multiplication in the group.

Similarly when $A$ is an algebra there is the one object category ${\mathbf{\mathcal{B}}}A$ with the underlying set of $A$ as its set of morphisms and with composition corresponding to multiplication in $A$.

For $(P, \le)$ a partially ordered set (poset) there is a category (also often called $P$) whose objects are the elements of $P$ and where there is at most one morphism between each pair of objects and a unique morphism $p\to q$ precisely when $p \le q$.

- For $T$ a topological space there is the poset $({\mathbf{\mathcal{O}}}_T, \subseteq)$ of open sets in $T$ ordered by inclusion, and hence the corresponding category ${\mathbf{\mathcal{O}}}_T$.

Certainly not all categories can necessarily be classified as one of these two types and the two types are very likely not disjoint, but highlighting these two types does give a perspective which can be helpful.

## Constructing new categories from old

Given categories ${\mathbf{\mathcal{C}}}$ and ${\mathbf{\mathcal{D}}}$ you can form the product category ${\mathbf{\mathcal{C}}}\times {\mathbf{\mathcal{D}}}$ where the objects of ${\mathbf{\mathcal{C}}}\times {\mathbf{\mathcal{D}}}$ are pairs $(c, d)$ with $c \in {\mathbf{\mathcal{C}}}$ and $d \in {\mathbf{\mathcal{D}}}$, and where each hom-set is simply the product of the appropriate hom-sets in ${\mathbf{\mathcal{C}}}$ and ${\mathbf{\mathcal{D}}}$, i.e. $\operatorname{Hom}((c, d), (c', d')) \coloneqq\operatorname{Hom}(c, c') \times \operatorname{Hom}(d, d')$. The composition is given in the obvious way: $(f, g) \circ (f', g') \coloneqq(f\circ f', g \circ g')$.

You can also define the functor category $[{\mathbf{\mathcal{C}}}, {\mathbf{\mathcal{D}}}]$ where the objects are the functors of the form $F \colon {\mathbf{\mathcal{C}}}\to {\mathbf{\mathcal{D}}}$ and the morphisms are the natural transformations between such functors.

As usual, ${\mathbf{\mathcal{C}}}^{\mathrm{op}}$ denotes the opposite category of ${\mathbf{\mathcal{C}}}$, and so the functor category $[{\mathbf{\mathcal{C}}}^{\mathrm{op}}, {\mathbf{\mathcal{D}}}]$ can be thought of as the category of contravariant functors from ${\mathbf{\mathcal{C}}}$ to ${\mathbf{\mathcal{D}}}$.

## Scalar-valued functors, or presheaves

For a given category ${\mathbf{\mathcal{C}}}$ we can take the functor categories $[{\mathbf{\mathcal{C}}}, {\mathbf{\mathcal{D}}}]$ and $[{\mathbf{\mathcal{C}}}^\mathrm{op}, {\mathbf{\mathcal{D}}}]$ in the special case where ${\mathbf{\mathcal{D}}}={\mathbf{\mathcal{S}et}}$ and consider the categories

$[{\mathbf{\mathcal{C}}}, {\mathbf{\mathcal{S}et}}] \quad \text{and} \quad [{\mathbf{\mathcal{C}}}^\mathrm{op}, {\mathbf{\mathcal{S}et}}].$

As we will see below, you can consider ${\mathbf{\mathcal{S}et}}$ to be the ‘base category’ or ‘category of scalars’ of ordinary category theory, analogous to a base ring or base field in algebra; so these two categories can be thought of as categories of ‘scalar-valued functors’, analogous to spaces of scalar-valued functions on sets or spaces.

Category theorists will often call
$[{\mathbf{\mathcal{C}}}^\mathrm{op}, {\mathbf{\mathcal{S}et}}]$ the
category of *presheaves* on ${\mathbf{\mathcal{C}}}$ for reasons given
below, and, by extension, will sometimes call
$[{\mathbf{\mathcal{C}}}, {\mathbf{\mathcal{S}et}}]$ the category of
*co-presheaves* on ${\mathbf{\mathcal{C}}}$. However, this terminology
does seem to obscure, in a slightly intimidating fashion, the
fundamental nature of these objects.

Let’s have a look at a couple of examples.

For $G$ a finite group and ${\mathbf{\mathcal{C}}}= {\mathbf{\mathcal{B}}}G$, the associated one-object category, we can obtain the category of of sets equipped with a right $G$-action ${\mathbf{\mathcal{A}ct}}_G$ and the category of of sets equipped with a left $G$-action ${}_G{\mathbf{\mathcal{A}ct}}$ as functor categories: ${\mathbf{\mathcal{A}ct}}_G\cong [{\mathbf{\mathcal{B}}}G^\mathrm{op}, {\mathbf{\mathcal{S}et}}], \quad {}_G{\mathbf{\mathcal{A}ct}}\cong [{\mathbf{\mathcal{B}}}G, {\mathbf{\mathcal{S}et}}] .$ For instance, if we have a functor $\rho \colon {\mathbf{\mathcal{B}}}G \to {\mathbf{\mathcal{S}et}}$ then the single object $\bullet \in {\mathbf{\mathcal{B}}}G$ gets sent to a set $S\coloneqq \rho(\bullet)$ and the action is given by the functor on the level of hom-sets, $\rho \colon G = \mathrm{Hom}_{ {\mathbf{\mathcal{B}}}G}(\bullet, \bullet) \to \mathrm{Hom}_{{\mathbf{\mathcal{S}et}}}(S, S)$.

For $X$ a topological space, the category of presheaves is defined to be the contravariant functor category $[{\mathbf{\mathcal{O}}}_X^\mathrm{op}, {\mathbf{\mathcal{S}et}}]$ and this is where the category theorists took the term ‘presheaf’ from.

## The Yoneda embedding

The Yoneda Lemma is one of the most fundamental results in category theory and a corollary of it is that the functor, the Yoneda embedding, from a category into its category of contravariant functors,

$y \colon {\mathbf{\mathcal{C}}}\hookrightarrow [{\mathbf{\mathcal{C}}}^\mathrm{op}, {\mathbf{\mathcal{S}et}}]; \quad y(c)(c') \coloneqq\operatorname{Hom}_{\mathbf{\mathcal{C}}}(c', c),$

is bijective on the level of hom-sets, i.e., it is a fully faithful embedding.

Similarly, the contravariant version to the other category of functors is also fully faithful:

$\overline{y} \colon {\mathbf{\mathcal{C}}}^\mathrm{op}\hookrightarrow [{\mathbf{\mathcal{C}}}, {\mathbf{\mathcal{S}et}}]; \quad \overline{y}(c)(c') \coloneqq\operatorname{Hom}_{\mathbf{\mathcal{C}}}(c, c').$

One analogy that it might be useful to bear in mind is the embedding of a discrete set into its ring of functions via the ‘delta-function’:

$\delta\colon S\hookrightarrow \operatorname{Functions}(S, R); \quad \delta(x)(y) \coloneqq\begin{cases} 1 & \text{if }x=y \\ 0 & \text{otherwise}, \end{cases}$

where $R$ could be any ring such as $\mathbb{Z}$ or $\mathbb{Z}/2\mathbb{Z}$, acting as the base ring.

If we consider the Yoneda embedding when we take ${\mathbf{\mathcal{C}}}={\mathbf{\mathcal{B}}}G$ where $G$ is a finite group, then we should have a fully faithful embedding

$y\colon {\mathbf{\mathcal{B}}}G^\mathrm{op} \hookrightarrow [{\mathbf{\mathcal{B}}}G, {\mathbf{\mathcal{S}et}}] = {}_G{\mathbf{\mathcal{A}ct}}.$

By definition ${\mathbf{\mathcal{B}}}G$ has a single object $\bullet$ with $\operatorname{Hom}_{{\mathbf{\mathcal{B}}}G}(\bullet, \bullet)=G$. You can check that $y(\bullet)$ is ${}^\mathrm{reg}{G}$, that is $G$ equipped with the left-regular $G$-action. Then $\operatorname{Hom}_{{\mathbf{\mathcal{B}}}G^\mathrm{op}}(\bullet, \bullet)=G^\mathrm{op}$ should act on the left-regular action ${}^\mathrm{reg}{G}$ by intertwining maps; this it does via the right regular action! The Yoneda embedding being fully faithful is then equivalent to having an isomorphism

$G^\mathrm{op}\xrightarrow{\sim} \operatorname{Hom}_{{}_G{\mathbf{\mathcal{A}ct}}}\left({}^\mathrm{reg}{G}, {}^\mathrm{reg}{G}\right).$

## Alternative base categories

An important observation at this point is that it is not always correct
to use ${\mathbf{\mathcal{S}et}}$ as the ‘base category’. For instance,
one feels that just as the category of $G$-actions
${\mathbf{\mathcal{A}ct}}_G$ is given by the functor category
$[{\mathbf{\mathcal{B}}}G, {\mathbf{\mathcal{S}et}}]$ so the
representation category ${\mathbf{\mathcal{R}ep}}_A$ should be given a
functor category like
$[{\mathbf{\mathcal{B}}}A, {\mathbf{\mathcal{V}ect}}]$, however this
does not quite work. You need to consider *linear* functors, thus taking
into account the fact that both $A$ and
$\operatorname{Hom}_{\mathbf{\mathcal{V}ect}}(V, V)$ should be thought
of as vector spaces rather than just sets. One way to do this is to use
the category of vector spaces as our base category and consider both
${\mathbf{\mathcal{B}}}A$ and ${\mathbf{\mathcal{V}ect}}$ as categories
enriched over ${\mathbf{\mathcal{V}ect}}$ and to take
$[{\mathbf{\mathcal{B}}}A, {\mathbf{\mathcal{V}ect}}]$ to be the
${\mathbf{\mathcal{V}ect}}$-enriched category of
${\mathbf{\mathcal{V}ect}}$ enriched functors. We should see what that
means!

We’re taking the perspective here that doing enriched category theory means doing category over a different base category, or category of scalars. This ‘enriching category’ needs certain basic structure, and if one insists on further structure then the theory becomes richer. (We’ll see this next time.) Anyway, the basic structure that is required is that of a monoidal category. A monoidal category $({\mathbf{\mathcal{V}}}, {\otimes}, \mathbb{1})$ consists of a category ${\mathbf{\mathcal{V}}}$, a ‘monoidal product’ ${\otimes} \colon {\mathbf{\mathcal{V}}}\times {\mathbf{\mathcal{V}}}\to {\mathbf{\mathcal{V}}}$ and a ‘monoidal unit’ object $\mathbb{1}\in {\mathbf{\mathcal{V}}}$, and these satisfy associativity and unit conditions which we needn’t worry about here.

Let’s consider some pertinent examples.

$({\mathbf{\mathcal{S}et}}, \times, \{\ast\})$: this is the category of sets with the cartesian product and a chosen one object set as the unit object; this is the usual ‘base category’.

$({\mathbf{\mathcal{V}ect}}, \otimes, \mathbb{C})$: this is the category of complex vector spaces with the tensor product and the base field as the unit object.

$\left(([0, \infty], \ge), +, 0\right)$: this is the partially ordered set of non-negative real numbers with infinity added, considered as a category, so there is a single morphism $a \to b$ precisely when $a \ge b$; this is equipped with addition as the product, and zero as the unit object. We will denote this monoidal category with $\overline{\mathbb{R}}_{+}$.

If you picture the non-negative reals as going upwards then you can imagine the morphisms as allowing you to slide downwards, but not upwards.

Next time we will see the definition of enriched category.

## Re: Metric Spaces as Enriched Categories I

I am not seeing how the examples $\mathcal{B}G$ and $\mathcal{B}A$ differ. In particular, where does the latter get its vector space structure from? What am I missing?