Skip to main content

Math 344-1,2: Kursobjekt

Section 1.3 Metric spaces

In this section we introduce a special family of topological spaces: metric spaces. These types of spaces are pervasive throughout mathematics and are conceptually very familiar or intuitive. Indeed, historically metric spaces were the main inspiration to axiomatic topology; and the metric balls defined in Definition 1.3.3 were the inspiration for the notion of a topological basis. Lastly, the defining structure of metric space, a metric \(d\text{,}\) gives us a quantitative grip on the topology, whereas generally in topology we must rely on the qualitative description of open sets given by the axioms.

Definition 1.3.1. Metric space.

A metric space is a pair \((X,d)\text{,}\) where \(X\) is a set and \(d\colon X\times X\rightarrow \R\) is a function satisfying the following axioms:
  1. Positivity.
    \(d(x,y)\geq 0\text{,}\) and \(d(x,y)=0\) if and only if \(x=y\text{,}\) for all \(x,y\in X\text{.}\)
  2. Symmetry.
    \(d(x,y)=d(y,x)\) for all \(x,y\in X\text{.}\)
  3. Triangle inequality.
    \(d(x,y)\leq d(x,z)+d(z,y)\) for all \(x,y,z\in X\text{.}\)
The function \(d\) is called a metric or a distance function on \(X\text{,}\) and for any \(x,y\in X\) we call \(d(x,y)\) the distance between \(x\) and \(y\text{.}\)

Definition 1.3.2. Euclidean, box, and taxicab metrics.

Let \(X=\R^n\text{,}\) where \(n\) is a positive integer. Let \(\boldx=(x_1,x_2,\dots, x_n), \boldy=(y_1,y_2,\dots, y_n)\text{.}\)
  1. Euclidean metric.
    The function \(d\colon X\times X\rightarrow \R\) defined as
    \begin{equation*} d(\boldx,\boldy)=\sqrt{(x_1-y_1)^2+(x_2-y_2)^2+\cdots +(x_n-y_n)^2} \end{equation*}
    is a metric, called the Euclidean metric. The metric space \((\R^n, d)\) is called Euclidean \(n\)-space. The norm of \(\boldx\text{,}\) denoted \(\norm{\boldx}\text{,}\) is defined as
    \begin{equation*} \norm{\boldx}=d(\boldx, \boldzero)=\sqrt{x_1^2+x_2^2+\cdots +x_n^2}\text{.} \end{equation*}
  2. Box metric.
    The function \(d\colon X\times X\rightarrow \R\) defined as
    \begin{equation*} d(\boldx,\boldy)=\max\{\abs{x_1-y_1},\abs{x_2-y_2},\dots, \abs{x_n-y_n}\} \end{equation*}
    is a metric, called the box metric (or square metric).
  3. Taxicab metric.
    The function \(d\colon X\times X\rightarrow \R\) defined as
    \begin{equation*} d(\boldx,\boldy)=\abs{x_1-y_1}+\abs{x_2-y_2}+\dots +\abs{x_n-y_n} \end{equation*}
    is a metric, called the taxicab metric.

Proof.

  1. It is easiest to prove that the Euclidean metric is indeed a metric by first expressing it in terms of the dot product as
    \begin{equation*} d(\boldx, \boldy)=\sqrt{(\boldx-\boldy)\cdot (\boldx-\boldy)} \end{equation*}
    and then using well-known properties of the dot product, including the Cauchy-Schwarz inequality.
  2. Let \(d\) be the box metric. It is clear that \(d(\boldx, \boldy)\geq 0\) for all \(\boldx, \boldy\in \R^n\text{.}\) Furthermore, we have
    \begin{align*} d(\boldx, \boldy)=0 \amp \iff \abs{x_i-y_i}=0 \text{ for all i}\\ \amp \iff x_i-y_i=0 \text{ for all i} \\ \amp \iff x_i=y_i \text{ for all i}\\ \amp \iff \boldx=\boldy\text{.} \end{align*}
    This proves positivity. The symmetry follows easily from the fact that \(\abs{x-y}=\abs{y-x}\text{.}\) As for the triangle inequality, for all \(1\leq i\leq n\) we have
    \begin{equation*} \abs{x_i-y_i}=\abs{x_i-z_i+z_i-y_i}\leq \abs{x_i-z_i}+\abs{z_i-y_i}\leq d(\boldx, \boldz)+d(\boldz,\boldy)\text{,} \end{equation*}
    where the leftmost inequality is the triangle inequality for the absolute value, and the rightmost inequality follows from the definition of \(d\text{.}\) Since the inequality holds for all \(1\leq i\leq n\text{,}\) we conclude that
    \begin{equation*} d(\boldx,\boldy)=\max\{\abs{x_i-y_i}\colon 1\leq i\leq n\}\leq d(\boldx,\boldz)+d(\boldz,\boldx)\text{.} \end{equation*}
  3. This is a homework exercise.

Definition 1.3.3. Metric balls.

Let \((X,d)\) be a metric space. Given \(x\in X\) and \(\epsilon> 0\) the \(d\)-metric ball of radius \(\epsilon\) centered at \(x\) is the subset \(B_\epsilon(x)\subseteq X\) defined as
\begin{equation*} B_\epsilon(x)=\{y\in X\colon d(x,y)< \epsilon\}\text{.} \end{equation*}
In other words, \(B_\epsilon(x)\) is the set of all elements of \(X\) lying within a distance of \(\epsilon\) of \(x\text{.}\) We call \(\epsilon\) the radius of \(B_\epsilon(x)\text{.}\) More generally, we call a subset \(U\subseteq X\) a \(d\)-metric ball if \(U=B_\epsilon(x)\) for some \(x\in X\) and \(\epsilon> 0\text{.}\) When it is clear what the underlying metric is, we will omit \(d\) and speak simply of metric balls.

Example 1.3.4. Metric balls for Euclidean and box metrics.

Describe the metric balls for the Euclidean and box metrics on \(\R^n\) for \(n=1,2,3\text{.}\)
Solution.
For \(n=1\) the two metrics are just \(d(x,y)=\abs{x-y}\text{,}\) the same one we used to define the standard topology on \(\R\text{.}\) Epsilon balls here are just intervals of the form \((x-\epsilon, x+\epsilon)\text{.}\)
For \(n=2,3\) the Euclidean distance defined is the standard distance between two points in \(\R^2\) or\(\R^3\text{.}\) The set of points \(\boldy\) satisfying \(d(\boldx, \boldy)=\epsilon\) is thus the circle of radius \(\epsilon\) centered at \(\boldx\) for \(n=2\text{,}\) and the sphere of radius \(\epsilon\) centered at \(\boldx\) for \(n=3\text{.}\) It follows that an \(\epsilon\)-ball \(B_\epsilon(\boldx)\) is the interior of the this circle or sphere, respectively.
True to its name, an \(\epsilon\)-ball around \(\boldx\in \R^n\) is the open \(n\)-cube
\begin{equation*} \prod_{i=1}^n (x_i-\epsilon, x_i+\epsilon)\text{.} \end{equation*}
(Note that the product here is the Cartesian product of these intervals. (See Definition 0.1.12.)) Indeed, we have
\begin{align*} \boldy\in B_\epsilon(\boldx) \amp \iff \max\{\abs{x_i-y_i}\}_{i=1}^n< \epsilon \\ \amp \iff \abs{x_i-y_i}< \epsilon \text{ for all } 1\leq i\leq n\\ \amp \iff y_i\in (x_i-\epsilon, x_i+\epsilon) \text{ for all } 1\leq i\leq n\\ \amp \iff \boldy\in \prod_{i=1}^n (x_i-\epsilon, x_i+\epsilon)\text{.} \end{align*}

Proof.

Since \(y\in B_\epsilon(x)\text{,}\) we have \(d(x,y)< \epsilon\) and hence \(\delta=\epsilon-d(x,y)> 0\text{.}\) We claim that \(B_\delta(y)\subseteq B_\epsilon(x)\text{.}\) Indeed, we have
\begin{align*} z\in B_\delta(y)\implies d(z,x)\amp\leq d(z,y)+d(y,x) \amp (\text{triangle ineq.})\\ \amp < \delta+(\epsilon-\delta) \\ \amp = \epsilon\text{.} \end{align*}
It follows that \(z\in B_\epsilon(x)\text{,}\) proving \(B_\delta(y)\subseteq B_\epsilon(x)\text{.}\)

Topological specimen 7. Metric spaces.

Let \((X,d)\) be a metric space. The set
\begin{equation*} \mathcal{B}=\{B_\epsilon(x)\colon x\in X, \epsilon> 0\} \end{equation*}
of all metric balls is a topological basis, giving \(X\) the structure of a topological space. We say the topology \(\mathcal{T}\) generated by \(\mathcal{B}\) the topology is induced by the metric \(d\text{.}\)
With respect to this topology we have
\begin{align} U\text{ open } \amp \iff U=\bigcup_{i\in I} B_{\epsilon_i}(x_i) \text{ for some } B_{\epsilon_i}(x_i)\in \mathcal{B}\tag{1.3.1}\\ \amp \iff \text{ for all } x\in U \text{ there exists } z\in X \text{ and } \delta > 0 \text{ s.t. } x\in B_\delta(z)\subseteq U\tag{1.3.2}\\ \amp\iff \text{ for all } x\in U \text{ there exists } \epsilon> 0 \text{ s.t. } B_\epsilon(x)\subseteq U \text{.}\tag{1.3.3} \end{align}

Proof.

We must prove (1) that \(\mathcal{B}\) is a basis, and (2) that the description of openness in (1.3.3) is correct. (The descriptions in (1.3.1) and (1.3.2) follow directly from Definition 1.2.6.)
  1. For all \(x\in X\text{,}\) we have \(x\in B_1(x)\in \mathcal{B}\text{,}\) proving the first axiom of Definition 1.2.1. Next, let \(B_1=B_{\epsilon_1}(x_1), B_2=B_{\epsilon_2}(x_2)\) be two metric balls. Given \(y\in B_1\cap B_2\text{,}\) there are \(\delta_1, \delta_2\) such that \(B_{\delta_i}(y)\subseteq B_i\) for \(i=1,2\text{.}\) Setting \(\delta=\min\{\delta_1, \delta_2\}\text{,}\) we have \(y\in B_\delta(y)\subseteq B_1\cap B_2\text{.}\) This proves the second axiom.
  2. Using the description of the topology generated by a basis articulated by (1.2.1) , we have
    \begin{align*} U \text{ open } \amp \iff \text{ for all } x\in U \text{ there exists } z\in X \text{ and } \delta > 0 \text{ s.t. } x\in B_\delta(z)\subseteq U \\ \amp \iff \text{ for all } x\in U \text{ there exists } \epsilon > 0 \text{ s.t. } B_\epsilon(x)\subseteq U \amp (\knowl{./knowl/xref/lemma_metric.html}{\text{1.3.5}})\text{.} \end{align*}

Proof.

We show both implications separately.

Implication: \((\implies)\).

If \(\mathcal{T}\subseteq\mathcal{T}'\text{,}\) then any \(d\)-metric ball \(B_\epsilon(x)\) is open in \(\mathcal{T}'\text{.}\) Since \(d'\)-metric balls generate \(\mathcal{T}'\) and since \(x\in B_\epsilon(x)\text{,}\) it follows from (1.3.3) that there is a \(\delta > 0\) such that \(x\in B_\delta'(x)\subseteq B_\epsilon (x)\text{.}\)

Implication: \((\impliedby)\).

Assume the condition described by (1.3.4) holds. Take an open set \(U\in \mathcal{T}\text{.}\) By (1.3.3) there is an \(\epsilon > 0\) such that \(x\in B_{\epsilon}(x)\subseteq U\text{.}\) By the condition, there is a \(\delta> 0\) such that \(x\in B_\delta'(x)\subseteq B_\epsilon(x)\subseteq U\text{.}\) It follows again by (1.3.3) that \(U\in \mathcal{T}'\text{.}\)

Example 1.3.7. Equivalence of Euclidean, box, and taxicab metrics.

Let \(X=\R^n\text{.}\) Show that the Euclidean, box, and taxicab metrics all induce the same topology on \(\R^n\text{.}\)
Solution.
We adjust our notation to accommodate for different metrics at play simultaneously. Let \(d_{\operatorname{euc}}\text{,}\) \(d_{\operatorname{box}}\text{,}\) \(d_{\operatorname{taxi}}\) be the three metrics in question, and let \(\mathcal{T}_{\operatorname{euc}}\text{,}\) \(\mathcal{T}_{\operatorname{box}}\text{,}\) \(\mathcal{T}_{\operatorname{taxi}}\) be their respective topologies. We will denote \(\epsilon\)-balls with respect to each as \(B_{\operatorname{euc},\epsilon}(x)\text{,}\) \(B_{\operatorname{box},\epsilon}(x)\text{,}\) \(B_{\operatorname{taxi},\epsilon}(x)\text{.}\)
We will show \(\mathcal{T}_{\operatorname{euc}}=\mathcal{T}_{\operatorname{box}}\) and \(\mathcal{T}_{\operatorname{box}}=\mathcal{T}_{\operatorname{taxi}}\text{,}\) from whence it follows that \(\mathcal{T}_{\operatorname{euc}}=\mathcal{T}_{\operatorname{box}}=\mathcal{T}_{\operatorname{taxi}}\text{.}\)

Case: \(\mathcal{T}_{\operatorname{euc}}=\mathcal{T}_{\operatorname{box}}\).

For any nonnegative numbers \(a_1,a_2,\dots, a_n\) we have
\begin{equation*} \max\{a_i\}_{i=1}^n\leq \sqrt{a_1^2+a_2^2+\cdots a_n^2}\leq \sqrt{n}\max\{a_i\}_{i=1}^n\text{.} \end{equation*}
From this it follows that for any \(x\in \R^n\) and any \(\epsilon > 0\) we have
\begin{equation} B_{\operatorname{box},\sqrt{n}\epsilon}\subseteq B_{\operatorname{euc},\epsilon}(x)\subseteq B_{\operatorname{box},\epsilon}(x)\text{,}\tag{1.3.5} \end{equation}
showing that within any Euclidean metric ball centered at \(\boldx\) we can find a box metric ball centered at \(\boldx\text{,}\) and vice versa. Now given any element \(y\) in a Euclidean metric ball \(B\text{,}\) there is a Euclidean metric ball \(B'\) centered at \(y\) contained in \(B\) by Lemma 1.3.5. By (1.3.5) there is box metric ball \(B''\) centered at \(y\) satisfying \(B''\subseteq B'\subseteq B\text{.}\) Using our covering principle, we conclude that any Euclidean metric ball is covered by box metric balls, and thus \(\mathcal{T}_{\operatorname{euc}}\subseteq \mathcal{T}_{\operatorname{box}}\text{.}\) A very similar argument, using the other inclusion of (1.3.5), shows that \(\mathcal{T}_{\operatorname{box}}\subseteq \mathcal{T}_{\operatorname{euc}}\text{.}\)

Case: \(\mathcal{T}_{\operatorname{box}}=\mathcal{T}_{\operatorname{taxi}}\).

For any nonnegative \(a_1, a_2, \dots, a_n\) we have
\begin{equation*} \max\{a_i\}_{i=1}^n\leq a_1+a_2+\cdots a_n\leq n\max\{a_i\}_{i=1}^n\text{,} \end{equation*}
from whence it follows that for any \(x\in \R^n\) and \(\epsilon > 0\) we have
\begin{equation*} B_{\operatorname{box},n\epsilon}\subseteq B_{\operatorname{taxi},\epsilon}(x)\subseteq B_{\operatorname{box},\epsilon}(x)\text{.} \end{equation*}
An argument exactly like the one from the previous case now shows \(\mathcal{T}_{\operatorname{box}}=\mathcal{T}_{\operatorname{taxi}}\text{.}\)

Definition 1.3.8. Trivial metric.

Given a set \(X\) the function \(d\colon X\times X\rightarrow \R\) defined as
\begin{equation*} d(x,y)= \begin{cases} 1\amp\text{if } x\ne y\\ 0\amp \text{if } x=y \end{cases} \end{equation*}
is a metric on \(X\text{,}\) called the trivial metric.

Proof.

The proof that \(d\) is a metric is left as an exercise.

Example 1.3.9. Trivial metric.

Determine the topology induced on a set \(X\) by the trivial metric.
Solution.
This example is left as an exercise.

Definition 1.3.10. \(p\)-adic metric.

Let \(\Z\) be the set of integers. Let \(\mathcal{P}=\{2, 3, 5, 7, 11,\dots\}\) be the set of prime integers. The fundamental theorem of arithmetic states that any nonzero integer \(n\in \Z\) can be factored in unique was as a product of primes in the form
\begin{equation*} n=\pm \prod_{p\in \mathcal{P}} p^{v_p(n)}\text{,} \end{equation*}
where \(v_p(n)\) is a nonnegative integer, and \(v_p(n)=0\) for all but finitely many primes \(p\text{.}\) We call \(v_p(n)\) the valuation of \(n\) at the prime \(p\text{;}\) it tells us the highest power of \(p\) dividing \(n\text{.}\)
Now fix a prime integer \(p\text{.}\) For \(n\in\Z\) we define its \(p\)-adic norm \(\abs[p]{n}\) as
\begin{equation*} \abs[p]{n}=\begin{cases} 0\amp\text{if } n=0\\ p^{-v_p(n)}\amp\text{if } n\ne 0 \end{cases}\text{.} \end{equation*}
The function \(d\colon \Z\times\Z\rightarrow \R\) defined as
\begin{equation*} d(m,n)=\abs[p]{m-n} \end{equation*}
is a metric on \(\Z\text{,}\) called the \(p\)-adic metric. Integers \(m,n\in\Z\) are close to one another with respect to this metric if their difference is highly divisible by \(p\text{.}\)

Proof.

We content ourselves with a proof sketch in order to avoid getting into the weeds of elementary number theory. The positivity and symmetry axioms follow readily from simple properties of divisibility. For the triangle inequality it is enough to prove that the \(p\)-adic norm \(\abs[p]{\hspace{5pt}}\) satisfies the triangle inequality on \(\Z\text{:}\) i.e., for all \(m,n\in\Z\) we have
\begin{equation} \abs[p]{m+n}\leq \abs[p]{m}+\abs[p]{n}\tag{1.3.6} \end{equation}
since then for any \(r,s,t\in\Z\) we have
\begin{align*} d(r,s) \amp=\abs[p]{r-s} \\ \amp=\abs[p]{r-t +t-s} \\ \amp\leq \abs[p]{r-t}+\abs[p]{t-s}\\ \amp \leq d(r,t)+d(t,s)\text{.} \end{align*}
Lastly, the inequality (1.3.6) follows from the stronger claim
\begin{equation} \abs[p]{m+n}\leq \max\{\abs[p]{m}, \abs[p]{n} \}\text{,}\tag{1.3.7} \end{equation}
which itself follows from divisibility properties.