# Principle - Metric spaces generalize distance

A metric space is a set \(X\) and an operation \(d: X \times X \rightarrow
\mathbb{R}\) and we commonly call \(d\) the “distance.”^{1} \(d\) has to obey some properties but they are really easy to reason out based on our intuition about distance.

If you take a measuring tape and measure from one end of the table to the other, do you need to flip the tape around and measure from the other end of the table? Of course not, you know they will produce the same measurement. In fancy math language we say \(\forall x,y \in X, d(x,y) = d(y,x)\) And we call this the symmetric property because mathematicians hate to mince words.

Now if we take out a piece of paper and put three points \(a,b,c\) on the paper and measure the distance between each pair of points, we will see that the distance between \(a\) and \(b\) plus the distance between \(b\) and \(c\) must **always** be more than the distance between \(a\) and \(c\). Now draw lines between these points. Obviously, you have a triangle. In fancy math speak we say \(\forall x,y,z \in X, d(x,z) \leq d(x,y) + d(y,z)\) and we call this the triangle inequality.

Lastly, if we say stand in the middle of the room and walk 0.0 meters in any direction what will you do? Stand still of course! In this case, you end up at the same point you started. We call this identity of indiscernables and then dump \(d(x,y) = 0 \iff x = y\) on the page.

So in short terse math speak, we have the following.

A metric space is a set \(X\) with a metric \(d: X \times X \rightarrow \mathbb{R}\) such that

- \(\forall x,y \in X, d(x,y) = d(y,z)\)
- \(\forall x,y,z \in X, d(x,z) \leq d(x,y) + d(y,z)\)
- \(d(x,y) = 0 \iff x = y\)

But don’t get tripped up by the math, it’s just the same notions of distance you know and love.

Any guesses why we chose \(d\) for the function?

↩︎