Nonobvious examples of metric spaces that do not work like $\mathbb{R}^n$

Nice question. I'm not sure that this will be exactly what you want, but let's go for it: consider $X = \{A,B,C,D\}$, and define $d: X \times X \to \Bbb R$ putting $d(p,p) = 0$ for all $p \in X$, $d(p,q) = d(q,p)$ for all $p,q \in X$, and:

$$d(A,B) = d(A,C) = d(B,C) = 2, \qquad d(A,D) = d(B,D) = d(C,D) = 1.$$ Here, $1$ and $2$ are for simplicity (note: $1 < 2$). Here's a picture:

enter image description here

I like to think that this little space is useful for convincing myself that a result I'm seeing for the first time is true.


Here is one that comes up pretty frequently. Consider a graph $(V,E)$ where $V$ is the set of vertices and $E$ the set of edges. For two vertices $v,w\in V$ define $$ d(v,w) = \text{length of shortest path between}~v~\text{and}~w. $$ You can check this is a metric fairly easily. It has applications in discrete mathematics (where you may want to use metric space properties to study a graph), which probably isn't surprising. What may surprise you is that it also has applications in group theory: one can represent a group using a graph (the Cayley graph), and then this metric defines what is called the word metric on the graph. This is one of the topics one might study in geometric group theory.


I think completely ruling out subsets of $\,\mathbb{R}^n$ misses the point.

Suppose you have a curved surface (for definiteness, sitting in 3-space). If you want to stay inside it, as we do when considering large distances here on earth, we don't use the ambient space metric, but rather the arclength of the shortest path between 2 points, called the geodesic. This metric space can be very different from the ambient space (for instance, the sphere is compact).

Also, the reason your professor's drawing is so useful is because that's precisely the idea metric spaces try to capture: they are sets where we have tools to filter points with balls of arbitrary length. Once we identify a problem can be phrased in the language of metric spaces, our experience with these drawings gives us instant intuition, and enables us to ask the right questions. In abstract places like function spaces, it's this kind of "ball reasoning" that lets us produce beautiful theorems like the Stone-Weierstrass Theorem , even when it might difficult to visualize what ball of functions looks like.