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.
Definition3.4.
A metric on a space \(X\) is a function \(d : X \times X \to \R^+ \cup \{0\}\) that satisfies the properties:
\(d(x,y) \geq 0\) for all \(x,y \in X\text{,}\)
\(d(x,y) = 0\) if and only if \(x = y\) in \(X\text{,}\)
\(d(x,y) = d(y,x)\) for all \(x, y \in X\text{,}\) and
\(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.
Definition3.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.
Activity3.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.
It should be noted that not all metric spaces are infinite. We discuss one metric on a finite space in the following example.
Example3.6.
Let \(X = \{a,b,c\}\) and define \(d: A \times A \to \R^+ \cup \{0\}\) with the entries in Table 3.7.
Table3.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
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.
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
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.