Real Analysis
Heine-Borel Theorem
A subset of ℝⁿ is compact if and only if it is closed and bounded
The Heine-Borel theorem: a subset K of ℝⁿ (with the standard Euclidean metric) is compact if and only if K is both closed and bounded. Compact means every open cover of K has a finite subcover (Heine 1872, Borel 1895, Lebesgue 1898). Equivalent in metric spaces: every sequence has a convergent subsequence (sequential compactness). The theorem fails in infinite-dimensional spaces — the unit ball in ℓ² is closed and bounded but not compact (Riesz 1918). Heine-Borel is the bedrock under: extreme value theorem (continuous on compact attains max/min), uniform continuity on compact, and integration on compact intervals.
- Statementcompact ⇔ closed + bounded (in ℝⁿ)
- AuthorsHeine 1872, Borel 1895
- Compactevery open cover has finite subcover
- Sequentialevery seq has conv subseq
- Consequenceextreme value theorem follows
- Riesz 1918fails in infinite-dim
Watch the 60-second explainer
A condensed visual walkthrough — narrated, captioned, under a minute.
Why Heine-Borel matters
- Extreme value theorem. Continuous f on closed bounded [a, b] attains max and min — the basis of all elementary optimization.
- Uniform continuity. Heine-Cantor: continuous on compact ⇒ uniformly continuous, which makes Riemann integration work for any continuous function.
- ODE existence (Picard-Lindelöf). Compactness on the domain interval lets the contraction argument run; without Heine-Borel the iteration could escape to infinity.
- Numerical optimization. Continuous loss on compact constraint set has a minimizer — first thing every machine-learning convergence proof needs.
- Integration. Riemann integrability on [a, b] requires bounded oscillation, which on compact intervals is automatic via uniform continuity.
- Topology of ℝⁿ. Closed bounded sets are precisely the well-behaved "finite-like" subsets — the workhorse class for proofs.
- Image under continuous map. f(K) is compact whenever K is — used to show level sets are bounded, root sets are compact, etc.
Common misconceptions
- Compact = closed. No — bounded is critical. ℝ itself is closed but not compact; the cover {(−n, n)} has no finite subcover.
- Infinite-dim Hilbert ball is compact. Riesz: closed bounded balls are compact only in finite-dimensional spaces; in ℓ² basis vectors {eₙ} have no Cauchy subsequence.
- Compact ⇔ finite. No — closed bounded intervals like [0, 1] are compact and uncountable.
- Open cover means just closed cover. The definition uses open sets specifically — finite subcovers of closed sets don't characterize compactness.
- Heine-Borel works in any metric space. Only in ℝⁿ. In a general complete metric space, closed bounded sets need not be compact (e.g. infinite-dim Banach spaces).
- Compactness is a uniform notion. No — it's intrinsic to the subset's topology, not the ambient space; a subset is compact iff it's compact as a topological space in its own right.
Frequently asked questions
What does "compact" mean topologically?
A set K is compact if every open cover of K admits a finite subcover. An open cover is a collection of open sets whose union contains K. Finite subcover means you can throw away all but finitely many of those sets and still cover K. The definition is purely topological — no metric required — and captures a robust generalization of "finite". Compact sets behave like finite sets in many proofs: any continuous function attains its maximum, any continuous function-valued sequence has a convergent subsequence in the right setting, and the image of a compact set under a continuous map is compact.
Why does compactness need closed AND bounded in ℝⁿ?
Both conditions are needed. Bounded alone fails: (0, 1) is bounded but not closed; the cover {(1/(n+1), 1) : n ≥ 1} has no finite subcover because each set misses a tail near 0. Closed alone fails: ℝ is closed but unbounded; the cover {(−n, n) : n ≥ 1} has no finite subcover. Closed and bounded together force every sequence in K to have a convergent subsequence (Bolzano-Weierstrass), with limit inside K (closedness), which is sequential compactness — equivalent to compactness in ℝⁿ.
Why does the theorem fail in infinite-dimensional spaces?
Riesz's lemma (1918): the closed unit ball of an infinite-dimensional normed space is never compact. In ℓ² (square-summable sequences), the standard basis vectors {eₙ} satisfy ||eₙ|| = 1 (so they sit in the closed unit ball, which is closed and bounded) yet ||eₘ − eₙ|| = √2 for m ≠ n, so no subsequence is Cauchy and no subsequence converges. The phenomenon is that infinite dimensions provide enough "room" for points to spread out without piling up. Compactness in infinite dimensions requires extra restrictions — equicontinuity (Arzelà-Ascoli) for function spaces, weak topology in functional analysis.
What is the extreme value theorem and how does it follow?
EVT: any continuous function f : K → ℝ on a compact set K attains its supremum and infimum on K. Proof: the image f(K) is compact (continuous image of compact is compact), hence by Heine-Borel closed and bounded in ℝ, so it has both a max and a min, both in f(K). On non-compact sets EVT fails: x ↦ x on (0, 1) has no max, x ↦ 1/x on (0, 1) has no max either. EVT is the basis of all of optimization theory: any continuous loss function on a compact constraint set is minimized.
Why is uniform continuity automatic on compact sets?
Heine-Cantor theorem: any continuous function on a compact set is uniformly continuous. Pointwise continuity gives one δ per point per ε; uniform continuity demands a single δ that works everywhere given ε. Compactness lets you cover the domain with finitely many δ-balls; the minimum of finitely many positives is positive — that's the uniform δ. This is why ∫_a^b f(x) dx makes sense for any continuous f : [a, b] → ℝ — the partitions yield Riemann sums whose oscillation goes to zero uniformly.
Is sequential compactness equivalent to compactness in metric spaces?
Yes — in any metric space, compactness (every open cover has a finite subcover), sequential compactness (every sequence has a convergent subsequence), and being complete-and-totally-bounded are all equivalent. In general topological spaces these split: compactness is the topological definition; sequential compactness is weaker; the Tychonoff theorem (a product of compact spaces is compact) requires open-cover compactness. For analysis problems set in ℝⁿ or in metric spaces, sequential compactness is the workhorse — it's how you extract convergent subsequences in approximation arguments.