## April 17, 2023

### 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.

Posted at April 17, 2023 12:33 PM UTC

TrackBack URL for this Entry:   https://golem.ph.utexas.edu/cgi-bin/MT-3.0/dxy-tb.fcgi/3461

### 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?

Posted by: Fran Burstall on April 17, 2023 6:39 PM | Permalink | Reply to this

### Re: Metric Spaces as Enriched Categories I

Thanks Fran. There is no vector space structure on $\mathcal{B} A$ yet. And there is no difference between $\mathcal{B} A$ and $\mathcal{B} G$ yet. (Well there is the fact that $\mathcal{B} G$ has a finite hom-set and $\mathcal{B} A$ has an infinite hom-set, but that’s not terribly important at this point.) They are both just one object categories.

I guess that’s not clear. Is there a place in particular where this confusion arises?

Posted by: Simon Willerton on April 17, 2023 8:31 PM | Permalink | Reply to this

### Re: Metric Spaces as Enriched Categories I

Simon wrote:

And there is no difference between ℬA and ℬG yet.

Not yet. But someday, in the fullness of time, the fact that A is an algebra will make ℬA into a special sort of category called an algebroid with one object, and the fact that G is a group will make ℬG into a special sort of category called a groupoid with one object.

I guess you see a pattern: a thing gives a one-object thingoid. The fun really starts when you study general thingoids. Posted by: John Baez on April 20, 2023 1:42 AM | Permalink | Reply to this

### Mozibur Rahman

I got interested in magmas recently and I was pondering how we can get a many object magma - a magmoid. Then a magma ought to be a singleton magmoid. Since morphisms in categories are associative by definition, it seems to me that categories can’t do this, even if enriched over some other base category. But I see from NLab there is such a thing as a semicategory where the identity axiom is dropped. So why not also allow the associativity to be dropped?

I haven’t heard of such a thing but that doesn’t mean it can’t exist. Perhaps it is in hiding somewhere.

If we call such a category, a magmoid then a single object such category ought to be a magma. Personally, I think it ought to be called a magmatory as magmoids make me think of groupoids and all morphisms in groupoids are invertible. So a magmoid ought to be a magmatory where all morphisms are invertible. Usually we would need an identity to define inverses in magmas but I see again in NLab that there is such a thing as an invertible magma which doesn’t require identities to defined beforehand. I don’t see why this can’t be lifted to a magmatory. I expect similar non-associative structures like quasigroups and loops ought to fit into this framework.

Probably this is all wrong as I’m an amateur at this. Still its fun inventing neologisms ;-).

That leads me onto another question. Is there a more compact name for an associative magma? There is semigroup. And there is semi-monoid. But personally I think such a basic idea ought to have its own name rather than being semi something else.

Posted by: Mozibur Rahman Ullah on May 4, 2023 12:38 PM | Permalink | Reply to this

Post a New Comment