## Metric Spaces are Categories!

A guest post by Tom Leinster over at *The n-Category Café* reminded me of an interesting fact I haven’t mentioned yet: a metric space is actually an example of an enriched category!

First we’ll need to pick out our base category , in which we’ll find our hom-objects. Consider the set of nonnegative real numbers with their real-number order, and add in a point called that’s above all the other points. This is a totally ordered set, and orders are categories. Let’s take the opposite of this category. That is, the objects of our category are the points in the “interval” , and we have an arrow exactly when .

This turns out to be a monoidal category, and the monoidal structure is just addition. Clearly this gives a monoid on the set of objects, but we need to check it on morphisms to see it’s functorial. But if and then , and so we can see addition as a functor.

So we’ve got a monoidal category, and we can now use it to form enriched categories. Let’s keep out lives simple by considering a small -category . Here’s how the definition looks.

We have a set of objects that we’ll call “points” in a set . Between any two points and we need a hom-object . That is, we have a function .

For a triple of objects we need an arrow . In more quotidian terms, this means that .

Also, for each point there is an arrow from the identity object of to the hom-object . That is, , so .

These conditions are the first, fourth, and half of the second conditions in the definition of a metric space! In fact, there’s a weaker notion of a “pseudometric” space, wherein the second condition is simply that , and so we’re almost exactly giving the definition of a pseudometric space.

The only thing we’re missing is the requirement that . The case can be made (and has been, by Lawvere) that this requirement is actually extraneous, and that it’s in some sense more natural to work with “asymmetric” (pseudo)metric spaces that are exactly those given by this enriched categorical framework.

Is there a standard term for something that satisfies the axioms of a pseudometric space except for symmetry?

The Wikipedia page on pseudometric spaces doesn’t list any more general concept.

Comment by Jeremy Henty | February 12, 2008 |

I really don’t know whether there is or not. Tom certainly didn’t mention one in the post that reminded me about this fact.

Comment by John Armstrong | February 12, 2008 |

Aha! It’s a quasimetric space:

http://en.wikipedia.org/wiki/Quasimetric_space

http://planetmath.org/?op=getobj&from=objects&name=QuasimetricSpace

Comment by Jeremy Henty | February 14, 2008 |

Sorry, Jeremy, the links triggered the spam demon. Fixed now.

Anyhow, that’s brilliant. Thanks for turning up that term.

Comment by John Armstrong | February 14, 2008 |

Incidentally, on a closer look it seems that quasimetric spaces keep the condition that if

and only if. That is, maybe what we’re looking at arepseudoquasimetric spaces. Or vice versa.Comment by John Armstrong | February 14, 2008 |

Or almost pseudoquasimetric, since the Lawvere definition you’re using includes as a possible distance.

Comment by Todd Trimble | February 15, 2008 |

You might want to check out Dictionary of Distances by Deza & Deza (Elsevier, 2006) for names for various almost-metrics. They aren’t quite consistent with those listed in Wikipedia (which I liked, because they had a name for every subset of the metric axioms, including hemimetric and prametric, for example). It also seems that the names pseudo-, quasi- and (especially) semi-metric aren’t used 100% consistently in the literature.

Comment by Magnus Lie Hetland | February 29, 2008 |