Metric spaces · Definition
Metric space
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.
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
- In \(\mathbb{R}^2\) with the Euclidean distance, what is the distance between \((1,2)\) and \((4,6)\)?
- With the taxicab distance \(d_1(P,Q)=|p_1-q_1|+|p_2-q_2|\), what is \(d_1((1,2),(4,6))\)?
- With the max distance \(d_\infty(P,Q)=\max\{|p_1-q_1|,|p_2-q_2|\}\), what is \(d_\infty((1,2),(4,6))\)?
- Let \(X\) carry the discrete metric (\(d(a,b)=1\) if \(a\ne b\) and \(d(a,a)=0\)). For three distinct points \(a,b,c\), what is \(d(a,b)+d(b,c)+d(a,c)\)?
- In a metric space, if \(d(x,y)=0\), what follows?
- Why is \(d(x,y)=|x^2-y^2|\) not a metric on \(\mathbb{R}\)?
- Let \(d(x,y)=(x-y)^2\) on \(\mathbb{R}\). For the points \(0,1,2\), what is \(d(0,2)-\big(d(0,1)+d(1,2)\big)\)?
- In \(\mathbb{R}^3\) with the Euclidean distance, what is the distance between \((3,4,8)\) and \((1,1,2)\)?
- For \(P=(0,0)\) and \(Q=(3,4)\) in \(\mathbb{R}^2\), which ordering of the distances \(d_\infty\), \(d_2\) (Euclidean) and \(d_1\) (taxicab) is correct?
- If \((X,d)\) is a metric space and \(A\subseteq X\), what happens to \(d\) restricted to \(A\times A\)?
References
- James R. Munkres, Topology, 2nd edition, Pearson, 2000. §20
- Bert Mendelson, Introduction to Topology, 3rd edition, Dover Publications, 1990. cap. 2