Compactness in Metric Spaces
What You’ll Learn
Section titled “What You’ll Learn”In this lesson you’ll see the three notions of compactness collapse into one for metric spaces, learn what total boundedness adds to boundedness, and get the extra theorems that metric compactness supports.
The Concept
Section titled “The Concept”The equivalences
Section titled “The equivalences”In a general topological space, several distinct conditions compete for the name “compact.” In a metric space they all agree, and this is the theorem that makes the notion so usable in analysis.
For a metric space , the following are equivalent:
- Compact - every open cover has a finite subcover.
- Sequentially compact - every sequence has a convergent subsequence with limit in .
- Complete and totally bounded.
- Limit point compact - every infinite subset has a limit point in .
None of these equivalences holds in general topological spaces. There are compact spaces that are not sequentially compact and vice versa, so the metric setting is genuinely special.
The figure demonstrates the sequential form. On , bisection extracts a convergent subsequence from an equidistributed sequence that itself has no limit: at each level the half containing more of the surviving terms is kept, and after eight halvings the interval has width under while still containing infinitely many terms. That construction is Bolzano–Weierstrass, and the figure runs it rather than describing it.
On the same idea fails. The sequence has every subsequence tending to 0, and 0 is not a point of the space, so no subsequence converges in . The interval is therefore not sequentially compact, and by the equivalence not compact - matching the open-cover argument from the previous lesson.
Total boundedness
Section titled “Total boundedness”is totally bounded if for every it can be covered by finitely many balls of radius .
This is strictly stronger than bounded, and the difference is exactly what goes wrong in infinite dimensions.
In they coincide: a bounded set sits in a large box, which can be chopped into finitely many small boxes. In they do not. The set of standard basis vectors is bounded - every element has norm 1 - but the points are pairwise at distance , so a ball of radius contains at most one of them and no finite family of such balls covers an infinite set.
That is why Heine–Borel is a theorem about . The correct general statement replaces “bounded” with “totally bounded” and adds completeness:
Completeness is not enough, and neither is boundedness
Section titled “Completeness is not enough, and neither is boundedness”Both halves are needed, and each has a clean counterexample.
- is complete but not totally bounded, and not compact.
- is totally bounded but not complete, and not compact.
- ’s closed unit ball is complete and bounded but not totally bounded, and not compact.
Note also that completeness is a metric property rather than a topological one: as topological spaces, yet one is complete and one is not. Compactness, being a combination that happens to be topological, is the invariant.
What metric compactness gives you
Section titled “What metric compactness gives you”Beyond the general results from the last lesson, a compact metric space supports:
Uniform continuity. Every continuous function on a compact metric space is uniformly continuous.
This is the theorem quoted in the real analysis section, and it is what makes continuous functions Riemann integrable.
Bounded diameter. A compact metric space is bounded, and its diameter is attained by some pair of points.
Separability. Every compact metric space is separable and second countable.
The Lebesgue number lemma. For any open cover of a compact metric space there is a such that every set of diameter less than lies inside some single member of the cover.
The Lebesgue number lemma is the technical workhorse behind subdivision arguments, and it is how uniform continuity and many results in algebraic topology are actually proved.
Nested sets. A decreasing sequence of nonempty closed sets in a compact space has nonempty intersection. This is the finite intersection property specialized, and it is how existence proofs by successive approximation are closed out.
The Cantor set
Section titled “The Cantor set”The standard example worth having: the Cantor set is
- compact - closed and bounded in
- totally disconnected - every component is a single point
- uncountable - it has the cardinality of
- nowhere dense - its interior is empty
- perfect - every point is a limit point
That combination sounds contradictory and is not. is the canonical example showing that compactness says nothing about connectedness, and that topological smallness has nothing to do with cardinality.
Worked Examples
Section titled “Worked Examples”Example 1: Show is sequentially compact.
Solution. Given any sequence in , bisect. One of the halves contains infinitely many terms; keep it and repeat.
This produces nested intervals of width , each containing infinitely many terms. Choosing one term from each level with increasing index gives a subsequence, and by completeness the nested intervals shrink to a single point, which is the limit.
Answer: sequentially compact. ∎
This is exactly the computation in the figure, run to eight levels there.
Example 2: Show is not sequentially compact.
Solution. Take . Every subsequence also tends to 0.
Since , no subsequence converges to a point of the space.
Answer: not sequentially compact. ∎
Example 3: Show is bounded but not totally bounded.
Solution. Each has norm 1, so the set is bounded.
For ,
So a ball of radius contains at most one basis vector, and no finite collection of such balls covers infinitely many.
Answer: bounded, not totally bounded. ∎
Example 4: Show is complete but not compact.
Solution. Completeness is the standard fact that Cauchy sequences of reals converge.
is not totally bounded, since no finite family of balls of radius 1 covers it. By the equivalence it is not compact, and directly the cover has no finite subcover.
Answer: complete, not compact. ∎
Example 5: Prove uniform continuity on a compact metric space.
Solution. Let be continuous with compact, and fix .
For each , continuity gives with whenever . The balls cover , so finitely many do, say for . Put
which is positive precisely because the collection is finite. Any two points within then lie in a common ball, and the triangle inequality gives . ∎
Compactness is what makes the minimum positive. On a non-compact domain the infimum of the can be 0, which is exactly how on escapes uniform continuity.
Example 6: Show a compact metric space has a largest distance.
Solution. The map is continuous, and is compact as a finite product of compact spaces.
By the extreme value theorem attains a maximum, so there are points with .
Answer: the diameter is attained. ∎
Contrast , whose diameter is 1 and is attained by no pair.
Example 7: Show the Cantor set is compact and totally disconnected.
Solution. where each is a finite union of closed intervals, so is closed as an intersection of closed sets, and bounded inside . By Heine–Borel it is compact.
For total disconnectedness, take in . At stage with … more precisely once , the two points lie in different intervals of , and the removed middle third between them separates into two relatively open pieces.
Answer: compact and totally disconnected. ∎
Real-World Applications
Section titled “Real-World Applications”Numerical convergence. Extracting a convergent subsequence is the standard way to prove an iterative method has a limit point, and it requires the iterates to live in a compact set. That is why algorithms are analysed on bounded closed parameter regions.
Uniform error bounds. Uniform continuity on a compact domain is what lets a single step size guarantee accuracy across the whole domain. Without it, a mesh fine enough in one region can be too coarse in another.
Optimization existence. Compactness plus continuity gives existence of a minimizer, which is the first thing any convergence proof establishes. In infinite-dimensional problems, total boundedness failing is why weak topologies are introduced.
Approximation theory. Total boundedness of a function class is exactly what makes finite approximation possible, and covering numbers - the count of -balls needed - are the quantitative version used in statistical learning bounds.
Signal quantization. Covering a signal space with finitely many balls is quantization, and the number needed at a given resolution is the covering number. Total boundedness is the condition for a finite codebook to exist.
Data compactness assumptions. Machine learning guarantees typically assume the data lies in a compact set, which is what allows a finite sample to control behaviour everywhere.
Retrying will remove your ✅ checkmark until you pass again.