Compactness
What You’ll Learn
Section titled “What You’ll Learn”In this lesson you’ll define compactness by open covers, learn what it buys you, prove that continuous images of compact sets are compact, and use it to recover the extreme value theorem in a line.
The Concept
Section titled “The Concept”The definition
Section titled “The definition”An open cover of is a family of open sets whose union is .
is compact if every open cover has a finite subcover.
The two quantifiers matter and are easy to swap by accident. It is every cover that must reduce, and it must reduce to some finite subfamily. Exhibiting one cover with a finite subcover proves nothing; exhibiting one cover without one proves non-compactness.
The figure works both directions. On the left, a cover of is reduced by a greedy left-to-right sweep, and the number of sets needed is computed. On the right, the cover of by the sets resists: any finite subfamily has a largest , and everything in is left out. The figure computes the length of that gap for the subfamily shown.
Those two intervals differ by a single point, and that point is the whole difference.
The subspace convention
Section titled “The subspace convention”For , compactness is checked in the subspace topology - equivalently, using covers by sets open in . Both formulations give the same answer, and the second is usually more convenient.
Heine–Borel
Section titled “Heine–Borel”Heine–Borel theorem. A subset of is compact if and only if it is closed and bounded.
This is the theorem that makes compactness usable in analysis, and it is worth being clear that it is a theorem about , not a definition. In general metric spaces closed and bounded does not imply compact: the closed unit ball of an infinite-dimensional Hilbert space is closed and bounded and not compact.
Examples in : is compact; is not, being non-closed; is not, being unbounded; a sphere is compact; is not.
What compactness buys
Section titled “What compactness buys”Continuous images. If is continuous and is compact, then is compact.
Proof. Let cover . The preimages cover and are open, so finitely many suffice, and the corresponding cover . ∎
Extreme value theorem. A continuous real function on a compact space is bounded and attains its maximum and minimum.
Proof. is a compact subset of , hence closed and bounded by Heine–Borel. A nonempty closed bounded set contains its supremum and infimum, so both are attained. ∎
One line, once you have the right invariant. That is the same pattern as connectedness giving the intermediate value theorem.
Other standard consequences:
- Closed subsets of compact spaces are compact.
- Compact subsets of Hausdorff spaces are closed. Without Hausdorff this fails.
- A continuous bijection from a compact space to a Hausdorff space is a homeomorphism - the free inverse-continuity from lesson 6.
- On a compact metric space, every continuous function is uniformly continuous.
- Finite products. A product of compact spaces is compact; for infinite products this is Tychonoff’s theorem, which is equivalent to the axiom of choice.
- A compact space has the finite intersection property: a family of closed sets with all finite intersections nonempty has nonempty total intersection.
Compactness is not hereditary
Section titled “Compactness is not hereditary”is compact and its subspace is not. Only closed subspaces inherit compactness, which is the same pattern seen with completeness.
Because it is preserved by homeomorphisms, compactness is an invariant, and it is often the quickest one: and both follow immediately.
Related notions
Section titled “Related notions”- Sequentially compact - every sequence has a convergent subsequence. Equivalent to compact in metric spaces, not in general.
- Limit point compact - every infinite subset has a limit point. Weaker in general.
- Locally compact - every point has a compact neighbourhood. qualifies; infinite-dimensional spaces generally do not.
- -compact - a countable union of compact sets, as is.
The equivalences in metric spaces are the subject of the next lesson.
Why the definition looks strange
Section titled “Why the definition looks strange”Open covers are not an obvious thing to axiomatize, and it is fair to ask why this is the right notion. Two answers.
It is the topological version of finiteness. A finite space is compact trivially, and compactness lets you run arguments that need “finitely many cases” on infinite spaces. Every proof above is really the finite case plus a cover argument.
It is exactly what makes the theorems true. Boundedness is not topological, since . Compactness is, and it is the hypothesis that the extreme value theorem, uniform continuity, and the closed-map results actually need.
Worked Examples
Section titled “Worked Examples”Example 1: Show is not compact.
Solution. Take the cover , which covers since every exceeds some .
Any finite subfamily has a largest index , so its union is , missing everything in .
Answer: no finite subcover, so not compact. ∎
Example 2: Show is not compact.
Solution. The cover has union . Any finite subfamily is contained in the largest , which misses .
Answer: not compact. ∎
Example 3: Show a closed subset of a compact space is compact.
Solution. Let be closed with compact, and let be a cover of by open sets of .
Adding , which is open, gives an open cover of . Compactness yields a finite subcover, and discarding from it leaves finitely many still covering .
∎
Example 4: Prove the extreme value theorem.
Solution. Let be continuous with compact and nonempty.
is compact, hence closed and bounded in . Being bounded, it has a supremum ; being closed, it contains . So for some , and similarly for the infimum. ∎
Example 5: Show compact subsets of a Hausdorff space are closed, and that Hausdorff is needed.
Solution. In a Hausdorff space with compact, take . For each choose disjoint open and . The cover , so finitely many do, and intersecting the corresponding gives an open set around missing . Hence is open.
For the failure, take with the trivial topology. The subset is compact, being finite, but it is not closed: its complement is not open. ∎
Example 6: Show a finite space is always compact.
Solution. Any open cover of a finite space has, for each point, at least one member containing it. Choosing one such member per point gives a subcover with at most elements.
Answer: compact. ∎
This is the sense in which compactness generalizes finiteness, and it is worth keeping as the guiding intuition.
Example 7: Show closed and bounded does not imply compact in general metric spaces.
Solution. In the space of square-summable sequences , take the standard basis vectors , each with a single 1 in position . The set is bounded, since every element has norm 1, and closed, since the points are all at distance from each other and so the set has no limit points.
The open balls cover it, each containing exactly one point, so no finite subfamily covers an infinite set.
Answer: closed, bounded, not compact. ∎
Heine–Borel is special to , and this is the standard reminder. The failure is what makes infinite-dimensional analysis genuinely different.
Real-World Applications
Section titled “Real-World Applications”Optimization. Existence of a solution is guaranteed on a compact feasible set and can fail otherwise. Minimizing on has no solution, which is exactly the non-compactness in the figure showing up as an engineering problem.
Numerical error bounds. On a compact domain a continuous error function attains a worst case, so a maximum error can be quoted. On a non-compact domain the supremum may not be attained and may not even be finite.
Economics. Existence of equilibria is proved with fixed-point theorems whose hypotheses include compactness of the strategy or price set. Compactifying the space is a standard modelling step.
Control theory. Reachable sets are often shown to be compact so that optimal controls exist. Without it, an optimal control may be approached but never achieved.
Machine learning. Bounding a parameter space to make it compact is what lets uniform convergence and generalization arguments go through, and it is why weight constraints appear in theoretical guarantees.
Logic and computation. The compactness theorem of first-order logic - that a set of sentences with all finite subsets satisfiable is satisfiable - is literally topological compactness of a space of models, which is where the name came from.
Retrying will remove your ✅ checkmark until you pass again.