The Heine–Borel theorem
Statement
Let \( K \subseteq \mathbb{R}^n \), where \( \mathbb{R}^n \) carries the standard Euclidean metric \( d(x,y) = \lVert x - y \rVert \) and the topology it induces. Then \( K \) is compact — every cover of \( K \) by open subsets of \( \mathbb{R}^n \) admits a finite subcover — if and only if \( K \) is closed in \( \mathbb{R}^n \) and bounded, i.e. \( \exists M \gt 0 \) with \( \lVert x \rVert \le M \) for all \( x \in K \). Both the finite dimension of the ambient space and the completeness of \( \mathbb{R} \) are essential: the equivalence fails in infinite-dimensional normed spaces and in incomplete metric spaces.
Why it matters
Compactness is the property that turns local information into global information: a condition verified near each point of a compact set can be enforced by finitely many verifications. But the covering definition is awkward to check directly. Heine–Borel replaces it, in \( \mathbb{R}^n \), by two conditions you can verify by inspection — closedness and boundedness. Almost every existence theorem of a first analysis course (extreme values, uniform continuity, attainment of distances) runs through this reduction.
The theorem is also the standard-bearer for a recurring theme: properties of \( \mathbb{R}^n \) that silently use finite dimensionality. Riesz's lemma shows that in any infinite-dimensional normed space the closed unit ball is not compact, so Heine–Borel is precisely a finite-dimensional phenomenon — the reason functional analysis needs weak topologies at all.
Hypotheses
Proof
We prove the two implications separately. Throughout, \( B(x,r) = \{ y \in \mathbb{R}^n : \lVert y - x \rVert \lt r \} \) denotes the open ball.
Part I: compact \( \Rightarrow \) closed and bounded.
Part II: closed and bounded \( \Rightarrow \) compact. We first prove that every closed box \( Q = [a_1,b_1] \times \dots \times [a_n,b_n] \) is compact (Steps 6–9), then deduce the general case (Steps 10–11).
Result
Reading. In Euclidean space, and only there among the spaces you meet early, the abstract covering property collapses to two checkable conditions: the set contains all its limit points, and it fits inside some ball. Whenever you can verify those two facts, you may deploy the full power of compactness — finite subcovers, attained extrema, uniform estimates.
Scope. Valid in \( \mathbb{R}^n \) for every finite \( n \) (and in any finite-dimensional normed space over \( \mathbb{R} \) or \( \mathbb{C} \), since all norms there are equivalent). The implication compact \( \Rightarrow \) closed and bounded holds in every metric space; the reverse implication fails in every infinite-dimensional normed space (Riesz) and in incomplete spaces such as \( \mathbb{Q} \).
Corollaries & converses
- Extreme value theorem. A continuous \( f : K \to \mathbb{R} \) on compact \( K \subseteq \mathbb{R}^n \) is bounded and attains \( \sup_K f \) and \( \inf_K f \) (continuous images of compact sets are compact, and a compact subset of \( \mathbb{R} \) is closed and bounded, hence contains its supremum).
- Bolzano–Weierstrass. Every bounded sequence in \( \mathbb{R}^n \) has a convergent subsequence: its terms lie in a closed box, which is compact, and in metric spaces compactness is equivalent to sequential compactness.
- Heine–Cantor. A continuous function on a closed bounded subset of \( \mathbb{R}^n \) is uniformly continuous.
- Cantor intersection property. A decreasing sequence of nonempty closed bounded subsets of \( \mathbb{R}^n \) has nonempty intersection (Problem 5).
- Converses. The statement is itself a biconditional, so both directions hold in \( \mathbb{R}^n \). In a general metric space only "compact \( \Rightarrow \) closed and bounded" survives; the converse fails, e.g. for the closed unit ball of \( \ell^2 \), or for \( [0,2] \cap \mathbb{Q} \) inside \( \mathbb{Q} \). Indeed Riesz's lemma shows the closed unit ball of a normed space is compact iff the space is finite-dimensional.
Fails without
- Drop closedness: \( (0,1) \subseteq \mathbb{R} \) is bounded but the open cover \( \{ (\tfrac{1}{m}, 1) : m \ge 2 \} \) has no finite subcover: any finite subfamily has a largest \( m_0 \) and misses \( (0, \tfrac{1}{m_0}] \cap (0,1) \).
- Drop boundedness: \( \mathbb{Z} \subseteq \mathbb{R} \) is closed, but \( \{ (k - \tfrac12, k + \tfrac12) : k \in \mathbb{Z} \} \) covers it with each interval containing exactly one integer, so no finite subfamily covers infinitely many integers.
- Drop finite dimension: in \( \ell^2 \), the closed unit ball is closed and bounded, yet the basis vectors satisfy \( \lVert e_i - e_j \rVert = \sqrt{2} \) for \( i \ne j \), so \( (e_k) \) has no Cauchy — hence no convergent — subsequence, and the ball is not (sequentially) compact.
- Drop completeness of the ambient field: in \( \mathbb{Q} \), the set \( [0,2] \cap \mathbb{Q} \) is closed in \( \mathbb{Q} \) and bounded, but the sequence of rational truncations of \( \sqrt{2} \) has no limit in \( \mathbb{Q} \), so the set is not compact.
Common errors
- Exporting the theorem beyond \( \mathbb{R}^n \). Writing "closed and bounded, hence compact" for a set of functions in \( C[0,1] \) or a subset of \( \ell^p \). In infinite dimensions you need Arzelà–Ascoli or weak-* compactness instead.
- Closed relative to what? \( [0,2] \cap \mathbb{Q} \) is closed in \( \mathbb{Q} \) but not in \( \mathbb{R} \). Compactness of \( K \) is intrinsic, but "closed" in Heine–Borel means closed in \( \mathbb{R}^n \).
- Finite subcover of a cover you chose. To prove compactness from the definition you must handle an arbitrary open cover; exhibiting one particular cover with a finite subcover proves nothing. Conversely, to disprove compactness a single bad cover suffices.
- "Bounded" confused with "finite" or with "has a maximum". \( (0,1) \) is bounded and has no maximum; boundedness alone never yields attained extrema — closedness is doing that work.
- Assuming the infimum of infinitely many radii is positive. Step 4 takes a minimum over a finite subcover; over an infinite family, \( \inf r_y \) can be \( 0 \), and the argument collapses. This is precisely why compactness, not mere coveredness, is needed.
Discussion
The theorem's name records a slow crystallisation rather than a single discovery. Dirichlet (in 1852 lectures, published 1904) and Heine (1872) used covering arguments implicitly to prove uniform continuity on closed intervals; Borel (1895) isolated and proved the covering statement for countable covers of \( [a,b] \); Lebesgue and Schoenflies (circa 1900) removed countability and popularised the modern form. The bisection proof given above descends from Bolzano's 1817 argument for the intermediate value theorem — the same divide-and-conquer engine drives Bolzano–Weierstrass.
Structurally, Heine–Borel splits into two independent ingredients. "Closed subset of a compact set is compact" (Steps 10–11) is pure topology and holds everywhere. "The closed box is compact" (Steps 6–9) is where geometry enters: it needs both completeness (Step 8, the nested intervals close up on a genuine point) and total boundedness (a box splits into finitely many pieces of half the diameter). In fact the correct generalisation to arbitrary metric spaces is exactly: \( K \) is compact iff \( K \) is complete and totally bounded. Heine–Borel is the special case in which completeness is inherited from \( \mathbb{R}^n \) (closed subsets of complete spaces are complete) and total boundedness collapses to boundedness because a bounded set in \( \mathbb{R}^n \) sits inside a box that can be chopped into finitely many small boxes — a manoeuvre that consumes finite dimensionality.
Two deeper vantage points. First, foundations: over the base theory \( \mathsf{RCA}_0 \) of reverse mathematics, the Heine–Borel covering lemma for \( [0,1] \) is equivalent to weak König's lemma (\( \mathsf{WKL}_0 \)) — the statement that every infinite binary tree has an infinite path — whereas Bolzano–Weierstrass is strictly stronger, equivalent to \( \mathsf{ACA}_0 \). So the two "compactness" facts that look interchangeable in a first course have genuinely different logical strength. Second, topology: Tychonoff's theorem gives compactness of \( [-M,M]^n \) as a product of compact intervals (for finite products no choice principle is needed), and Alaoglu's theorem restores a Heine–Borel-type statement in infinite dimensions by trading the norm topology for the weak-* topology — the closed unit ball of a dual space is weak-* compact, which is why weak topologies are the natural habitat of infinite-dimensional analysis.
Common misconceptions. "Compact means closed and bounded" is a theorem about \( \mathbb{R}^n \), not a definition of compactness; treating it as a definition makes the \( \ell^2 \) unit ball look compact when it is not. Also, compactness of \( K \) does not depend on the ambient space ( it is intrinsic to \( K \) with its subspace topology), whereas closedness does — the interval \( (0,1) \) is closed in itself but is not compact.
Worked examples
Example 1. The unit sphere \( S^{n-1} = \{ x \in \mathbb{R}^n : \lVert x \rVert = 1 \} \) is compact, and every continuous \( f : S^{n-1} \to \mathbb{R} \) attains a minimum.
Reading. This is the engine behind the equivalence of all norms on \( \mathbb{R}^n \): one bounds any norm below by its minimum on the Euclidean sphere, which Heine–Borel guarantees is attained and positive.
Scope. Any level set \( \{ g = c \} \) of a continuous \( g \) that happens to be bounded is compact by the same two moves.
Example 2. A direct covering argument: every continuous \( f : [a,b] \to \mathbb{R} \) is bounded. (Here we use the finite-subcover property itself, not a corollary.)
Reading. Local boundedness (trivial from continuity) is upgraded to global boundedness by trading an infinite family of local certificates for finitely many — exactly what a finite subcover does.
Scope. The identical argument works for continuous real-valued functions on any compact subset of \( \mathbb{R}^n \), and shows why it fails on \( (0,1] \): consider \( f(y) = \tfrac{1}{y} \), where no finite subfamily of the \( U_x \) reaches the left end.
Problems
- Show directly from the theorem that \( K = [0,1] \cup [2,3] \) and the Cantor set \( C \) are compact.
Solution
\( [0,1] \cup [2,3] \) is a finite union of closed sets, hence closed, and is contained in \( [0,3] \), hence bounded; Heine–Borel gives compactness. For the Cantor set: \( C = \bigcap_{k=0}^{\infty} C_k \), where \( C_0 = [0,1] \) and each \( C_k \) is a finite union of \( 2^k \) closed intervals of length \( 3^{-k} \). Each \( C_k \) is closed (finite union of closed intervals), so the intersection \( C \) is closed (arbitrary intersections of closed sets are closed). Also \( C \subseteq [0,1] \), so \( C \) is bounded. By Heine–Borel, \( C \) is compact. Note that compactness follows without any analysis of what points \( C \) actually contains — the theorem converts two structural facts into compactness.
- Let \( K \subseteq \mathbb{R}^n \) be compact and \( F \subseteq \mathbb{R}^n \) closed. Prove \( K \cap F \) is compact. Then give an example showing the intersection of two closed sets need not be compact.
Solution
By Heine–Borel, \( K \) is closed and bounded. Then \( K \cap F \) is closed, being an intersection of two closed sets, and bounded, being a subset of the bounded set \( K \). Heine–Borel (converse direction) gives compactness. For the example: \( F_1 = \mathbb{R} \times \{0\} \) and \( F_2 = \{ (x, 0) : x \ge 0 \} \) are both closed in \( \mathbb{R}^2 \), and \( F_1 \cap F_2 = [0,\infty) \times \{0\} \) is closed but unbounded, hence not compact — compactness of at least one factor is essential.
- Let \( K \subseteq \mathbb{R}^n \) be nonempty and compact and let \( x \in \mathbb{R}^n \). Prove that the distance \( d(x, K) = \inf_{y \in K} \lVert x - y \rVert \) is attained: there exists \( y_0 \in K \) with \( \lVert x - y_0 \rVert = d(x,K) \). Show by example that attainment can fail if \( K \) is merely closed and we ask instead for two sets: exhibit disjoint closed sets \( A, B \subseteq \mathbb{R}^2 \) with \( \inf \{ \lVert a - b \rVert : a \in A, b \in B \} = 0 \).
Solution
The map \( g : K \to \mathbb{R} \), \( g(y) = \lVert x - y \rVert \), satisfies \( |g(y) - g(z)| \le \lVert y - z \rVert \) by the triangle inequality, so \( g \) is continuous (indeed 1-Lipschitz). \( K \) is compact, so by the extreme value theorem (Example 1, Step 3 — itself a consequence of Heine–Borel) \( g \) attains its infimum at some \( y_0 \in K \), giving \( \lVert x - y_0 \rVert = d(x, K) \).
For the failure with two closed sets: take \( A = \{ (t, 0) : t \in \mathbb{R} \} \) and \( B = \{ (t, e^{-t}) : t \in \mathbb{R} \} \) (the graph of a continuous function is closed, and \( e^{-t} \gt 0 \) means \( A \cap B = \emptyset \)). Then \( \lVert (t,0) - (t, e^{-t}) \rVert = e^{-t} \to 0 \) as \( t \to \infty \), so the infimum of distances is \( 0 \) but is never attained. Both sets are closed but neither is bounded; if either were compact, the distance between disjoint closed sets, one compact, would be attained and positive.
- Prove, using only the covering definition, that \( K = \{0\} \cup \{ \tfrac{1}{m} : m \in \mathbb{N} \} \subseteq \mathbb{R} \) is compact, and that \( K \setminus \{0\} \) is not. Reconcile both facts with Heine–Borel.
Solution
\( K \) is compact: let \( \mathcal{U} \) be an open cover. Some \( U_0 \in \mathcal{U} \) contains \( 0 \); since \( U_0 \) is open, \( (-\varepsilon, \varepsilon) \subseteq U_0 \) for some \( \varepsilon \gt 0 \). By the Archimedean property, only finitely many points \( \tfrac{1}{m} \) satisfy \( \tfrac{1}{m} \ge \varepsilon \), namely those with \( m \le \tfrac{1}{\varepsilon} \). For each such point choose one covering set \( U_m \in \mathcal{U} \). Then \( U_0 \) together with these finitely many \( U_m \) covers \( K \).
\( K \setminus \{0\} \) is not compact: the sets \( V_m = ( \tfrac{1}{m} - r_m, \, \tfrac{1}{m} + r_m ) \) with \( r_m = \tfrac{1}{2} \big( \tfrac{1}{m} - \tfrac{1}{m+1} \big) \) are open, pairwise disjoint, and each contains exactly one point of \( K \setminus \{0\} \); hence \( \{V_m\} \) is an open cover with no finite subcover (a finite subfamily covers only finitely many points).
Reconciliation: \( K \) is bounded (contained in \( [0,1] \)) and closed — its only limit point is \( 0 \), which it contains — so Heine–Borel predicts compactness. \( K \setminus \{0\} \) is still bounded but fails to contain its limit point \( 0 \), so it is not closed, and Heine–Borel correctly predicts non-compactness.
- (Cantor intersection, and the failure of Heine–Borel in \( C[0,1] \).) (a) Let \( K_1 \supseteq K_2 \supseteq K_3 \supseteq \dots \) be nonempty compact subsets of \( \mathbb{R}^n \). Prove \( \bigcap_{k=1}^{\infty} K_k \ne \emptyset \). (b) In the space \( C[0,1] \) with the supremum norm \( \lVert f \rVert_\infty = \sup_{t \in [0,1]} |f(t)| \), show that the closed unit ball is closed and bounded but not compact.
Solution
(a) Suppose \( \bigcap_k K_k = \emptyset \). Set \( U_k = \mathbb{R}^n \setminus K_k \); each is open since \( K_k \) is compact, hence closed by Heine–Borel. For any \( x \in K_1 \), the assumption gives some \( k \) with \( x \notin K_k \), i.e. \( x \in U_k \); therefore \( \{U_k\}_{k \ge 2} \) is an open cover of \( K_1 \). Compactness of \( K_1 \) yields a finite subcover \( U_{k_1}, \dots, U_{k_p} \); since the \( K_k \) decrease, the \( U_k \) increase, so \( K_1 \subseteq U_{k^*} \) where \( k^* = \max_i k_i \). But then \( K_{k^*} \subseteq K_1 \subseteq \mathbb{R}^n \setminus K_{k^*} \), forcing \( K_{k^*} = \emptyset \) — contradicting nonemptiness. Hence the intersection is nonempty.
(b) The ball \( \overline{B} = \{ f : \lVert f \rVert_\infty \le 1 \} \) is bounded by definition and closed (if \( f_j \to f \) uniformly with \( \lVert f_j \rVert_\infty \le 1 \), then \( |f(t)| = \lim_j |f_j(t)| \le 1 \) for every \( t \)). To defeat compactness, consider \( f_m(t) = t^m \), all in \( \overline{B} \). For \( m \lt m' \), evaluate at \( t_0 = (1/2)^{1/m} \): \( f_m(t_0) = \tfrac12 \) while \( f_{m'}(t_0) = (1/2)^{m'/m} \lt \tfrac12 \), and more decisively \( \lVert f_m - f_{m'} \rVert_\infty \ge f_m(t_0) - f_{m'}(t_0) \to \tfrac12 - 0 \) along suitable subsequences; in fact one checks \( \sup_m \inf_{m' \gt m} \lVert f_m - f_{m'} \rVert_\infty \ge \tfrac14 \), so \( (f_m) \) has no uniformly convergent — i.e. no norm-convergent — subsequence. (Alternatively: the pointwise limit of \( t^m \) is the discontinuous function \( \mathbf{1}_{\{t = 1\}} \), and a uniform limit of continuous functions must be continuous, so no subsequence can converge uniformly.) Since compactness in metric spaces implies sequential compactness, \( \overline{B} \) is not compact. This exhibits concretely that Heine–Borel is a theorem about finite-dimensional spaces: \( C[0,1] \) is complete, so what fails is total boundedness, and the missing hypothesis is finite dimension (Riesz's lemma).