What is a Metric Space?

Given a set X, it is often helpful to define a notion of distance between points in this set. This distance function is called a metric.

Definition

metric space is a pair (X, d), where X is a set (the space) and is a function d: X × X → R (the metric) such that, for all x,y,z we have:

  • Non-negativity: d(x,y) ≥ 0, where d(x,y) = 0 iff x = y;
  • Symmetry: d(x,y) = d(y,x);
  • Triangle Inequality: d(x,z) ≤ d(x,y) + d(y,z).

Examples

Euclidean Metric: This is the usual metric used, and one that you are probably all familiar with.

Let X = R^n and

Screen Shot 2017-08-13 at 12.04.58 PM.png

This is the usual notion of distance that we have in the R^n vector space. Using the Cauchy-Schwarz inequality, we can easily show that this is a metric by showing that it satisfies the 3 axioms above.

Discrete Metric:

Let X be a set and
Screen Shot 2017-08-13 at 12.06.53 PM.png

The first two axioms are trivially satisfied, so to show that the above is indeed a metric, we just have to show that the third is also satisfied. We can prove this by exhaustion:

Since the distance function can only output 0 or 1, f(x,z) can be 0 or 1, while d(x,y) + d(y,z) can be 0, 1 or 2. For the third axiom to fail, it must be the case that the RHS < LHS, which can only happen if the RHS is 0. However, if the RHS is 0, we must have the x = y = z, so the LHS is also 0, showing us that the third axiom is always satisfied.

British Railway Metric:

Let X = R^2 and define

Screen Shot 2017-08-13 at 12.11.47 PM.png

To explain the name of this metric, think of Britain with London as the origin. Then in a less than ideal railway system, all trains go through London. For example, if you want to go from Oxford to Cambridge, then you would go from Oxford to London, and then from London to Cambridge. The resulting distance travelled would be the distance of both these journeys added up.

The exception is when the two destinations lie along the same line. In this case, you can take the train from one to the other without going through London – hence the if x = ky clause.

M x

One thought on “What is a Metric Space?”

Leave a comment