Skip to main content

Section Metric Spaces

For most of our mathematical careers our mathematics has taken place in \(\R^2\text{,}\) where we measure the distance between points \((x_1,x_2)\) and \((y_1,y_2)\) with the standard Euclidean distance \(d_E\text{.}\) In our preview activity we saw that the function \(d_T\) satisfies many of the same properties as \(d_E\text{.}\) These properties allow us to use \(d_E\) or \(d_T\) as distance functions. We call any distance function a metric, and any space on which a metric is defined is called a metric space.

Definition 3.4.

A metric on a space \(X\) is a function \(d : X \times X \to \R^+ \cup \{0\}\) that satisfies the properties:
  1. \(d(x,y) \geq 0\) for all \(x,y \in X\text{,}\)
  2. \(d(x,y) = 0\) if and only if \(x = y\) in \(X\text{,}\)
  3. \(d(x,y) = d(y,x)\) for all \(x, y \in X\text{,}\) and
  4. \(d(x,y) \leq d(x,z) + d(z,y)\) for all \(x,y,z \in X\text{.}\)
Properties 1 and 2 of a metric say that a metric is positive definite, while property 3 states that a metric is symmetric. Property 4 of the definition is usually the most difficult property to verify for a metric and is called the triangle inequality.

Definition 3.5.

A metric space is a pair \((X,d)\text{,}\) where \(d\) is a metric on the space \(X\text{.}\)
When the metric is clear from the context, we just refer to \(X\) as the metric space.

Activity 3.2.

For each of the following, determine if \((X,d)\) is a metric space. If \((X,d)\) is a metric space, explain why. If \((X,d)\) is not a metric space, determine which properties of a metric \(d\) satisfies and which it does not. If \((X,d)\) is a metric space, give a geometric description of the unit circle (the set of all points in \(X\) a distance \(1\) from the zero element) in the space.

(a)

\(X = \R\text{,}\) \(d(x,y) = \max\{|x|,|y|\}\text{.}\)

(b)

\(X = \R\text{,}\) \(d(x,y) = \begin{cases}0 \amp \text{ if } x=y \\ 1 \amp \text{ if } x \neq y. \end{cases}\)

(c)

\(X = \R^2\text{,}\) \(d((x_1,x_2),(y_1,y_2)) = \max\{| x_1-y_1 |, | x_2-y_2 | \}\)

(d)

\(X = C[0,1]\text{,}\) the set of all continuous functions on the interval \([0,1]\text{,}\)
\begin{equation*} d(f,g) = \ds \int_0^1 | f(x) - g(x) | \, dx\text{.} \end{equation*}
It should be noted that not all metric spaces are infinite. We discuss one metric on a finite space in the following example.

Example 3.6.

Let \(X = \{a,b,c\}\) and define \(d: A \times A \to \R^+ \cup \{0\}\) with the entries in Table 3.7.
Table 3.7. Table of values for a function \(d\)
\(a\) \(b\) \(c\)
\(a\) \(0\) \(3\) \(5\)
\(b\) \(3\) \(0\) \(4\)
\(c\) \(5\) \(4\) \(0\)
By definition we have \(d(x,y) \geq 0\) for all \(x, y \in X\) with \(d(x,y) = 0\) if and only if \(x=y\text{.}\) Since the table is symmetric around the diagonal, we can see that \(d(x,y) = d(y,x)\) for all \(x,y \in X\text{.}\) The only item to verify is the triangle inequality. If \(d(x,y) = 0\text{,}\) then
\begin{equation*} d(x,y) = 0 \leq d(x,z) + d(z,y) \end{equation*}
for any \(x,y \in X\text{.}\) If \(d(x,z) = 0\text{,}\) then \(x=z\) and
\begin{equation*} d(x,y) = d(z,y) \leq d(z,z) + d(z,y)\text{.} \end{equation*}
That leaves three cases to consider, when \(x\text{,}\) \(y\text{,}\) and \(z\) are distinct. Now
\begin{align*} d(a,b) \amp = 3 \leq 5+4 = d(a,c) + d(c,b),\\ d(a,c) \amp = 5 \leq 3+4 = d(a,b) + d(b,c),\\ d(b,c) \amp = 4 \leq 3+5 = d(b,a) + d(a,c)\text{.} \end{align*}
So \(d\) is a metric on \(X\text{.}\)
Example 3.6 shows that even finite sets can be metric spaces. In fact, we can make a finite metric space by taking any finite subset \(S\) of a metric space \((X,d)\) and use as a metric the restriction of \(d\) to \(S\text{.}\) Example 3.6 illustrates this by letting \(a = (0,0)\text{,}\) \(b = (3,0)\text{,}\) and \(c = (3,4)\) in \(\R^2\text{.}\) Then \(d\) is the restriction of the Euclidean metric to the set \(X\text{.}\) Another way to construct a finite metric space is to start with a finite set of points and make a graph with the points as vertices. Construct edges so that the graph is connected (that is, there is a path from any one vertex to any other) and give weights to the edges as illustrated in Figure 3.8. We then define a metric \(d\) on \(S\) by letting \(d(x,y)\) be the length of a shortest path between vertices \(x\) and \(y\) in the graph. For example, \(d(b,c) = d(b,e) + d(e,c) = 9\) in this example.
Figure 3.8. A graph to define a metric.
Just as with the Euclidean and taxicab metrics, item (c) in Activity 3.2 can be extended to \(\R^n\) as follows. If \(x = (x_1, x_2, \ldots, x_n)\) and \(y = (y_1, y_2, \ldots, y_n)\) are in \(\R^n\text{,}\) then the maximum distance \(d_M(x,y)\) from \(x\) to \(y\) is defined as
\begin{equation*} d_M(x,y) = \max\{| x_1-y_1 |, | x_2-y_2 |, |x_3-y_3|, \ldots, |x_n-y_n| \} = \max_{1 \leq i \leq n} \{|x_i-y_i|\}\text{.} \end{equation*}
The metric \(d_M\) is called the max metric. In the following section we prove that the Euclidean metric is in fact a metric. Proofs that \(d_T\) and \(d_M\) are metrics are left to Exercise 5 and Exercise 6.