Metric spaces · Definition

Metric space

topologymetric spaces

Measuring how far apart two objects are is the minimal tool for talking about nearness, limits and continuity beyond the real line.

Definition

A metric space is a set \(X\) together with a distance \(d\) between its points: a nonnegative number for each pair, symmetric, zero only between a point and itself, and satisfying the triangle inequality.

\[\begin{aligned}d(x,y)&=0\iff x=y,\qquad d(x,y)=d(y,x),\\ d(x,z)&\le d(x,y)+d(y,z)\end{aligned}\]

The guiding example is \(\mathbb{R}\) with \(d(x,y)=|x-y|\), and in \(\mathbb{R}^n\) the Euclidean distance \(d_2(P,Q)=\sqrt{\sum_i (p_i-q_i)^2}\). But the definition does not require the points to be numbers: they can be functions, words or sequences, as long as the distance satisfies the three axioms.

The axioms read as follows: distance is never negative and vanishes only between a point and itself (separation); going from \(x\) to \(y\) costs the same as from \(y\) to \(x\) (symmetry); and a detour through \(y\) never shortens the path from \(x\) to \(z\) (triangle inequality). The last one fails most often: \((x-y)^2\) is symmetric and separates points, but for \(0,1,2\) it gives \(4>1+1\).

One set admits many metrics. On \(\mathbb{R}^2\) the Euclidean, the taxicab \(d_1=|p_1-q_1|+|p_2-q_2|\) and the max distance \(d_\infty\) coexist, and always \(d_\infty\le d_2\le d_1\). There is also the discrete metric, with \(d(x,y)=1\) if \(x\ne y\), which makes all points equidistant. Every subset of a metric space inherits the restricted metric.

With distance in hand we can define the open ball, and from it open sets, limits of sequences and continuity. That is the path this topic follows toward general topology.

Think about it

Is \(d(x,y)=\sqrt{|x-y|}\) a metric on \(\mathbb{R}\)?

Yes. It is nonnegative, symmetric and vanishes only if \(x=y\). For the triangle inequality, note that \(\sqrt{a+b}\le\sqrt a+\sqrt b\) for \(a,b\ge0\), applied to \(a=|x-y|\) and \(b=|y-z|\).

If two distinct points had distance zero, what would stop working?

Points could not be told apart by distance: a small ball around one would contain the other, and the limit of a sequence would no longer be unique.

Exercises 10

References

  • James R. Munkres, Topology, 2nd edition, Pearson, 2000. §20
  • Bert Mendelson, Introduction to Topology, 3rd edition, Dover Publications, 1990. cap. 2