Enriching Over a Category of Subsets
Posted by Simon Willerton
Several of us here at the Café are fans of Lawvere’s paper on enriched categories:
- Metric spaces, generalized logic, and closed categories, FW Lawvere, Republished in: Reprints in Theory and Applications of Categories, No. 1 (2002) pp 1-37.
What I would like do here is expand on a part of the paper that I haven’t seen mentioned elsewhere, although I haven’t looked very hard, about enriching over a category of subsets of some fixed set. I will show how this leads, for instance, to the following generalized metric on the set of continuous functions , where means the Lebesgue measure:
It also leads to the following symmetrized version which is a metric in the classical sense:
I would be interested to hear if anyone has any other examples of categories enriched over subsets of some set.
I will start with a brief introduction to enriched categories for those who aren’t so regular round here – the rest of you can skip to the following section.
Enriched categories and metric spaces
I never realised that enriched categories were so much fun until I read the paper of Lawvere and saw that the enriching category did not have to be concrete. Let me ‘remind’ you what that means.
You can try to imagine discovering enriched category theory after noticing that in many categories the hom-sets have extra structure. For instance, the category of representations of a fixed group has hom-sets which naturally have the structure of vector spaces, the category of abelian groups has hom-sets which naturally have the structure of abelian groups and the category of smooth surfaces and diffeomorphisms has hom-sets which naturally have the structure of topological spaces; furthermore in these cases the composition map respects this extra structure in some sense, so it is a bilinear map, a ‘bilinear’ group homomorphism and a continuous map respectively in the previous three examples. We can say that the hom-sets are ‘enriched’ or indeed that the category is enriched. This leads us to attempt to formalize this situation and we come up with the following.
We suppose that is a category of “sets with extra structure” which has a monoidal product and a monoidal unit , and that now our “hom-sets” will live in rather than in the category of sets. So a “category enriched in ”, which we will call , will consist of a set of objects and the following data. (Although I don’t think this would have been anyone’s first guess!)
- For every pair there is a set with structure .
- For every triple there is a morphism in giving composition: .
- For each object there is an identity given by a morphism in from the unit object: .
This data has to satisfy appropriate associativity and the identity conditions which I won’t write down, but which you can find at the nlab.
This allows us to talk about categories enriched over vector spaces or abelian groups or topological spaces by choosing appropriately. But it also allows us to do much more. The phrase “sets with extra structure” was an absolute red herring. The definition does not mention the elements of any hom-set: so we can define categories enriched over an any monoidal category. One potential problem with doing that is that we can no longer talk about morphisms in the enriching category: we can only talk about the -object which might not have any elements. Let’s look at a standard example of a non-concrete enriching category.
The classic example, due to Lawvere, is where we consider to be the monoidal category which has the extended non-negative real numbers as its set of objects and a single morphism from to if (so this is with the opposite of the usual poset structure considered by category theorists). The monoidal product is the sum of real numbers and thus the monoidal unit is .
Unpacking the definition, a category enriched over consists of a set with a number associated to each pair of objects. The existence of composition and identity morphisms means precisely that there are inequalities
The first inequality is the triangle inequality and the second is more simply written as . The associativity and identity conditions turn out to be vacuous in this case.
This means that any classical metric space gives rise to such an -enriched category with the objects being the points of the space and being the distance between and .
However, not every -enriched category arises from a classical metric space because there are three differences.
- The “distances” can be infinite.
- Symmetry is not imposed, so we could have .
- There can be zero “distance” between different points, so does not necessarily imply .
None-the-less, it is not difficult to come up with examples which show that this more general notion of metric space is very natural. For instance could be the minimum time, or the minimum cost required to travel from to .
This means that the theory of metric spaces is to some extent subsumed by the theory of enriched categories. Read on for some more examples.
Enriching over a set of subsets
Now another class of examples of monoidal categories to enrich over that Lawvere gives is the following. Suppose that is set. Let be some set of subsets of which contains the empty set and is closed under disjoint union: put the order on which is given by supersets. So we get a category whose objects are subsets of contained in and where there is a morphism if (this is the opposite of the usual poset structure on the set of subsets of a set). The monoidal product of two subsets is defined to be their union and the unit of the monoidal structure is therefore the empty set.
One example, which we will call , is when we take all subsets of . This is very well behaved when is finite, for larger sets, with extra structure such as a topology or a measure, we could consider the set of open sets or the set of measurable sets.
Examples
The only example of a category enriched over such a category of subsets that Lawvere gives is Example 3 below – and this is the category enriched over itself – so I thought I would try to come up with some other examples. I would be interested to hear of any other examples, in particular categories that are not based on the set of functions on .
Example 1a
This is the first example that sprang to mind. For a set, the category of all subsets of and , a set define the -enriched category to have as its objects the set of functions and to have as the hom-object (or the difference, or the distance) between functions and the set of points in at which and differ:
(For some reason, the example that comes to mind here is when and represent two strands of DNA with being the set of sites and being the set of nucleotides .)
This “has composition”
because if then either or . This is the contrapositve of, and hence equivalent to, the usual transitivity of equality: if and then . Actually in this case it might be better to call this decomposition rather than composition, because rather than saying given a morphism in and a morphism in you get a morphism in , it says that given a morphism in the latter, it must be in one of the former, namely or .
The ‘existence of an identity’ for is
which just says that agrees with itself everywhere.
Example 1b
In this slight modification of the above example we can take to be the interval and consider the category consisting of Lebesgue measurable subsets of . Then we can define to be the -enriched category where the objects are the continuous functions and the distance from to is given by the set of points at which they differ.
We have because as and are continuous, the set of points at which they differ is an open set and hence Lebesgue measurable (that’s a basic piece of measure theory that look me a while to figure out). This gives rise to an enriched category for the same reasons as in Example 1a.
There are possibly other classes of functions which would give rise to measurable sets in this way, but my analysis is maybe not up to the job of figuring it out.
Example 2
Another example is if we take which will have the same set of objects as , i.e., the set of all subsets of and the hom-object between subsets and is defined to be their symmetric difference:
The astute amongst you will be thinking two things at this point.
- “Ah! That this is just the same as Example 1a where we take to be a two element set.”
- “Hmmm. We’re taking the symmetric difference. We know that generalized notions of difference don’t have to be symmetric, and there is clearly a natural non-symmetric way to do this.”
The latter thought leads us to our next example.
Example 3
We can make the set of all subsets of into a category enriched over itself. That’s a slightly confusing to say – how can be an ordinary category and an -enriched category? – but it what folks say. To try to reduce confusion I’ll use to denote the enriched version. We take the distance, or hom-object between two subsets to be the set-theoretic difference.
So you can think that to get from to you have to pick an element of that you don’t already have in .
The key reason this is a self-enrichment, if you know about such things, is that there is the relation
or, in other words,
This means that the underlying category (see below) of the enriched category is the ordinary category .
Example 4a
We can now generalize Examples 1a, 2 and 3. Suppose that is a preorder, i.e., is a set and is a transitive and reflexive relation. Define to be the category enriched over which has the set of functions as its objects and the hom-object, or distance, from to is defined to be the set of points where does not dominate :
Just as in Example 1a above, the “composition”
comes precisely from the contrapositive of the transitivity of the order relation .
Example 1a is obtained by taking the trivial preorder on , by which I mean the preorder is precisely equality . Example 3 is obtained by taking the preorder – you might need to think for a minute why that is true.
Example 4b
We can do a similar thing to the previous example, but in the vein of Example 1b using the standard order on the real numbers . We obtain a category, which I’ll call , enriched over , the measurable subsets of the interval , whose objects are continuous functions and whose distances are given by
(Note that as we have a linear order is the same as .) Just as in Example 1b these are open subsets of , thus Lebesgue measurable and hence objects in .
Lax monoidal functors and change of basis
Now let’s return to another chunk of general enriched category theory. If we have monoidal categories and and a lax monoidal functor (see below) then we get a way of obtaining a -category from a -category . This has the same set of objects as but the hom-object from to is, perhaps not unsurprisingly, .
Recall that a functor between monoidal categories is lax monoidal when there are natural morphisms for each and
satisfying appropriate conditions.
For example, every monoidal category comes equipped with a lax monoidal functor which is the “global elements” or “sections” functor
Given a -category the resulting ordinary category is referred to as the underlying category of .
In the case of a generalized metric space the underlying category is a preorder structure on the points in the space and the preorder is defined by if and only if ; similarly in the case of a category enriched over the underlying category is a preorder on the objects of the enriched category and the preorder is defined by if and only if .
Generalized metric spaces from subset-enriched categories
How about changing a -category into a generalized metric space? Clearly, one way to do this would be to have a lax monoidal functor which would mean having an association of a non-negative number to each subset of in which satisfies
the other conditions turn out to be vacuous. In other words we require an outer measure on , or at least on the subsets of which lie in .
If is finite then there is the obvious counting measure or “number of elements”
which, for any set , gives rise to the metric space structure on the set of function , given on a pair of functions by counting the number of places at which they differ:
When is the interval there is the Lebesgue measure
By applying this to our two -categories and we get two generalized metric space structures on the set of continuous functions , namely the two mentioned in the introduction above:
and
Inadvertently I have managed to combine two themes that Tom has been writing about recently, namely enriched categories and measures. Of course I could also have done this by talking about the magnitude of measure spaces, but that’s another story…
Re: Enriching Over a Category of Subsets
Regarding Example 1b, you can generalize quite a lot. Suppose is any measurable space. Then measurability of functions , with respect to the Borel -algebra on , is preserved by linear combinations, and so is a measurable set. (Lebesgue measurable functions are measurable with respect to the Lebesgue -algebra on the domain and the Borel -algebra on the codomain, so your setup really is a special case of this.)
Jumping down to the end of the post, when is a finite set and is the counting measure, the metric is often called the Hamming metric, and is well known in discrete math. It’s used, for example, to metrize the symmetric group . I bet has been used in the same context as well, maybe in a more or less implicit way, though I can’t think of any examples off the top of my head.