Compactness in Metric Spaces

Summary In this article, we mainly formalize in Mizar [2] the equivalence among a few compactness definitions of metric spaces, norm spaces, and the real line. In the first section, we formalized general topological properties of metric spaces. We discussed openness and closedness of subsets in metric spaces in terms of convergence of element sequences. In the second section, we firstly formalize the definition of sequentially compact, and then discuss the equivalence of compactness, countable compactness, sequential compactness, and totally boundedness with completeness in metric spaces. In the third section, we discuss compactness in norm spaces. We formalize the equivalence of compactness and sequential compactness in norm space. In the fourth section, we formalize topological properties of the real line in terms of convergence of real number sequences. In the last section, we formalize the equivalence of compactness and sequential compactness in the real line. These formalizations are based on [20], [5], [17], [14], and [4].

We start with the fact that in any metric space, a compact subset is closed and bounded. Bounded here means that the subset "does not extend to infinity," that is, that it is contained in some open ball around some point. But we can give an alternative definition, which says that a set is bounded if there is a limit on how far apart two points in the set can be. We can also define the "diameter" of such a subset: Definition 2. Let (M, d) be a metric space. A subset X of M is said to be bounded if and only if the set {d(x, y) | x, y ∈ X} is bounded above. For a non-empty bounded set X, we define diam(X), the diameter of X, to be the least upper bound of the set {d(x, y) | x, y ∈ X} (which exists by the least upper bound property of R, since the set is bounded above).
Take careful note of how the finite subcover property is used in the following proof; the technique is common in proofs about compactness.
Theorem 1. Let (M, d) be a metric space, and let K be a compact subset of M . Then K is a closed subset of M , and K is bounded.
Proof. Let K be a compact subset of a metric space (M, d). To prove that K is closed, we show that the complement, is an open cover of K (since any x ∈ K is covered by B x (x)). Since K is compact, there is a finite subcover of this cover; that is, there is a finite set x 1 , x 2 , . . . , x n such that the corresponding open balls already cover K. Let = 1 2 min( x 1 , x 2 , . . . , xn ). The claim is that B (z) ⊆ G. To show this, let y ∈ B (z). We want to show y ∈ G, that is, (The last inequality follows because d(y, z) < .) Then, since d(x i , y) > , y is not in the open ball of radius x i about x i . Since the open balls B x i (x i ) cover K, we have that y ∈ K.
To prove that K is bounded, let x be some element of K, and consider the collection of open balls of integral radius, {B i (x) | i = 1, 2, . . . }. Since every element of K has some finite distance from x, this collection is an open cover of K, Since K is compact, it has a finite subcover {B i 1 (x), B i 2 (x), . . . , B in (x)}, where we can assume i 1 < i 2 < · · · < i n . But since B i 1 (x) ⊆ B i 2 (x) ⊆ · · · ⊆ B in (x), this means that B in by itself already covers K. Then, for y, z ∈ K, y and z are in B xn (x), and d(y, z) ≤ d(y, x) + d(x, z) ≤ i n + i n . It follows that 2i n is an upper bound for {d(y, z) | y, z ∈ K}. So, K is bounded.
It is not true in general that every closed, bounded set is compact. However, that is true in R n , with the usual metric, and this fact gives a complete characterization of compact subsets of R n . We will not prove this at this time, but Exercise 5 proves it for the case n = 1.
The Bolzano-Weirstrass Theorem for closed, bounded intervals in R says that any infinite subset of such an interval has an accumulation point in the interval. A similar result holds for a compact subset of a metric space.
Theorem 2. Let (M, d) be a metric space and let K be a compact subset of M . Then any infinite subset of K has an accumulation point in K.
Proof. We prove the contrapositive. Let X ⊆ K. Assume that X has no accumulation point in K. We must show that X is finite. Let z ∈ K. Since z is not an accumulation point, there is an is an open cover of K. Since K is compact, there is a finite cover. That is, there are finitely many points z 1 , z 2 , . . . , z n such that the corresponding open balls already cover K. But each of the n open balls in that subcover contains at most one point of X, and it follows that X has n or fewer points. So we have proved that X is finite.
In fact, a set being compact is actually equivalent to the property that every infinite subset of that set has an accumulation point in the set. We have proved one direction of this equivalence. We will not prove the other direction at this time.

Exercises
Exercise 1. Find an example of a closed and bounded set C in some metric space such that C is not compact. (Hint: Consider the metric space (X, ρ) from exercise 1 in the first handout.) Exercise 2. A subset X of a metric space is said to be totally bounded if for every > 0, X can be covered by a finite collection of open balls of radius . Show that every compact set is totally bounded.
Exercise 3. Let (M, d) be a metric space, let X be a non-empty subset of M , and let z be an element of M . Define d(z, X) = glb{d(x, z) | x ∈ X}. Note that if z ∈ X, then d(z, X) = 0. Find an example where z ∈ X but d(z, X) = 0. Now suppose that K is a compact subset of M . Show that d(z, K) = 0 if and only if z ∈ K. Exercise 5. Show that any bounded, closed subset of R is compact. (Hint: Use the previous exercise and the fact that any bounded, closed interval is compact.) Exercise 6. Let (M, d) be a metric space, and let X be a subset of M . Show that X is bounded (in the sense that it has a finite diameter) if and only if for any z ∈ M , there is a number N such that X ⊆ B N (z).