Metric spaces, a first look

Limits, continuity and compactness on the real line use almost nothing about numbers except the distance between them. What survives when distance means something else, between points of the plane, strings of bits or whole functions?

Where you are 6 in Integration and sequences of functions

Why this exists

Most proofs in Open, closed and compact sets in R and Continuity, defined and proved use only three facts about \lvert x - y \rvert: it is positive unless x = y, it is symmetric, and it obeys the triangle inequality \lvert x - z \rvert \le \lvert x - y \rvert + \lvert y - z \rvert. So any set with a distance obeying those rules carries open sets, limits, continuity and compactness, whether its points are vectors, strings of bits or whole functions. What fails to carry over is exactly what used the completeness of \mathbb{R}.

Definition

Metric space. A metric on a set X is a function d : X \times X \to \mathbb{R} such that for all x, y, z \in X: (i) d(x, y) \ge 0; (ii) d(x, y) = 0 if and only if x = y; (iii) d(x, y) = d(y, x); (iv) d(x, z) \le d(x, y) + d(y, z), the triangle inequality. The pair (X, d) is a metric space. A subset of X with d restricted to it is again one, a subspace.

Examples. (a) \mathbb{R} with \lvert x - y \rvert (Absolute value).

(b) \mathbb{R}^n, with points \mathbf{x} = (x_1, \ldots, x_n) and three metrics:

\begin{aligned} d_1(\mathbf{x}, \mathbf{y}) &= \textstyle\sum_{i=1}^{n} \lvert x_i - y_i \rvert, \\ d_2(\mathbf{x}, \mathbf{y}) &= \lVert \mathbf{x} - \mathbf{y} \rVert, \\ d_\infty(\mathbf{x}, \mathbf{y}) &= \max_{i} \lvert x_i - y_i \rvert. \end{aligned}

d_2 is the distance of The distance formula, and (iv) for it is the triangle inequality of Dot product, length and orthogonality in n dimensions. For d_1 and d_\infty, apply \lvert x_i - z_i \rvert \le \lvert x_i - y_i \rvert + \lvert y_i - z_i \rvert in each coordinate, then add, or take the largest.

(c) The discrete metric on any set: d(x, y) = 1 if x \ne y, and d(x, x) = 0. For (iv), if x \ne z then y differs from x or from z.

(d) C[a, b], the continuous f : [a, b] \to \mathbb{R}, with the uniform metric d_\infty(f, g) = \max_{[a, b]} \lvert f - g \rvert, which exists by Theorem 8 below. It is 0 only if f = g. For (iv), at each x,

\begin{aligned} \lvert f(x) - h(x) \rvert &\le \lvert f(x) - g(x) \rvert + \lvert g(x) - h(x) \rvert \\ &\le d_\infty(f, g) + d_\infty(g, h). \end{aligned}

It is d_\infty of \mathbb{R}^n with the points of [a, b] as coordinates; Pointwise and uniform convergence writes it \lVert f - g \rVert_\infty.

From here on (X, d) is a metric space.

Balls and sets. For r > 0, the open ball is B(x, r) = \{y \in X : d(x, y) < r\} and the closed ball is C(x, r) = \{y \in X : d(x, y) \le r\}. A set U is open if every x \in U has some B(x, r) \subseteq U. A set E is closed if X \setminus E is open, and bounded if some p \in X and M have d(p, x) \le M for every x \in E. On \mathbb{R} these agree with Open, closed and compact sets in R (its Theorem 4 for closed sets). Write B_1, B_2, B_\infty to name the metric.

Convergence. x_n \to x if for every \varepsilon > 0 there is N with d(x_n, x) < \varepsilon for every n > N; that is, d(x_n, x) \to 0. Subsequences are as in Subsequences and Bolzano-Weierstrass.

Compact set. K \subseteq X is compact if every sequence in K has a subsequence converging to a point of K.

Continuity. For metric spaces (X, d_X), (Y, d_Y), a function f : X \to Y is continuous at c if for every \varepsilon > 0 there is \delta > 0 with d_Y(f(x), f(c)) < \varepsilon for every x with d_X(x, c) < \delta; it is continuous if continuous at every point.

Intuition

The metric decides the shape of a ball. In the plane B_2(\mathbf{0}, 1) is a disk, B_1(\mathbf{0}, 1) a diamond, B_\infty(\mathbf{0}, 1) a square (Figure 1). Each holds a shrunken copy of the others, and that is enough for the three to agree on what is open and what converges (Theorem 3).

B_{1}(\mathbf{0}, 1)
B_{2}(\mathbf{0}, 1)
B_{\infty}(\mathbf{0}, 1)
B_1(\mathbf{0}, 2)
Figure 1The unit balls about the origin of the plane for d_1, d_2 and d_\infty: a diamond, a disk and a square. On the right, all three together inside the dashed B_1(\mathbf{0}, 2), which the corners of the square touch: B_1 \subseteq B_2 \subseteq B_\infty \subseteq B_1(\mathbf{0}, 2).

Much of the real line survives any metric: limits are unique, closed sets keep their limits, continuous images of compact sets are compact. One fact does not. In \mathbb{R}^n, Bolzano-Weierstrass makes closed bounded sets compact; in a general space nothing plays its part (Examples 2 and 4).

Results

Theorem 1 (distance to a point). For all x, y, p \in X, \lvert d(x, p) - d(y, p) \rvert \le d(x, y). So x \mapsto d(x, p) is continuous.

Theorem 2 (open sets). (a) Every open ball is open. (b) \varnothing and X are open, every union of open sets is open, and every finite intersection of open sets is open.

Theorem 3 (three metrics on \mathbb{R}^n). At every pair of points,

d_\infty \le d_2 \le d_1 \le n\, d_\infty

So the three metrics have the same open sets, bounded sets and convergent sequences, with the same limits; and \mathbf{x}_k \to \mathbf{x} if and only if x_{k,i} \to x_i in \mathbb{R} for each coordinate i.

Theorem 4 (limits). (a) A sequence has at most one limit. (b) A convergent sequence is bounded. (c) If x_n \to x, every subsequence converges to x.

Theorem 5 (closed sets). (a) E is closed if and only if it contains the limit of every convergent sequence of its points. (b) Every closed ball is closed.

Theorem 6 (compact sets). (a) Every compact set is closed and bounded. (b) In \mathbb{R}^n, with d_1, d_2 or d_\infty, a set is compact if and only if it is closed and bounded.

Theorem 7 (continuity). Let f : X \to Y. (a) f is continuous at c if and only if f(x_n) \to f(c) whenever x_n \to c. (b) f is continuous if and only if f^{-1}(V) is open for every open V \subseteq Y.

Theorem 8 (compactness and continuity). If f : X \to Y is continuous and K is compact, then f(K) is compact. If also Y = \mathbb{R} and K \ne \varnothing, f attains a largest and a smallest value on K.

Topology calls K compact when every family of open sets covering K has a finite subfamily covering K. In a metric space this agrees with our definition, stated here without proof and taken up in Compactness and open covers.

Why it is true

Theorem 1. Proof. By (iv) and (iii), d(x, p) \le d(x, y) + d(y, p), so d(x, p) - d(y, p) \le d(x, y); exchange x and y for the other sign. For continuity take \delta = \varepsilon. \square

Theorem 2. Proof. (a) If y \in B(x, r) and s = r - d(x, y), then d(y, z) < s gives d(x, z) < r by (iv), so B(y, s) \subseteq B(x, r). (b) A point of a union lies in a member U, and a ball about it inside U lies in the union. For U_1 \cap \cdots \cap U_m use the least of the m radii, which is positive. \square

Theorem 3. Proof. Let a_i = \lvert x_i - y_i \rvert and a_j the largest. Then a_j^2 \le \sum a_i^2, so d_\infty \le d_2. Expanding, \left(\sum a_i\right)^2 \ge \sum a_i^2, so d_2 \le d_1. Each a_i \le a_j, so d_1 \le n a_j. Hence

\begin{aligned} B_1(\mathbf{x}, r) &\subseteq B_2(\mathbf{x}, r) \\ &\subseteq B_\infty(\mathbf{x}, r) \subseteq B_1(\mathbf{x}, nr) \end{aligned}

and a ball of one metric about \mathbf{x} contains a ball of each other, of radius \displaystyle \frac{r}{n} at worst: the open sets agree. Bounds and limits pass along the chain by the squeeze theorem. Finally, \lvert x_{k,i} - x_i \rvert \le d_\infty(\mathbf{x}_k, \mathbf{x}); and if every coordinate converges, d_1(\mathbf{x}_k, \mathbf{x}), a sum of n terms, tends to 0 by the sum law. \square

Theorem 4. Proof. (a) If x_n \to x and x_n \to y, then d(x, y) \le d(x, x_n) + d(x_n, y), which is less than 2\varepsilon for large n; so d(x, y) = 0. (b) Take N for \varepsilon = 1; then M = \max\{d(x_1, x), \ldots, d(x_N, x), 1\} bounds every d(x_n, x). (c) Since n_k \ge k, the N for x_n serves x_{n_k}. \square

Theorem 5. Proof. (a) Let E be closed, x_n \in E, x_n \to x. If x \notin E, some B(x, r) \subseteq X \setminus E, yet x_n \in B(x, r) for large n. Conversely, let E keep its limits and x \notin E. If no ball about x lay in X \setminus E, there would be \displaystyle x_n \in E \cap B\left(x, \frac{1}{n}\right); then x_n \to x, so x \in E. So X \setminus E is open.

(b) If x_n \in C(p, r) and x_n \to x, then d(p, x) \le r + d(x_n, x) for every n, so d(p, x) \le r by the order limit theorem (Limits of sequences, epsilon and N). Part (a) finishes. \square

Theorem 6. Proof. (a) Let K be compact and p \in X. If K were unbounded, there would be x_n \in K with d(p, x_n) > n. A subsequence converges to some x, with d(x, x_{n_k}) \le M by Theorem 4(b), so k \le n_k < d(p, x) + M for every k, which is impossible. If x_n \in K and x_n \to x, a subsequence converges to a point of K and to x (Theorem 4(c)), so x \in K by Theorem 4(a); Theorem 5 finishes.

(b) By Theorem 3 the three metrics share closed, bounded and compact sets, so use d_\infty. One direction is (a). Let K be closed and bounded, so all coordinates of its points lie in some [-M, M], and let \mathbf{x}_k \in K. By Subsequences and Bolzano-Weierstrass the first coordinates have a convergent subsequence; along it the second coordinates do; and so on through coordinate n. The last subsequence converges in each coordinate, so in \mathbb{R}^n (Theorem 3), to a point of K (Theorem 5). \square

Theorem 7. Proof. (a) If f is continuous at c and x_n \to c, take the \delta for \varepsilon and then N with d_X(x_n, c) < \delta for n > N. If f is not continuous at c, negating the definition (Negating a quantified statement) gives \varepsilon > 0 and, for \displaystyle \delta = \frac{1}{n}, points x_n with \displaystyle d_X(x_n, c) < \frac{1}{n} and d_Y(f(x_n), f(c)) \ge \varepsilon: so x_n \to c but f(x_n) \not\to f(c).

(b) Let f be continuous, V open, c \in f^{-1}(V), and B(f(c), \varepsilon) \subseteq V; the \delta for \varepsilon gives B(c, \delta) \subseteq f^{-1}(V). Conversely, B(f(c), \varepsilon) is open (Theorem 2), so its preimage contains some B(c, \delta), which is the \delta of the definition. \square

Theorem 8. Proof. Let f(x_n) be a sequence in f(K) with x_n \in K. A subsequence x_{n_k} \to x \in K, and f(x_{n_k}) \to f(x) by Theorem 7(a). If Y = \mathbb{R}, f(K) is a nonempty compact set of reals, so it contains its supremum and infimum (Theorem 8 of Open, closed and compact sets in R). \square

Worked examples

Example 1

Chips on a circuit board

Hannah runs a pick-and-place machine that sets chips on circuit boards, with positions in millimeters. Its head has two motors, for x and for y, that run at once, each at 50 mm per second, so its travel time follows d_\infty. Luis routes copper traces parallel to the board’s edges, so the shortest trace between two pads has length d_1. (a) For pads P = (60, 90) and Q = (180, 40), find d_1, d_2, d_\infty and the head’s travel time. (b) Which of R = (120, 10), S = (10, 40) and T = (90, 40) lie within 100 of P, for each metric?

Solution

(a) The coordinate gaps are 120 and 50, so d_1(P, Q) = 170, \displaystyle d_2(P, Q) = \sqrt{120^2 + 50^2} = 130 and d_\infty(P, Q) = 120, in millimeters. The head is done when the longer axis is: \displaystyle \frac{120}{50} = 2.4 seconds.

(b) For R, gaps (60, 80): d_1 = 140, d_2 = 100, d_\infty = 80. For S, gaps (50, 50): d_1 = 100, \displaystyle d_2 = 50\sqrt{2} \approx 70.71, d_\infty = 50. For T, gaps (30, 50): d_1 = 80, \displaystyle d_2 = 10\sqrt{34} \approx 58.31, d_\infty = 50. Balls are strict, so R lies only in B_\infty(P, 100), S in the d_2 and d_\infty balls, and T in all three, nested as Theorem 3 says.

Example 2

The discrete metric

Let X have the discrete metric. Which subsets are open, closed, bounded, compact, and which sequences converge?

Solution

\displaystyle B\left(x, \frac{1}{2}\right) = \{x\}, so every set is open, and hence every set is closed. Every set is bounded, as d \le 1. A sequence converges to x if and only if x_n = x for all n beyond some N: with \displaystyle \varepsilon = \frac{1}{2}, d(x_n, x) < \varepsilon forces x_n = x.

A set is compact if and only if it is finite. In a finite nonempty K, some point equals x_n for infinitely many n, giving a constant subsequence. In an infinite K, distinct points x_1, x_2, \ldots give a sequence whose subsequences are never eventually constant.

So \mathbb{N} with the discrete metric is closed and bounded but not compact, and in \mathbb{R} with the discrete metric \displaystyle \frac{1}{n} has no limit, as its terms are distinct: the metric decides what converges.

Example 3

Distance between two functions

In C[0, 1] let f(x) = x, g(x) = x^3 and h(x) = x^2. Find d_\infty(f, g) and d_\infty(f, h). Which of g, h is closer to f?

Solution

On [0, 1], u(x) = x - x^3 \ge 0. Its derivative 1 - 3x^2 vanishes in [0, 1] only at \displaystyle \frac{1}{\sqrt{3}}, and u(0) = u(1) = 0, so

\begin{aligned} d_\infty(f, g) &= \frac{1}{\sqrt{3}} - \frac{1}{3\sqrt{3}} \\ &= \frac{2\sqrt{3}}{9} \approx 0.385 \end{aligned}

Likewise x - x^2 \ge 0 peaks at \displaystyle \frac{1}{2}, so \displaystyle d_\infty(f, h) = \frac{1}{4}, and h is closer. As the maximum is attained, B(f, r) is the set of continuous functions whose graphs lie strictly inside the band of half-width r about the graph of f.

Example 4

A closed bounded set that is not compact

Let K = \{f \in C[0, 1] : d_\infty(f, 0) \le 1\}, where 0 is the zero function. Prove that K is closed and bounded but not compact, using f_n(x) = (1 - x)^n.

Solution

Proof. K = C(0, 1) is closed by Theorem 5(b), and bounded. Each f_n \in K, since 0 \le (1 - x)^n \le 1 on [0, 1] (Figure 2).

1
1
0
x
f_1
Figure 2The functions f_n(x) = (1 - x)^n for n = 1, 2, 4, 8, 16, from top to bottom. All lie in the closed unit ball of C[0, 1], but they squeeze toward a limit that jumps at 0 and so is not in C[0, 1].

Suppose a subsequence f_{n_k} \to g in C[0, 1]. At each x, \lvert f_{n_k}(x) - g(x) \rvert \le d_\infty(f_{n_k}, g), which tends to 0. So g(x) = \lim_{k \to \infty} (1 - x)^{n_k}, which is 1 at x = 0 and 0 for 0 < x \le 1. Then \displaystyle \frac{1}{m} \to 0 but \displaystyle g\left(\frac{1}{m}\right) = 0 \not\to g(0), so g is not continuous (Theorem 7(a)), a contradiction. No subsequence converges, so K is not compact. \square

Example 5

The nearest point of a compact set

Prove that if K \subseteq X is nonempty and compact and p \in X, some q \in K has d(p, q) \le d(p, x) for every x \in K. Then for K = \{(x, y) : x^2 + y^2 \le 25\} and P = (9, 12), find a nearest point and the least distance for d_2, d_1 and d_\infty.

Solution

Proof. x \mapsto d(p, x) is continuous (Theorem 1), so it attains a least value on K (Theorem 8). \square

Here K, the closed d_2 ball of radius 5 about the origin O, is closed (Theorem 5(b)) and bounded, so compact for all three metrics (Theorem 6(b)).

For d_2: Theorem 1 gives d_2(P, (x, y)) \ge d_2(P, O) - 5, that is at least 15 - 5 = 10, with equality at (3, 4), where the gap is (6, 8).

For d_1: on K, x \le 5 < 9 and y \le 5 < 12, so d_1 = 21 - (x + y). Since (x + y)^2 \le 2(x^2 + y^2) \le 50, as the difference is (x - y)^2, we get \displaystyle x + y \le 5\sqrt{2}, with equality at \displaystyle x = y = \frac{5\sqrt{2}}{2}. The least distance is \displaystyle 21 - 5\sqrt{2} \approx 13.93.

For d_\infty: let t = \max\{9 - x, 12 - y\}, so x \ge 9 - t and y \ge 12 - t. For t < 9 both bounds are positive, so 25 \ge (9 - t)^2 + (12 - t)^2, that is t^2 - 21t + 100 \le 0, and \displaystyle t \ge \frac{21 - \sqrt{41}}{2} \approx 7.30; any t \ge 9 is larger still. Equality holds at x = 9 - t, y = 12 - t, the point \approx (1.70, 4.70), which is on the circle. Three metrics, three nearest points; existence came from compactness alone.

Boundaries

  • Closed and bounded is not compact in general (Examples 2 and 4). Theorem 6(b) rests on Bolzano-Weierstrass, hence on the least-upper-bound property.
  • Boundedness is not fixed by the open sets. On \mathbb{R}, \min\{1, \lvert x - y \rvert\} has the same open sets and convergent sequences as \lvert x - y \rvert, yet every set is bounded (Exercise 11).
  • Open depends on the space. [0, 1) is open in the subspace [0, 3], as [0, 1) = B(0, 1) there, but not in \mathbb{R}.
  • Limits can be missing. In \mathbb{Q}, the decimal truncations of \displaystyle \sqrt{2} crowd together with no limit in the space; Cauchy sequences studies such sequences, and a space where they all converge is called complete.

Where this goes next

Topologies and open sets keeps Theorem 2(b) as the axioms of a topology and drops the metric. Compactness and open covers and Compactness in products and the Heine-Borel theorem work with open covers. Pointwise and uniform convergence studies convergence in the uniform metric of C[a, b].

Exercises

Distances and balls

  1. For P = (-3, 5) and Q = (4, -1), find d_1, d_2 and d_\infty.
  2. Which of P_1 = (2, 2), P_2 = (0, -2.9), P_3 = (3, 0.5), P_4 = (-1.5, 1.5) lie in the ball of radius 3 about the origin, for each of d_1, d_2, d_\infty?
  3. Hannah’s head moves from (15, 70) to (95, 10). Find its travel time, Luis’s shortest trace and the straight-line distance.
  4. On strings of 6 bits, the Hamming distance d(u, v) counts the positions where u and v differ. Find d(101101, 110001), and the number of strings in B(000000, 2) and in C(000000, 2).

Sequences, sets and compactness

  1. In C[0, 1] let f(x) = x^2, \displaystyle g(x) = x - \frac{1}{8} and k(x) = 2x - 1. Find d_\infty(f, g) and d_\infty(f, k). Which of g, k lie in B(f, 1)?
  2. In C[0, 1]: (a) find d_\infty(g_n, 0) for \displaystyle g_n(x) = \frac{x}{n + x}, and decide whether g_n \to 0; (b) find d_\infty(h_n, 0) for h_n(x) = nx(1 - x)^n and its limit, and show that \{h_n\} has no limit in C[0, 1].
  3. With the discrete metric on \mathbb{R}, which converge: (a) \displaystyle \frac{1}{n}; (b) x_n = 2 for n \le 100 and x_n = 7 after? (c) Is (0, 1) open, closed, compact?
  4. Which are compact in \mathbb{R}^2? (a) \{(x, y) : x^2 + 4y^2 \le 4\}; (b) \{(x, y) : xy = 1\}; (c) \{(x, y) : 0 < x^2 + y^2 \le 1\}.
  5. Let K = \{(x, 0) : 0 \le x \le 6\} and P = (9, 4). Find the least distance from P to K and every nearest point, for d_2, d_1 and d_\infty.

Proofs

  1. Prove that the Hamming distance is a metric.
  2. Prove that d'(x, y) = \min\{1, d(x, y)\} is a metric with the same convergent sequences as d, and that every set is bounded for d'.
  3. Prove that every finite subset of a metric space is compact, so closed.
  4. Call f : X \to Y Lipschitz if some L \ge 0 has d_Y(f(x), f(y)) \le L\, d_X(x, y) for all x, y. Prove that Lipschitz functions are continuous, and deduce that m(f) = \max_{[0, 1]} f is continuous on C[0, 1].
  5. Prove that a closed subset of a compact set is compact.
  6. Let K be compact and F closed, nonempty and disjoint. Prove that some \eta > 0 has d(x, y) \ge \eta for all x \in K, y \in F, and show by an example in \mathbb{R}^2 that “compact” cannot become “closed”.
Answers
  1. Gaps 7 and 6: d_1 = 13, \displaystyle d_2 = \sqrt{85} \approx 9.22, d_\infty = 7.
  2. P_1: d_1 = 4, \displaystyle d_2 = 2\sqrt{2} \approx 2.83, d_\infty = 2; in the d_2 and d_\infty balls. P_2: all three are 2.9; in all three. P_3: d_1 = 3.5, \displaystyle d_2 = \sqrt{9.25} \approx 3.04, d_\infty = 3; in none, as balls are strict. P_4: d_1 = 3, \displaystyle d_2 = \sqrt{4.5} \approx 2.12, d_\infty = 1.5; in the d_2 and d_\infty balls.
  3. Gaps 80 and 60: travel time \displaystyle \frac{80}{50} = 1.6 seconds, trace 140 mm, straight line 100 mm.
  4. They differ in positions 2, 3, 4: distance 3. B(000000, 2) holds distances 0 and 1: 1 + 6 = 7 strings. C(000000, 2) adds the \binom{6}{2} = 15 with two ones: 22.
  5. \displaystyle f - g = x^2 - x + \frac{1}{8} is \displaystyle \frac{1}{8} at 0 and 1 and \displaystyle -\frac{1}{8} at \displaystyle \frac{1}{2}, so \displaystyle d_\infty(f, g) = \frac{1}{8}. f - k = (1 - x)^2, so d_\infty(f, k) = 1. So g \in B(f, 1) and k \notin B(f, 1).
  6. (a) g_n increases, as \displaystyle g_n'(x) = \frac{n}{(n + x)^2} > 0, so \displaystyle d_\infty(g_n, 0) = \frac{1}{n + 1} \to 0, and g_n \to 0. (b) h_n'(x) = n(1 - x)^{n - 1}(1 - (n + 1)x) vanishes at \displaystyle \frac{1}{n + 1}, and h_n(0) = h_n(1) = 0, so \displaystyle d_\infty(h_n, 0) = \left(\frac{n}{n + 1}\right)^{n + 1} \to e^{-1}. At each x, h_n(x) \to 0, since for 0 < x \le 1 the ratio of consecutive terms tends to 1 - x < 1. As in Example 4, a limit h in C[0, 1] would equal 0 at every x, forcing d_\infty(h_n, 0) \to 0.
  7. By Example 2: (a) no, its terms are distinct; (b) yes, to 7. (c) Open and closed, as every set is; not compact, as it is infinite.
  8. (a) Compact: limits of its points satisfy x^2 + 4y^2 \le 4 (Theorem 3 and the order limit theorem), so it is closed, and \lvert x \rvert \le 2, \lvert y \rvert \le 1; Theorem 6(b). (b) Not: \displaystyle \left(n, \frac{1}{n}\right) shows it is unbounded. (c) Not: \displaystyle \left(\frac{1}{n}, 0\right) \to (0, 0), outside it, so it is not closed.
  9. On K, 9 - x \ge 3. \displaystyle d_2 = \sqrt{(9 - x)^2 + 16} \ge 5 and d_1 = 13 - x \ge 7, both only at (6, 0). d_\infty = \max\{9 - x, 4\} \ge 4, with equality exactly for 5 \le x \le 6: every such (x, 0) is nearest.
  10. Proof. d(u, v) \ge 0, it is 0 exactly when u = v, and it is symmetric. If u_i \ne w_i, then u_i \ne v_i or v_i \ne w_i. So the positions where u, w differ lie in the union of those where u, v differ and those where v, w differ, and d(u, w) \le d(u, v) + d(v, w). \square
  11. Proof. d' \ge 0, d' = 0 exactly when x = y, and d' is symmetric. For (iv): if d'(x, y) = 1 or d'(y, z) = 1, the right side is at least 1 \ge d'(x, z); otherwise d'(x, z) \le d(x, z) \le d(x, y) + d(y, z), which is d'(x, y) + d'(y, z). For \varepsilon < 1, d'(x_n, x) < \varepsilon if and only if d(x_n, x) < \varepsilon, and a cutoff for a small \varepsilon serves every larger one; so the convergent sequences agree. Every d'(p, x) \le 1. \square
  12. Proof. \varnothing is compact. Let K = \{a_1, \ldots, a_m\} and x_n \in K. Not every a_j can equal x_n for finitely many n only, or there would be finitely many n; so some a_j gives a constant subsequence, converging to a_j \in K. Theorem 6(a) gives closed. \square
  13. Proof. If L = 0, f is constant. If L > 0, \displaystyle \delta = \frac{\varepsilon}{L} works. For every x, f(x) \le g(x) + d_\infty(f, g) \le m(g) + d_\infty(f, g), so m(f) - m(g) \le d_\infty(f, g); exchanging f and g, m is Lipschitz with L = 1. \square
  14. Proof. Let F \subseteq K, F closed and K compact. A sequence in F has a subsequence converging to some x \in K, and x \in F by Theorem 5(a). \square
  15. Proof. Otherwise there are x_n \in K, y_n \in F with \displaystyle d(x_n, y_n) < \frac{1}{n}. A subsequence x_{n_k} \to x \in K, and \displaystyle d(y_{n_k}, x) < \frac{1}{n_k} + d(x_{n_k}, x), so y_{n_k} \to x and x \in F by Theorem 5(a): x \in K \cap F, a contradiction. \square Example: the x-axis and H = \{(x, y) : xy = 1, x > 0\} are closed and disjoint (limits keep xy = 1 and x \ge 0, which force x > 0), yet (n, 0) and \displaystyle \left(n, \frac{1}{n}\right) are \displaystyle \frac{1}{n} apart.
math.wiki · CC-BY-SA-4.0