analogy drawing example plain technical

Metric Spaces


Metric spaces are like intuitive maps.

When we give each other directions, we often speak in terms of the familiar. The maps we draw for each other are subjective. We omit and add information about how to get from one place to another based on where we are and who we are talking to.

image of metric spaces defined using Euclidean distance and Manhattan distance
a) Euclidean distance
b) Manhattan, or taxicab, distance

Metric spaces are sets combined with a specific distance measure called a metric. For example, you could measure the distance from one coffee shop to another in terms of the distance a taxicab drives to get from one to the other.

In this case, the setwould include two points, the two coffee shops, and the distance measure used would be the taxicab distance.


Metric spaces are visual by nature.

A metric space is a set combined with a distance measure.

TODO: interactive simulation of p-adic space


The real line as a metric space

Dots on a horizontal line
The distance from point x to point y on the real line is measured by absolute difference.

The real line is a metric space with the distance function d ( x , y ) = | x y |

Plain Description

Metric spaces are maps that place similar items next to each other.

Metrics are distance measures that describe similarity. You can describe similarity using physical distance or any other distance measure that satisfies these qualities:

A crude illustration of the triangle inequality.
The distance from point A to point B is never larger than the distance from point A, to point C, to point B.


Every distance measure satisfies four constraints.

d ( x , y ) 0
never be negative

d ( x , x ) = 0
and if
d ( x , y ) = 0
x = y
implies positive distance between two distinct points

d ( x , y ) = d ( y , x )
distance between two distinct points doesn't change depending on direction of measurement

d ( a , b ) d ( a , c ) + d ( c , b )
satisfy the triangle inequality:
the distance from point A to point B is never larger than the distance from point A, to a point between them (like point C), to point B