Compact Spaces
Compact Spaces
Compact Spaces
Focus Questions
By the end of this section, you should be able to give precise and thorough answers to the
questions listed below. You may want to keep these questions in mind to focus your thoughts as
you complete the section.
Introduction
Closed and bounded intervals have important properties in calculus. Recall, for example, that every
real-valued function that is continuous on a closed interval [a, b] attains a maximum and minimum
value on that interval. The question we want to address in this section is if there is a corresponding
characterization for subsets of topological spaces that ensure that continuous real-valued functions
with domains in topological spaces attain maximum and minimum values. The property that we
will develop is called compactness.
The word “compact” might bring to mind a notion of smallness, but we need to be careful with
the term. We might think that the interval (0, 0.5) is small, but (0, 0.5) is homeomorphic to R,
which is not small. Similarly, we might think that the interval [−10000, 10000] is large, but this
interval is homeomorphic to the “small” interval [−0.00001, 0.000001]. As a result, the concept of
compactness does not correspond to size, but rather structure, in a way. We will expand on this idea
in this section.
Since a topology defines open sets, topological properties are often defined in terms of open
173
174 Section 17. Compact Spaces
sets. Let us consider an example to see if we can tease out some of the details we will need to get
a useful notion of compactness. Consider the open interval(0, 1) in R. Suppose we write (0, 1)
1 1 +
as a unionS of open balls. For example, let On = n , 1 − n for n ∈ Z and n ≥ 3. Notice that
(0, 1) ⊆ n≥3 On . Any collection of open sets whose union contains (0, 1) is called an open cover
of (0, 1). Working with a larger number of sets is generally more complicated than working with
a smaller number, so it is reasonable to ask if we can reduce the number of sets in our open cover
of (0, 1) and still cover (0, 1). In particular, working with a finite collection of sets is preferable to
working with an infinite number of sets (we can exhaustively check all of the possibilities in a finite
setting if necessary). Notice that On ⊂ On+1 for each n, so we can eliminate many of the sets in
this cover. However, if we eliminate enough sets so that we are left with only finitely many, then
1
there will be a maximum value of n so that On remains in our collection. But then 2n will not be in
the union of our remaining collection of sets. As a result, we cannot find a finite collection of the
On whose union contains (0, 1). Note that there may be some collections of open sets that cover of
(0, 1) for which there is a finite subcollection of sets that also cover (0, 1). For example, if we let
3 3 S
Un = n − 4 , n + 4 , then (0, 1) ⊆ n∈Z Un , and (0, 1) ⊆ U0 ∪ U1 . The main point is that there
is at least one collection of open sets that covers (0, 1) for which there is no finite subcollection of
sets that covers (0, 1).
Let’s apply the same idea now to the set [0, 1]. Suppose we extend our open cover {On } to be an
open cover of the closed interval [0, 1] by including two additional open balls in R: O0 = B(0, 0.5)
and O1 = B(1, 0.5). Now the sets O0 , O1 , and O4 form a finite collection of sets that covers [0, 1].
So even though the interval [0, 1] is “larger” than (0, 1) in the sense that (0, 1) ⊂ [0, 1] we can
represent [0, 1] in a more efficient (that is finite) way in terms of open sets than we can the interval
(0, 1). This is the basic idea behind compactness.
Definition 17.1. A subset A of a topological space X S
is compact if for every set I and every
family of open sets {Oα } with α ∈ SI such that A ⊆ α∈I Oα , there exists a finite subfamily
{Oα1 , Oα2 , . . . , Oαn } such that A ⊆ ni=1 Oαi .
If (X, τ ) is a topological space and X is a compact subset of X, then we say that X is a compact
topological space. There is some terminology associated with Definition 17.1.
Definition 17.2. A cover of a subset A of a topological
S space X is a collection {Sα } of subsets of
X for α in some indexing set I so that A ⊆ α∈I Sα . In addition, if each set Sα is an open set,
then the collection {Sα } is an open cover for A.
Definition 17.3. A subcover of a cover {Sα }α∈I of a subset A S of a topological space X is a
collection {Sβ } for β ∈ J, where J is a subset of I such that A ⊆ β∈J Sβ . In addition, if J is a
finite set, the subcover {Sβ }β∈J is a finite subcover of {Sα }α∈I .
So the sets O0 , O1 , and O4 in our previous example form a finite subcover of the open cover
{On }n≥3 .
Using the terminology we have now established, we can restate the definition of compactness
in the following way: a subset A of a topological space X is compact if every open cover of A has
a finite subcover of A.
Preview Activity 17.1. Determine if the subset A of the topological space X is compact. Either
prove A is compact by starting with an arbitrary infinite cover and demonstrating that there is a
finite subcover, or find a specific infinite cover and prove that there is no finite subcover.
174
Section 17. Compact Spaces
(1) A = {−2, 3, e, π, 456875} in X = R with the Euclidean topology. Generalize this example.
There are two perspectives by which we can look at compactness. If (X, τX ) is a topological
space and A is a subset of X, then Definition 17.1 tells us what it means for A to be compact as
a subset of X. From this perspective, we use open sets in X to make open covers of A. We can
also consider A as a subspace of X using the subspace topology τA . From this perspective we can
examine the compactness of A using relatively open sets for open covers. Exercise (14) tells us that
these two perspectives are equivalent, so we will use whatever perspective is appropriate for a given
situation.
In our preview activity we learned about compactness – the analog of closed intervals from R in
topological spaces. Recall that a subset A of a topological space X is compact if every open cover
of A has a finite sub-cover. As we will see, the definition of compactness is exactly what we need to
ensure results of the type that continuous real-valued functions with domains in topological spaces
attain maximum and minimum values on compact sets.
We might expect that compact sets have certain properties, but we must be careful which ones
we assume.
Activity 17.1. Let X = {a, b, c, d} and give X the topology τ = {∅, {a}, {b, c}, {a, b, c}, X}.
(a) Explain why every finite subset of a topological space must be compact.
(b) Find, if possible, a subset of X that is compact and open. If no such subset exists, explain
why.
(d) Find, if possible, a subset of X that is compact and closed. If no such subset exists, explain
why.
The message of Activity 17.1 is that compactness by itself is not related to closed or open sets.
We will see later, though, that in some reasonable circumstances, compact sets and closed sets are
related. For the moment, we take a short detour and ask if compactness is a topological property.
175
176 Section 17. Compact Spaces
Activity 17.2. Let (X, τX ) and (Y, τY ) be topological spaces, and let f : X → Y be continuous.
Assume that A is a compact subset of X. In this activity we want to determine if f (A) must be a
compact subset of Y .
(a) What do we need to show to prove that f (A) is a compact subset of Y ? Where do we start?
(b) If we have an open cover of f (A) in Y , how can we find an open cover {Uα } for A? Be
sure to verify that what you claim is actually an open cover of A.
Theorem 17.4. Let (X, τX ) and (Y, τY ) be topological spaces, and let f : X → Y be
continuous. If A is a compact subset of X, then f (A) is a compact subset of Y .
Corollary 17.5. Let (X, τX ) and (Y, τY ) be homeomorphic topological spaces. Then a subset A
of X is compact if and only if f (A) is compact in Y .
Compact Subsets of Rn
The metric space (Rn , dE ) is not compact since the open cover {B(0, n)}n∈Z+ has no finite sub-
cover. Since we have already shown that (R, dE ) is homeomorphic to the topological subspaces
(a, b), (−∞, b), and (a, ∞) for any a, b ∈ R, we conclude that no open intervals are compact.
Similarly, no half-closed intervals are compact. In fact, we will demonstrate in this section that the
compact subsets of (Rn , dE ) are exactly the subsets that are closed and bounded. The first step is
contained in the next activity.
Activity 17.3. We have seen that compact sets can be either open or closed. However, in certain
situations compact sets must be closed. We investigate that idea in this activity. Let A be a compact
subset of a Hausdorff topological space X. We will examine why A must be a closed set.
(a) To prove that A is a closed set, we consider the set X \ A. What property of X \ A will
ensure that A is closed? How do we prove that X \ A has this property?
(b) Let x ∈ X \ A. Assume that A is a nonempty set (why can we make this assumption)?
For each a ∈ A, why must there exist disjoint open sets Oxa and Oa with x ∈ Oxa and
a ∈ Oa ?
(c) Why must there exist a positive integer n and elements a1 , a2 , . . ., an in A such that the
sets Oa1 , Oa2 , . . ., Oan form an open cover of A?
(d) Now find an open subset of X \ A that has x as an element. What does this tell us about A?
176
Section 17. Compact Spaces
Theorem 17.6 tells us something about compact subsets of (Rn , dE ). Since every metric space
is Hausdorff, we can conclude the following corollary.
To classify the compact subsets of (Rn , dE ) as closed and bounded, we need to discuss what it
means for a set in Rn to be bounded. The basic idea is straightforward – a subset of Rn is bounded
if it doesn’t go off to infinity in any direction. In other words, a subset A of Rn is bounded if we
can construct a box in Rn that is large enough to contain it. Thus, the following definition.
Definition 17.8. A subset A of Rn is bounded if there exists M > 0 such that A ⊆ QnM , where
The set QnM in Definition 17.8 is called the standard n-dimensional cube of size M. A standard
3-dimensional cube of size M is shown in Figure 17.1.
An important fact about standard n-cubes is that they are compact subsets of Rn . Compactness
is a complicated property – it is difficult to prove a result that is true about every open cover. As a
result, the proof of Theorem 17.9 is quite technical, but it is a critical step to classifying the compact
subsets of Rn .
Theorem 17.9. Let n ∈ Z+ . The standard n-dimensional cube of size M is a compact subset of
Rn for any M > 0.
Proof. We proceed by contradiction and assume that there is an n ∈ Z+ and a positive real number
M such that QnM is not compact. So there exists an open cover {Oα } with α in some indexing set
I of QnM that has no finite sub-cover. Let Q0 = QnM so that Q0 is an n-cube with side length 2M .
Partition Q0 into 2n uniform sub-cubes of side length M = 2M 2 (a picture for n = 2 is shown at left
in Figure 17.2). Let Q0 be one of these sub-cubes. The collection {Oα ∩ Q′0 }α∈I is an open cover
′
of Q′0 in the subspace topology. If each of these open covers has a finite sub-cover, then we can take
the union of all of the Oα s over all of the finite sub-covers to obtain a finite sub-cover of {Oα }α∈I
for Q0 . Since our cover {Oα }α∈I for Q0 has no finite sub-cover, we conclude that there is one
sub-cube, Q1 , for which the open cover {Oα ∩ Q1 }α∈I has no finite sub-cover. Now we repeat the
process and partition Q1 into 2n uniform sub-cubes of side length M 2M
2 = 22 . The same argument
we just made tells us that there is a sub-cube Q2 of Q1 for which the open cover {Oα ∩ Q2 }α∈I
177
178 Section 17. Compact Spaces
(b1,1,b1,2)
(b2,1,b2,2) (b0,1,b0,2)
Q2
Q2
(a2,1,a2,2)
Q1 Q1 Q1
(a1,1,a1,2)
Q0 Q0 (a0,1,a0,2) Q0
has no finite sub-cover (an illustration for the n = 2 case is shown at middle in Figure 17.2). We
proceed inductively to obtain an infinite nested sequence
Q0 ⊃ Q1 ⊃ Q2 ⊃ Q3 ⊃ · · · ⊃ Qk ⊃ · · ·
M
of cubes such that for each k ∈ Z, the lengths of the sides of cube Qk are
T∞2k−1
= 2M
2k
and the open
cover {Oα ∩ Qk }α∈I of Qk has no finite sub-cover. Now we show that k=1 Qk ̸= ∅.
For i ∈ Z+ , let Qi = [ai,1 , bi,1 ] × [ai,2 , bi,2 ] × · · · [ai,n , bi,n ]. That is, think of the point
(ai,1 , ai,2 , . . . , ai,n ) as a lower corner of the cube and the point (bi,1 , bi,2 , . . . , bi,n ) as an upper
corner of the n-cube Qi (a labeling for n = 2 and i from 1 to 3 is shown T∞at right in Figure +17.2).
Let q = (sup{ai,1 }, sup{ai,2 }, . . . , sup{ai,n }). We will show that q ∈ k=1 Qk . Fix r ∈ Z . We
need to demonstrate that
because sup{ai,s } is an upper bound for all of the ai,s . The fact that our cubes are nested means
that
a1,s ≤ a2,s ≤ · · · ,
b1,s ≥ b2,s ≥ · · · ,
ai,s ≤ bi,s (17.2)
for every i and s. Since sup{ai,s } is the least upper bound of all of the ai,s , property (17.2) shows
that sup{ai,s } ≤ bi,s for every i. Thus, sup{ai,s }T≤ br,s and soTar,s ≤ sup{ai,s } ≤ br,s . This
shows that q ∈ Qk for every k. Consequently, q ∈ ∞ k=1 Qk and
∞
T∞Qk is not empty. (The fact
k=1
T of our cubes are converging to 0 implies that k=1 Qk = {q}, but we only
that the side lengths
need to know that ∞ k=1 Qk is not empty for our proof.)
Since {Oα }α∈I is a cover for Q0 , there must exist an αq ∈ I such that q ∈ Oαq . The set Oαq is
open, so there exists ϵq > 0 such that B(q, ϵq ) ⊆ Oαq . The maximum distance between points in
Qk is the distance between the corner points (ak,1 , ak,2 , . . . , ak,n ) and (bk,1 , bk,2 , . . . , bk,n ), where
M
each length bk,s − ak,s is 2k−1 . The distance formula tells us that this maximum distance between
178
Section 17. Compact Spaces
points in Qk is Ã
n Å
M 2
ã2
M √
ã Å
X M
Dk = = n k−1 = n.
2k−1 2 2k−1
s=1
Now choose K ∈ Z+ such that DK < ϵq . Then if x ∈ QK we have dE (q, x) < DK and
x ∈ B(q, ϵq ). So QK ⊆ B(q, ϵq ). But B(q, ϵq ) ⊆ Oαq . So the collection {Oαq ∩ QK } is a sub-
cover of {Oα ∩QK }α∈I for QK . But this contradicts the fact this open cover has no finite sub-cover.
The assumption that led us to this contradiction was that Q0 was not compact, so we conclude that
the standard n-dimensional cube of size M is a compact subset of Rn for any M > 0. ■
One consequence of Theorem 17.9 is that any closed interval [a, b] in R is a compact set. But
we can say even more – that the compact subsets of Rn are the closed and bounded subsets. This
will require one more intermediate result about closed subsets of compact topological spaces.
Activity 17.4. Let X be a compact topological space and C a closed subset of X. In this activity
we will prove that C is compact.
(b) Use an open cover for C and the fact that C is closed to make an open cover for X.
(c) Use the fact that X is compact to complete the proof of the following theorem.
Theorem 17.10. Let X be a compact topological space. Then any closed subset of X is
compact.
Now we can prove a major result, that the compact subsets of (Rn , dE ) are the closed and
bounded subsets. This result is important enough that it is given a name.
Theorem 17.11 (The Heine-Borel Theorem). A subset A of (Rn , dE ) is compact if and only if A is
closed and bounded.
Proof. Let A be a subset of (Rn , dE ). Assume that A is closed and bounded. Since A is bounded,
there is a positive number M such that A ⊆ QnM . Theorem 17.9 shows that QnM is compact, and
then Theorem 17.10 shows that A is compact.
For the converse, assume that A is a compact subset of Rn . We must show that A is closed and
bounded. Now (Rn , dE ) is a metric space, and so Hausdorff. Theorem 17.6 then shows that A is
closed. To conclude our proof, we need to demonstrate that A is bounded. For each k > 0, let
Uk = Ok ∩ A
for each k. Since k>0 Ok = Rn , it follows that {Uk }k>0 is an open cover of A. The fact that A is
S
compact means that there is a finite collection Uk1 , Uk2 , . . ., Ukm of sets in {Uk }k>0 that cover A.
Let K = max{ki | 1 ≤ i ≤ m}. Then Uki ⊆ UK for each i, and so A ⊆ UK ⊂ Qm K . Thus, A is
n
bounded. This completes the proof that if A is compact in R , then A is closed and bounded. ■
179
180 Section 17. Compact Spaces
You might wonder whether the Heine-Borel Theorem is true in any metric space.
Activity 17.5. A subset A of a metric space (X, d) is bounded if there exists a real number M such
that d(a1 , a2 ) ≤ M for all a1 , a2 ∈ A. (This is equivalent to our definition of a bounded subset of
Rn given earlier, but works in any metric space.) Explain why Z as a subset of (R, d), where d is
the discrete metric, is closed and bounded but not compact.
An Application of Compactness
As mentioned at the beginning of this section, compactness is the quality we need to ensure that
continuous functions from topological spaces to R attain their maximum and minimum values.
Theorem 17.12. A continuous function from a compact topological space to the real numbers
assumes a maximum and minimum value.
(a) Let X be a compact topological space and f : X → R a continuous function. What does
the continuity of f tell us about f (X) in R?
(b) Why can we conclude that the set f (X) has a least upper bound M ? Why must M be an
element of f (X)?
Summary
• A subcover of a cover of a set A is a subset of the cover such that the union of the sets in the
subcover also contains A.
• A subset A of a topological space is compact if every open cover of A has a finite subcover.
• A continuous function from a compact topological space to the real numbers must attain a
maximum and minimum value.
• The Heine-Borel Theorem states that the compact subsets of Rn are exactly the subsets that
are closed and bounded.
180
Section 17. Compact Spaces
Exercises
(1) (a) Determine the compact subsets of a topological space X with the indiscrete topology.
(b) Determine the compact subsets of a topological space X with the indiscrete topology.
(2) Recall from Definition 12.13 on page 126 that if τ1 and τ2 are two topologies on a set X such
that τ1 ⊆ τ2 , then τ1 is said to be a coarser (or weaker) topology than τ2 , or τ2 is a finer (or
stronger) topology than τ1 . In this exercise we explore the question of whether compactness
is a property that is passed from weaker to stronger topologies or from stronger to weaker.
Let τ1 and τ2 be two topologies on a set X. If τ1 ⊆ τ2 , what does compactness under τ1 or
τ2 imply, if anything, about compactness under the other topology? Justify your answers.
(3) Let E be the set of even integers, and let τ = {Z} ∪ {O ⊆ E}. That is, τ is the collection of
all subsets of E along with Z.
(a) Prove that τ is a topology on Z.
(b) Find all compact subsets of (Z, τ ). Verify your answer.
(c) Prove or disprove: If A and B are compact subsets of a topological space X, then
A ∩ B is also a compact subset of X.
(4) Let (X, τ ) be a topological space
(a) Prove that the union of any finite number of compact subsets of X is a compact
subset of X.
(b) In Exercise (3) we should have seen that the intersection of compact sets is not nec-
essarily compact. If X is Hausdorff, prove that the intersection of any finite number
of compact subsets of X is a compact subset of X.
(5) Consider Z with the digital line topology (see Exercise (11) on page 127). Determine the
compact subsets of Z.
(6) For each n ∈ Z+ , let (−n, n) be the set of integers in the interval (−n, n) (see Exercise (4)
on 126.)
(a) Show that B = {(−n, n)}n∈Z+ is a basis for a topology τ on Z
(b) Is the subset (−2, 2) compact in this topology?
(c) Determine all of the compact subsets of Z.
(7) Let X and Y be topological spaces, and let f : X → Y be a function.
(a) Suppose that f is a continuous function, and that X is compact and Y is Hausdorff.
Prove that if C is a closed subset of X, then f (C) is a closed subset of Y . (Thus, f
is a closed function.) (Hint: Use Activity 17.3, Activity 17.4, and Theorem 17.6.)
(b) Suppose that f is a continuous bijection. Prove that if X is compact and Y is Haus-
dorff, then f is a homeomorphism.
(c) Give an example where f is a continuous bijection and X is compact, but f is not a
homeomorphism.
181
182 Section 17. Compact Spaces
(d) Give an example where f is a continuous bijection and Y is Hausdorff, but f is not
a homeomorphism.
(8) The Either-Or topology on the interval X = [−1, 1] has as its open sets all subsets of X that
contain (−1, 1) and any subset of X that doesn’t contain 0.
(a) Describe the non-trivial closed subsets of X.
(b) Is X a Hausdorff topological space? Explain.
(c) Is X compact? Prove your answer.
(d) Are there any subsets of Z that are not compact? Justify your answer.
(9) Let K = k1 | k is a positive integer . Let B be the collection of all open intervals of the
form (a, b) and all sets of the form (a, b) \ K, where a < b are real numbers as in Example
13.13 on page 137. Let τK be the topology generated by B.
(a) Show that (R, τK ) is not compact. (Hint: How is the K-topology related to the
Euclidean topology?)
(b) Show that any subset of R that contains K is not a compact subset of (R, τK ). In
particular, even though [0, 1] is a closed and bounded subset of Rin (R, τK ), we note
that [0, 1] is not compact. (Hint: Consider the sets Ok = k1 , 2 ∪ (−1, 1) \ K for
k ∈ Z+ .)
(a) Prove that if X is Hausdorff and C is a compact subset of X, then for each x ∈ X \C
there exist disjoint open sets U and V such that x ∈ U and C ⊆ V .
(b) Prove that if X is a compact Hausdorff space, then X is normal.
(11) Let X be a nonempty set and let p be a fixed element in X. Let τp be the particular point
topology and τp the excluded point topology on X. That is
That the particular point and excluded point topologies are topologies is the subject of Exer-
cises (9) and (10) on page 127.
Determine, with proof, the compact subsets of X when
(a) X has the particular point topology τp
(b) X has the excluded point topology τp .
(12) In this exercise we encounter a non-Hausdorff topological space in which single points sets
are closed, and in which compact subsets need not be closed. Consider the set Z with the
finite complement topology τF C .
182
Section 17. Compact Spaces
(a) Let x ∈ X and let A be a compact subset of X. Prove that there exist disjoint open
subsets U and V of X such that x ∈ U and A ⊆ V .
(b) Let A and B be disjoint compact subsets of X. Prove that there exist disjoint open
sets U and V such that A ⊆ U and B ⊆ V .
(14) Let (X, τX ) be a topological space and let A be a subset of X. Let τA be the subspace
topology on A. Prove that A is a compact subset of X if and only if (A, τA ) is a compact
topological space.
(15) Let X be a topological space. A family {Fα }α∈I ofTsubsets of X is said to have the finite
intersection property if for each finite subset J of I, α∈J Fα ̸= ∅. Prove that X is compact
T family {Fα }α∈I of closed subsets of X that has the finite intersection
if and only if for each
property, we have α∈I Fα ̸= ∅.
(16) Even though R is not a compact space, if x ∈ R, then x ∈ [x − 1, x + 1] and so every point
in R is contained in a compact subset of R. So if we view R from the perspective of a point
in R, the space R looks compact around that point. This is the idea of local compactness.
Locally compact spaces are important in the general topology of function spaces.
(17) For each of the following, answer true if the statement is always true. If the statement is only
sometimes true or never true, answer false and provide a concrete example to illustrate that
the statement is false. If a statement is true, explain why.
(a) If X and Y are compact topological spaces and f : X → Y is a continuous bijection,
then f is a homeomorphism.
(b) If X is a compact topological space, then any closed subspace of X is compact.
183
184 Section 17. Compact Spaces
Introduced by Felix Hausdorff in the early 20th century as a way to measure the distance between
sets, the Hausdorff metric (also called the Pompeiu-Hausdorff metric) has since been widely studied
and has many applications. For example, the United States military has used the Hausdorff distance
in target recognition procedures. In addition, the Hausdorff metric has been used in image matching
and visual recognition by robots, medicine, image analysis, and astronomy.
The basic idea in these applications is that we need a way to compare two shapes. For example,
if a manufacturer needs to mill a specific product based on a template, there is usually some toler-
ance that is allowed. So the manufacturer needs a way to compare the milled parts to the template
to determine if the tolerance has been met or exceeded.
The Hausdorff metric is also familiar to fractal aficionados for describing the convergence of
sequences of compact sets to their attractors in iterated function systems. The variety of applications
of this metric make it one that is worth studying.
To define the Hausdorff metric, we begin with the distance from a point x in a metric space X
to a subset A of X as
d(x, A) = inf{d(x, a) | a ∈ A}.
Since images will be represented as compact sets, we restrict ourselves to compact subsets of a
metric space. In this case the infimum becomes a minimum and we have
We now extend that idea to define the distance from one subset of X to another. Let A and B
be nonempty compact subsets of X. To find the distance from the set A to the set B, it seems
reasonable to consider how far each point in A is from the set B. Then the distance from A to B
should measure how far we have to travel to get from any point in A to B.
Definition 17.14. Let (X, d) be a metric space and let A and B be nonempty compact subsets of
X. Then distance d(A, B) from A to B is
ß ™
d(A, B) = max min{d(a, b)} .
a∈A b∈B
184
Section 17. Compact Spaces
B C
Activity 17.7.
(a) A problem with d as in Definition 17.14 is that d is not symmetric. Find examples of
compact subsets A and B of Rn with the Euclidean metric such that d(A, B) ̸= d(B, A).
(b) Even though the function d in Definition 17.14 is not a metric, we can define the Hausdorff
distance in terms of d as follows.
Definition 17.15. Let (X, d) be a metric space and A and B nonempty compact subsets of
X. Then Hausdorff distance between A and B is
Let A be the circle in R2 centered at the origin with radius 1, let B be the inscribed square,
and let C = {(1, 0), (−1, 0)} as shown in Figure 17.3.
Determine h(A, B), h(A, C), and h(B, C), and verify that h(A, C) ≤ h(A, B)+h(B, C).
(c) It may be surprising that h as in Definition 17.15 is actually a metric, but it is. The under-
lying space is the collection of nonempty compact subsets of X which we denote at H(X).
Prove the following theorem.
Theorem 17.16. Let X be a metric space. The Hausdorff distance function is a metric on
H(X).
(d) One fun application of the Hausdorff metric is in fractal geometry. You may be familiar
with objects like the Sierpinski triangle or the Koch curve. These objects are limits of
sequences of sets in H(R2 ). We illustrate with the Sierpinski triangle. Start with three
pointsï v1ò, v2 , and v3 that form the vertices of an equilateral triangle S0 . For i=1,2, or 3, let
a
vi = i . For i=1,2, or 3, we define ωi : R2 → R2 by
bi
Åï òã ï 1 òï ò ï ò
x 0 x a
ωi = 2 1 + i .
y 0 2 y bi
185
186 Section 17. Compact Spaces
Then ωi , when applied to S0 , contracts S0 by a factor of 2 and then translates the image of
S0 so that the ith vertex of S0 and the ith vertex of the image of S0 coincide. Such a map is
called a contraction mapping with contraction factor equal to 21 . Define S1,i to be ωi (S0 ).
Then S1,i is the set of all points half way between any point in S0 and vi , or S1,i isSa triangle
half the size of the original translated to the ith vertex of the original. Let S1 = 3i=1 S1,i .
Both S0 and S1 are shown in figure 17.4. We can continue this procedure replacing S3 S0 with
S1 . In other words, for i = 1, 2, and 3, let S2,i = ωi (S1 ). Then let S2 = i=1 S2,i . A
picture of S2 is shown in figure 17.4. We can continue this procedure, each time replacing
Sj−1 with Sj . A picture of S8 is shown in figure 17.4.
S0 S1
S2 S8
To continue this process, we need to take a limit. But the Si are sets in H(R2 ), so the limit
is taken with respect to the Hausdorff metric.
i. Assume that the length of a side of S0 is 1. Determine h(S0 , S1 ). Then find h(Sk , Sk+1 )
for an arbitrary positive integer k.
ii. The Sierpinski triangle will exist if the sequence (Sn ) converges to a set S (which
would be the Sierpinski triangle). The question of convergence is not a trivial one.
n
A. Consider the sequence (an ), where an = 1 + n1 for n ∈ Z+ . Note that each
an is a rational number. Explain why the terms in this sequence get arbitrar-
186
Section 17. Compact Spaces
ily close together, but the sequence does not converge in Q. Explain why the
sequence (an ) converges in R.
B. A sequence (xn ) in a metric space (X, d) is a Cauchy sequence if given ϵ > 0
there exists N ∈ Z+ such that d(xn , xm ) < ϵ whenever n, m ≥ N . Every
convergent sequence is a Cauchy sequence. A metric space X is said to be com-
plete if every Cauchy sequence in X converges to an element in X. For example,
(R, dE ) is complete while (Q, dE ) is not. Although we will not prove it, the
metric space (H(R2 ), h) is complete. Show that the sequence (Sn ) is a Cauchy
sequence in H(R2 ). The limit of this sequence is the famous Sierpinski trian-
gle. The picture of S8 in figure 17.4 is a close approximation of the Sierpinski
triangle.
187