The Unapologetic Mathematician

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 $\mathcal{V}$, 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 $\infty$ 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 $V$ are the points in the “interval” $\left[0,\infty\right]$, and we have an arrow $x\rightarrow y$ exactly when $x\geq y$.

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 $x_1\geq y_1$ and $x_2\geq y_2$ then $x_1+x_2\geq y_1+y_2$, 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 $\mathcal{V}$-category $\mathcal{C}$. Here’s how the definition looks.

We have a set of objects $\mathrm{Ob}(\mathcal{C})$ that we’ll call “points” in a set $X$. Between any two points $p_1$ and $p_2$ we need a hom-object $\hom_\mathcal{C}(p_1,p_2)\in\mathrm{Ob}(\mathcal{V})$. That is, we have a function $d:X\times X\rightarrow\left[0,\infty\right]$.

For a triple $(p_1,p_2,p_3)$ of objects we need an arrow $\hom_\mathcal{C}(p_2,p_3)\otimes\hom_\mathcal{C}(p_1,p_2)\rightarrow\hom_\mathcal{C}(p_1,p_3)$. In more quotidian terms, this means that $d(p_2,p_3)+d(p_1,p_2)\geq d(p_1,p_3)$.

Also, for each point $p$ there is an arrow from the identity object of $\mathcal{V}$ to the hom-object $\hom_\mathcal{C}(p,p)$. That is, $0\geq d(p,p)$, so $d(p,p)=0$.

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 $d(p,p)=0$, and so we’re almost exactly giving the definition of a pseudometric space.

The only thing we’re missing is the requirement that $d(p_1,p_2)=d(p_2,p_1)$. 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.

7 Comments	»

1. 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 | Reply

2. 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 | February 12, 2008 | Reply

3. 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 | Reply

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

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

Comment by | February 14, 2008 | Reply

5. Incidentally, on a closer look it seems that quasimetric spaces keep the condition that $d(x,y)=0$ if and only if $x=y$. That is, maybe what we’re looking at are pseudoquasimetric spaces. Or vice versa.

Comment by | February 14, 2008 | Reply

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

Comment by Todd Trimble | February 15, 2008 | Reply

7. 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 | February 29, 2008 | Reply

« Previous | Next »

About this weblog

This is mainly an expository blath, with occasional high-level excursions, humorous observations, rants, and musings. The main-line exposition should be accessible to the “Generally Interested Lay Audience”, as long as you trace the links back towards the basics. Check the sidebar for specific topics (under “Categories”).

I’m in the process of tweaking some aspects of the site to make it easier to refer back to older topics, so try to make the best of it for now.
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 30, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9046666622161865, "perplexity_flag": "middle"}