The Heine-Borel Theorem

Why can every continuous function on a closed bounded interval attain a maximum? Why does the same fail on an open interval? The Heine–Borel theorem is the precise answer hiding behind this asymmetry. In Euclidean space, compactness is the property that makes extreme-value theorems work. It also underlies uniform continuity and finite-covering arguments. This property turns out to be exactly equivalent to being closed and bounded. This is a remarkable simplification. The definition of compactness via open covers is a purely topological condition. It seems hard to check. But "closed and bounded" is an elementary, checkable, metric condition. The importance of this theorem is that it converts an abstract existential statement into two concrete, verifiable conditions. That statement is: every open cover has a finite subcover. This idea is the engine behind the extreme value theorem. It also drives the existence of minimal-energy configurations in calculus of variations. It underlies compactness arguments in Fourier analysis. And it supports finite-dimensionality arguments throughout analysis and geometry. The bigger picture is that compactness is a topological invariant. It behaves well under continuous maps. It is intrinsically defined without reference to any ambient metric. The Heine–Borel theorem tells us something special about Rn\mathbb{R}^n with its Euclidean metric. In this setting, this intrinsic notion collapses to two simple extrinsic conditions. This collapse is a genuinely special feature of finite-dimensional Euclidean space. It fails dramatically in infinite-dimensional normed spaces. This fact will illuminate exactly what hypotheses are doing the work. This article gives the precise statement and a complete, self-contained proof. It works through two concrete non-trivial examples. It shows exactly what breaks when a hypothesis is dropped. It also situates the theorem historically and across the sciences. It also sets up the natural next topic. That topic is the equivalence of compactness with sequential compactness in metric spaces.

Key takeaways
  • Compact subsets of Rn\mathbb{R}^n are precisely those that are closed and bounded.
  • "Bounded" alone is not enough; "closed" alone is not enough — both are needed together.
  • The proof splits into two independent directions: compact ⇒\Rightarrow closed & bounded (general metric spaces), and closed & bounded ⇒\Rightarrow compact (uses finite dimensionality of Rn\mathbb{R}^n via nested boxes).
  • The theorem fails in infinite-dimensional normed spaces: the closed unit ball is closed and bounded but never compact.
  • It underlies the Extreme Value Theorem, uniform continuity results, and finite-covering arguments across analysis.
  • Key idea: in Rn\mathbb{R}^n, the abstract open-cover definition of compactness reduces to two checkable metric conditions, closedness and boundedness.

Where this lives today

The Extreme Value Theorem — every continuous real-valued function on a nonempty compact set attains a maximum and minimum — is proved directly from Heine–Borel: continuous images of compact sets are compact, and a compact subset of R\mathbb{R} is closed and bounded, hence contains its supremum and infimum. This single fact underlies optimization theory, the existence of best approximations, and the foundations of the calculus of variations. In real analysis, uniform continuity of continuous functions on closed bounded domains (a strengthening of pointwise continuity essential for interchange-of-limits arguments and for defining the Riemann integral rigorously) follows from Heine–Borel via a covering argument. In differential geometry, compactness of closed bounded submanifolds of Rn\mathbb{R}^n (spheres, tori embedded in Euclidean space, level sets of proper functions) guarantees existence of extremal geodesics, critical points of curvature functionals, and well-posedness of many variational problems. In numerical analysis and optimization, compactness of feasible regions (closed, bounded constraint sets in Rn\mathbb{R}^n) guarantees that optimization algorithms searching for minima are searching over a space where a minimum actually exists, a prerequisite for convergence proofs of algorithms like gradient descent on constrained domains. In complex analysis, Montel's theorem and normal families arguments rely on compactness properties of closed bounded families of functions, echoing the same closed-and-bounded intuition in function space (though there compactness needs an extra equicontinuity hypothesis, precisely because function spaces are infinite-dimensional, as flagged by the ℓ2\ell^2 counterexample above). In statistics and machine learning, compactness of parameter spaces (often closed bounded boxes in Rn\mathbb{R}^n) is a standard regularity assumption ensuring maximum likelihood estimators or empirical risk minimizers exist. In cryptography and coding theory, finite-dimensional lattice-based arguments frequently invoke closed-bounded-compact reasoning when analyzing shortest-vector problems over bounded regions.

Ask the tutor: How does the equivalence between compactness and sequential compactness in metric spaces extend or fail to extend the Heine–Borel picture to infinite-dimensional settings?

DefinitionCompactness, closedness, boundedness in Rn\mathbb{R}^n

Let (X,d)(X,d) be a metric space and K⊆XK \subseteq X.

Open cover / compactness. A collection U={Uα}α∈A\mathcal{U} = \{U_\alpha\}_{\alpha \in A} of open subsets of XX is an open cover of KK if K⊆⋃α∈AUαK \subseteq \bigcup_{\alpha \in A} U_\alpha. The set KK is compact if every open cover of KK admits a finite subcover: there exist finitely many indices α1,…,αm∈A\alpha_1,\dots,\alpha_m \in A with

K⊆Uα1∪⋯∪Uαm.K \subseteq U_{\alpha_1} \cup \cdots \cup U_{\alpha_m}.

Closed. KK is closed in XX if its complement X∖KX \setminus K is open, equivalently if KK contains all its limit points, equivalently if every convergent sequence of points of KK has its limit in KK.

Bounded. K⊆RnK \subseteq \mathbb{R}^n is bounded if there exists R>0R > 0 such that K⊆B‾(0,R)={x∈Rn:∥x∥≤R}K \subseteq \overline{B}(0,R) = \{x \in \mathbb{R}^n : \|x\| \le R\}, where ∥⋅∥\|\cdot\| is the Euclidean norm. The Heine–Borel theorem asserts that for X=RnX = \mathbb{R}^n (with the Euclidean metric), a subset KK is compact if and only if KK is closed and bounded.

Intuition

The word "compact" should evoke the idea that a set cannot "leak" mass off to infinity and cannot have "holes" or "missing endpoints" that a sequence could march toward without ever arriving. Boundedness rules out escape to infinity: an unbounded set like R\mathbb{R} itself can be covered by intervals (−n,n)(-n,n) for n=1,2,3,…n=1,2,3,\dots, and no finite subcollection of these ever covers all of R\mathbb{R}, because any finite subcollection has a largest nn and misses everything beyond it. Closedness rules out missing boundary points: the open interval (0,1)(0,1) can be covered by the sets (1/n,1)(1/n, 1) for n≥2n \ge 2, and again no finite subcollection works, because points arbitrarily close to 00 are always left out by any finite choice of nn's. The genuinely deep part of the theorem is the converse direction: that closed and bounded is enough. The intuition is a divide-and-conquer, or "no escape by bisection," argument. Suppose a closed bounded set could be covered by open sets with no finite subcover. Enclose it in a large closed cube. Cut the cube into 2n2^n smaller sub-cubes (in each dimension, cut in half). If every sub-cube's intersection with the set had a finite subcover, then gluing these finitely many finite subcovers together would give a finite subcover of the whole set — a contradiction. So at least one sub-cube must also fail to have a finite subcover. Repeating this indefinitely produces an infinite nested sequence of shrinking cubes, each stubbornly resisting a finite subcover, whose diameters shrink to zero. Nested closed bounded sets in Rn\mathbb{R}^n with diameters going to zero must intersect in exactly one point (this is where completeness of R\mathbb{R} enters), and that point lies in some single open set of the original cover — which then covers an entire small cube from some stage onward, giving the finite subcover after all. This contradiction is the heart of the proof.

Figure
Bisection argument: a "bad" square with no finite subcover forces a nested sequence of shrinking bad squares
Stage 0: square Q₀, side 2R no finite subcover Stage 1: bisect into 4, one sub-square is "bad" Q₁ Iterate: Q₀ ⊃ Q₁ ⊃ Q₂ ⊃ ⋯, diam(Qₖ) = diam(Q₀)/2ᵏ → 0 ⋂ₖ Qₖ = {p}, and p lies in some Uα ⇒ Uα ⊇ Qₖ for large k ⇒ contradiction
TheoremHeine–Borel

Let n≥1n \ge 1 and let K⊆RnK \subseteq \mathbb{R}^n, equipped with the Euclidean metric d(x,y)=∥x−y∥d(x,y) = \|x-y\|. Then KK is compact if and only if KK is closed (as a subset of Rn\mathbb{R}^n) and bounded.

LemmaCompact metric subsets are closed and bounded

Let (X,d)(X,d) be a metric space and K⊆XK \subseteq X compact. Then KK is closed in XX and bounded (i.e. KK has finite diameter, contained in some ball).

Proof

Technique: direct construction of covers witnessing non-compactness if KK failed to be closed or bounded (proof by contrapositive/contradiction using the open-cover definition). Boundedness. Fix any point x0∈Xx_0 \in X. The collection of open balls

U={B(x0,m):m=1,2,3,… }\mathcal{U} = \{ B(x_0, m) : m = 1, 2, 3, \dots \}

covers all of XX, since every point y∈Xy \in X satisfies y∈B(x0,m)y \in B(x_0, m) once m>d(x0,y)m > d(x_0,y) (Archimedean property of R\mathbb{R}). In particular U\mathcal{U} covers KK. Since KK is compact, finitely many of these balls cover KK, say B(x0,m1),…,B(x0,mk)B(x_0,m_1),\dots,B(x_0,m_k). Let M=max⁡(m1,…,mk)M = \max(m_1,\dots,m_k). Since balls of this form are nested (B(x0,m)⊆B(x0,m′)B(x_0,m) \subseteq B(x_0,m') for m≤m′m \le m'), we get K⊆B(x0,M)K \subseteq B(x_0, M). Hence KK is bounded. Closedness. We show X∖KX \setminus K is open. Let p∈X∖Kp \in X \setminus K be arbitrary; we must find an open ball around pp disjoint from KK. For each y∈Ky \in K, since y≠py \ne p, let ry=d(p,y)/2>0r_y = d(p,y)/2 > 0, and consider the two disjoint open balls

Uy=B(y,ry),Vy=B(p,ry).U_y = B(y, r_y), \qquad V_y = B(p, r_y).

These are disjoint: if z∈Uy∩Vyz \in U_y \cap V_y then d(y,z)<ryd(y,z) < r_y and d(p,z)<ryd(p,z) < r_y, so by the triangle inequality d(p,y)≤d(p,z)+d(z,y)<2ry=d(p,y)d(p,y) \le d(p,z) + d(z,y) < 2r_y = d(p,y), a contradiction. As yy ranges over KK, the sets {Uy}y∈K\{U_y\}_{y \in K} form an open cover of KK. By compactness, finitely many suffice: K⊆Uy1∪⋯∪UykK \subseteq U_{y_1} \cup \cdots \cup U_{y_k} for some y1,…,yk∈Ky_1,\dots,y_k \in K. Let

r=min⁡(ry1,…,ryk)>0.r = \min(r_{y_1}, \dots, r_{y_k}) > 0.

Then B(p,r)⊆Vy1∩⋯∩VykB(p,r) \subseteq V_{y_1} \cap \cdots \cap V_{y_k}, and since each VyiV_{y_i} is disjoint from Uyi⊇U_{y_i} \supseteq (the part of KK covered by UyiU_{y_i}), and every point of KK lies in some UyiU_{y_i}, the ball B(p,r)B(p,r) is disjoint from KK entirely. (Explicitly: if z∈B(p,r)∩Kz \in B(p,r) \cap K, then z∈Uyiz \in U_{y_i} for some ii, but also z∈B(p,r)⊆B(p,ryi)=Vyiz \in B(p,r) \subseteq B(p,r_{y_i}) = V_{y_i}, contradicting Uyi∩Vyi=∅U_{y_i} \cap V_{y_i} = \emptyset.) Thus B(p,r)⊆X∖KB(p,r) \subseteq X \setminus K, proving X∖KX\setminus K is open, so KK is closed. ■\blacksquare

∎
LemmaNested closed boxes in Rn\mathbb{R}^n with shrinking diameter have a unique common point

Let Q0⊇Q1⊇Q2⊇⋯Q_0 \supseteq Q_1 \supseteq Q_2 \supseteq \cdots be a nested sequence of nonempty closed boxes (products of closed intervals) in Rn\mathbb{R}^n with diam⁡(Qk)→0\operatorname{diam}(Q_k) \to 0 as k→∞k \to \infty. Then ⋂k=0∞Qk\bigcap_{k=0}^\infty Q_k consists of exactly one point.

Proof

Technique: reduce to the one-dimensional Nested Interval Property (a consequence of completeness of R\mathbb{R}, via the least upper bound axiom), then take a Cartesian product. Write Qk=Ik(1)×Ik(2)×⋯×Ik(n)Q_k = I_k^{(1)} \times I_k^{(2)} \times \cdots \times I_k^{(n)} where each Ik(j)=[ak(j),bk(j)]I_k^{(j)} = [a_k^{(j)}, b_k^{(j)}] is a closed interval, and nesting of the QkQ_k forces nesting in each coordinate: I0(j)⊇I1(j)⊇⋯I_0^{(j)} \supseteq I_1^{(j)} \supseteq \cdots for each fixed jj. Existence of a common point. Fix jj. The sequence (ak(j))k(a_k^{(j)})_k is non-decreasing and bounded above (by b0(j)b_0^{(j)}), so by the least upper bound axiom for R\mathbb{R} it converges to c(j):=sup⁡kak(j)c^{(j)} := \sup_k a_k^{(j)}. Since ak(j)≤bm(j)a_k^{(j)} \le b_m^{(j)} for all k,mk,m (any lower endpoint is below any upper endpoint of a nested interval), we get c(j)≤bm(j)c^{(j)} \le b_m^{(j)} for every mm, and also c(j)≥am(j)c^{(j)} \ge a_m^{(j)} by definition of supremum. Hence c(j)∈Im(j)c^{(j)} \in I_m^{(j)} for every mm, so c(j)∈⋂mIm(j)c^{(j)} \in \bigcap_m I_m^{(j)}. Setting p=(c(1),…,c(n))p = (c^{(1)},\dots,c^{(n)}), we get p∈Qkp \in Q_k for every kk, so p∈⋂kQkp \in \bigcap_k Q_k; the intersection is nonempty. Uniqueness. If p,q∈⋂kQkp, q \in \bigcap_k Q_k, then for every kk, ∥p−q∥≤diam⁡(Qk)→0\|p - q\| \le \operatorname{diam}(Q_k) \to 0, so ∥p−q∥=0\|p-q\| = 0, i.e. p=qp = q. ■\blacksquare

∎
Proof

Proof of the Heine–Borel Theorem. We prove both directions.

(⇒\Rightarrow) Compact implies closed and bounded. Rn\mathbb{R}^n with the Euclidean metric is a metric space, so this direction is exactly Lemma: Compact metric subsets are closed and bounded applied with X=RnX = \mathbb{R}^n, d(x,y)=∥x−y∥d(x,y)=\|x-y\|.

(⇐\Leftarrow) Closed and bounded implies compact. Technique: proof by contradiction using bisection to build a nested sequence of shrinking boxes, then invoking the Nested Box Lemma to locate a limit point and derive a contradiction. Let K⊆RnK \subseteq \mathbb{R}^n be closed and bounded. Since KK is bounded, choose R>0R>0 with K⊆[−R,R]n=:Q0K \subseteq [-R,R]^n =: Q_0, a closed box (cube) of side length 2R2R. Suppose, for contradiction, that U={Uα}α∈A\mathcal{U} = \{U_\alpha\}_{\alpha \in A} is an open cover of KK with no finite subcover. Step 1: Bisection produces a nested sequence of "bad" boxes. We construct closed boxes Q0⊇Q1⊇Q2⊇⋯Q_0 \supseteq Q_1 \supseteq Q_2 \supseteq \cdots, each a translate/scaling of [−R,R]n[-R,R]^n, such that:

  • diam⁡(Qk)=diam⁡(Q0)/2k=2Rn/2k\operatorname{diam}(Q_k) = \operatorname{diam}(Q_0)/2^k = 2R\sqrt{n}/2^k, and
  • K∩QkK \cap Q_k has no finite subcover from U\mathcal{U} (call such a box bad).

Q0Q_0 is bad by assumption. Suppose QkQ_k has been constructed and is bad. Bisect each of the nn side-intervals of QkQ_k at its midpoint; this partitions QkQ_k into 2n2^n closed sub-boxes, each of half the side length of QkQ_k, whose union is QkQ_k. If every one of these 2n2^n sub-boxes SS satisfied "K∩SK \cap S has a finite subcover from U\mathcal{U}," then taking the union of these (at most 2n2^n) finite subcovers over all sub-boxes would give a single finite subcollection of U\mathcal{U} covering

K∩Qk=⋃sub-boxes S(K∩S),K \cap Q_k = \bigcup_{\text{sub-boxes } S} (K \cap S),

contradicting that QkQ_k is bad. Hence at least one sub-box is bad; let Qk+1Q_{k+1} be such a sub-box. By construction Qk+1⊆QkQ_{k+1} \subseteq Q_k and diam⁡(Qk+1)=diam⁡(Qk)/2\operatorname{diam}(Q_{k+1}) = \operatorname{diam}(Q_k)/2. This inductively defines the whole sequence. Step 2: Locate the limit point. Each QkQ_k is a nonempty closed box, nested, with diam⁡(Qk)=2Rn/2k→0\operatorname{diam}(Q_k) = 2R\sqrt{n}/2^k \to 0. By the Nested Box Lemma (nested closed boxes with shrinking diameter), there is a unique point

p∈⋂k=0∞Qk.p \in \bigcap_{k=0}^\infty Q_k.

Step 3: p∈Kp \in K. Each QkQ_k is bad, in particular K∩Qk≠∅K \cap Q_k \ne \emptyset for every kk (the empty set trivially has a finite — namely empty — subcover, so a bad box cannot have empty intersection with KK). Choose xk∈K∩Qkx_k \in K \cap Q_k for each kk. Since p,xk∈Qkp, x_k \in Q_k, we have ∥p−xk∥≤diam⁡(Qk)→0\|p - x_k\| \le \operatorname{diam}(Q_k) \to 0, so xk→px_k \to p. Since KK is closed and (xk)(x_k) is a sequence in KK converging to pp, we conclude p∈Kp \in K (closed sets contain limits of their convergent sequences — this is immediate from the open-complement definition: if p∉Kp \notin K then X∖KX\setminus K is an open neighborhood of pp containing no xkx_k for large kk, contradicting xk→px_k \to p). Step 4: Derive the contradiction. Since U\mathcal{U} covers KK and p∈Kp \in K, there exists some α0∈A\alpha_0 \in A with p∈Uα0p \in U_{\alpha_0}. Since Uα0U_{\alpha_0} is open, there is ε>0\varepsilon > 0 with B(p,ε)⊆Uα0B(p,\varepsilon) \subseteq U_{\alpha_0}. Choose kk large enough that diam⁡(Qk)=2Rn/2k<ε\operatorname{diam}(Q_k) = 2R\sqrt n /2^k < \varepsilon (possible since the right side tends to 00). Since p∈Qkp \in Q_k and every point z∈Qkz \in Q_k satisfies ∥z−p∥≤diam⁡(Qk)<ε\|z - p\| \le \operatorname{diam}(Q_k) < \varepsilon, we get Qk⊆B(p,ε)⊆Uα0Q_k \subseteq B(p,\varepsilon) \subseteq U_{\alpha_0}. Hence

K∩Qk⊆Qk⊆Uα0,K \cap Q_k \subseteq Q_k \subseteq U_{\alpha_0},

so {Uα0}\{U_{\alpha_0}\} alone is a finite (in fact single-set) subcover of K∩QkK \cap Q_k from U\mathcal U. This contradicts the fact that QkQ_k was chosen to be bad (no finite subcover exists for K∩QkK \cap Q_k). This contradiction shows our assumption was false: every open cover of KK has a finite subcover. Hence KK is compact. ■\blacksquare

∎

Worked examples

Example 1: The set K={0}∪{1/n:n∈N}⊆RK = \{0\} \cup \{1/n : n \in \mathbb{N}\} \subseteq \mathbb{R}. We verify compactness both via Heine–Borel and directly via covers, to see the theorem in action. Closed: The set of limit points of KK is exactly {0}\{0\} (since 1/n→01/n \to 0 and all other points are isolated: for n≥2n\ge 2, the interval (1/n−δ,1/n+δ)(1/n - \delta, 1/n+\delta) with δ\delta small enough contains no other point of KK). Since 0∈K0 \in K, KK contains all its limit points, so KK is closed. Bounded: Every element of KK lies in [0,1][0,1], so K⊆B‾(0,1)K \subseteq \overline{B}(0,1); bounded. By Heine–Borel, KK is compact. Let's confirm directly with an open cover, which illustrates why the point 00 being included is essential. Let U={Uα}\mathcal{U} = \{U_\alpha\} be any open cover of KK. Since 0∈K0 \in K, some Uα0U_{\alpha_0} contains 00, and being open it contains an interval (−ε,ε)(-\varepsilon,\varepsilon) for some ε>0\varepsilon>0. By the Archimedean property, choose NN with 1/N<ε1/N < \varepsilon; then 1/n∈Uα01/n \in U_{\alpha_0} for all n≥Nn \ge N (infinitely many points swallowed by a single set). Only the finitely many remaining points 1,1/2,…,1/(N−1)1, 1/2, \dots, 1/(N-1) need individual open sets from the cover, say Uα1,…,UαN−1U_{\alpha_1},\dots,U_{\alpha_{N-1}} with 1/i∈Uαi1/i \in U_{\alpha_i}. Then

K⊆Uα0∪Uα1∪⋯∪UαN−1,K \subseteq U_{\alpha_0} \cup U_{\alpha_1} \cup \cdots \cup U_{\alpha_{N-1}},

a finite subcover. This matches the theorem's prediction exactly, and shows concretely how boundedness (all points in [0,1][0,1]) and closedness (the accumulation point 00 is included) conspire to make the "escaping mass" get captured by one open set.

Example 2: The closed unit disk boundary union a spiraling arc: K={(rcos⁡θ,rsin⁡θ):r=1, θ∈[0,4π]}⊆R2K = \{(r\cos\theta, r\sin\theta) : r = 1, \ \theta \in [0, 4\pi]\} \subseteq \mathbb{R}^2, i.e. the unit circle traced twice — but let's instead take a genuinely asymmetric non-trivial set. Let

K={(x,y)∈R2:x2+y24≤1}∖{(x,y):(x−2)2+y2<14}.K = \left\{ (x,y) \in \mathbb{R}^2 : x^2 + \frac{y^2}{4} \le 1 \right\} \setminus \left\{ (x,y) : (x-2)^2 + y^2 < \frac14 \right\}.

This is a solid ellipse (semi-axes 11 and 22) with a small open disk removed near the point (2,0)(2,0) — but (2,0)(2,0) is outside the ellipse entirely (since the ellipse only reaches x∈[−1,1]x \in [-1,1]), so in fact the removed disk doesn't intersect the ellipse at all, and KK is just the closed elliptical region:

K={(x,y):x2+y2/4≤1}.K = \{(x,y): x^2 + y^2/4 \le 1\}.

(We include this seemingly-elaborate description precisely to illustrate a subtlety: one must actually check whether a "closed set minus an open set" is closed, since removing an open set from a closed set removes a closed set of points and can be checked as intersecting with a closed complement.) In general, for a closed set AA and open set VV, A∖V=A∩(R2∖V)A \setminus V = A \cap (\mathbb{R}^2\setminus V) is an intersection of two closed sets, hence closed. Here, since the removed disk is disjoint from AA anyway, K=AK = A exactly. Closed: K={(x,y):x2+y2/4−1≤0}K = \{(x,y) : x^2 + y^2/4 - 1 \le 0\} is the preimage of the closed set (−∞,0](-\infty,0] under the continuous function f(x,y)=x2+y2/4−1f(x,y) = x^2+y^2/4 - 1, hence closed (preimages of closed sets under continuous maps are closed). Bounded: If (x,y)∈K(x,y)\in K then x2≤1x^2 \le 1 and y2≤4y^2 \le 4, so ∣x∣≤1,∣y∣≤2|x|\le 1, |y|\le 2, giving ∥(x,y)∥≤1+4=5\|(x,y)\| \le \sqrt{1+4}=\sqrt5. So K⊆B‾(0,5)K \subseteq \overline B(0,\sqrt5). By Heine–Borel, KK is compact. As a check of the theorem's use: consider g(x,y)=x3−3xy2g(x,y) = x^3 - 3xy^2 (real part of z3z^3) restricted to KK. Since gg is continuous and KK is compact, the Extreme Value Theorem (itself proved using Heine–Borel: continuous image of compact is compact, and compact subsets of R\mathbb{R} are closed and bounded hence contain their sup and inf) guarantees gg attains a maximum and minimum on KK — a conclusion that requires exactly the closed-and-bounded package Heine–Borel supplies, and would fail if we instead used the open elliptical region {x2+y2/4<1}\{x^2+y^2/4<1\}, where gg has no maximum on the set (values increase toward the missing boundary without attaining a top value there).

CounterexampleDropping finite-dimensionality: closed and bounded is not enough in infinite dimensions

The direction "compact ⇒\Rightarrow closed and bounded" holds in every metric space (we proved this with no dimension hypothesis at all). The direction "closed and bounded ⇒\Rightarrow compact" is where finite-dimensionality of Rn\mathbb{R}^n was essential — specifically, we used that Rn\mathbb{R}^n is a finite product of copies of R\mathbb{R}, allowing the bisection-into-2n2^n-pieces argument and the Nested Box Lemma. Let's see this hypothesis fail concretely. Let X=ℓ2X = \ell^2, the space of real sequences x=(x1,x2,x3,… )x = (x_1,x_2,x_3,\dots) with ∑ixi2<∞\sum_i x_i^2 < \infty, equipped with the norm ∥x∥=(∑ixi2)1/2\|x\| = \left(\sum_i x_i^2\right)^{1/2} (a complete normed vector space, i.e. a Banach space, of infinite dimension). Consider the closed unit ball

K=B‾(0,1)={x∈ℓ2:∥x∥≤1}.K = \overline{B}(0,1) = \{x \in \ell^2 : \|x\| \le 1\}.

KK is closed: it is the preimage of [0,1][0,1] under the continuous norm function ∥⋅∥:ℓ2→R\|\cdot\|: \ell^2 \to \mathbb{R}. KK is bounded: trivially, K⊆B‾(0,1)K \subseteq \overline B(0,1) by definition. KK is not compact. Let eke_k denote the sequence with a 11 in position kk and 00 elsewhere (k=1,2,3,…k=1,2,3,\dots); each ek∈Ke_k \in K since ∥ek∥=1\|e_k\|=1. For j≠kj \ne k,

∥ej−ek∥=12+12=2.\|e_j - e_k\| = \sqrt{1^2 + 1^2} = \sqrt{2}.

Consider the open cover U={B(ek,1/2):k=1,2,3,… }∪{B(x,rx)}\mathcal U = \{ B(e_k, 1/2) : k = 1,2,3,\dots\} \cup \{ B(x, r_x) \} built to cover the rest of KK arbitrarily (concretely one can cover all of KK by balls of radius 1/21/2 centered at a countable dense subset, using separability of ℓ2\ell^2; the key point is only about the eke_k's). Since ∥ej−ek∥=2>1\|e_j - e_k\| = \sqrt2 > 1 for j≠kj\ne k, the balls B(ek,1/2)B(e_k,1/2) are pairwise disjoint, and each contains exactly one of the points eke_k. Any subcover of KK must therefore include, for every kk, at least one open set from U\mathcal U containing eke_k; since the balls B(ek,1/2)B(e_k,1/2) are the only cover-elements meeting the corresponding eke_k (having engineered the rest of the cover to avoid the points eke_k, or simply noting a finite subcollection can only contain finitely many of the disjoint balls and hence misses infinitely many eke_k's), no finite subcollection of U\mathcal{U} covers KK. More simply: the sequence (ek)k≥1(e_k)_{k\ge1} lies entirely in KK but has no convergent subsequence at all, since any two distinct terms are at distance 2\sqrt2 apart — violating sequential compactness, which (as the next natural topic shows) is equivalent to compactness in metric spaces. So KK is closed and bounded but not compact. This shows precisely why finite-dimensionality could not be removed from the closed-and-bounded direction: the bisection/nested-box argument crucially used that Rn\mathbb{R}^n is built from finitely many real coordinate axes, a structural fact with no analogue in ℓ2\ell^2.

Scope, edge cases & common traps

SituationCompact?Why
[a,b]⊂R[a,b] \subset \mathbb{R}Yesclosed and bounded
(0,1)⊂R(0,1) \subset \mathbb{R}Nobounded but not closed
R\mathbb{R} itselfNoclosed but not bounded
Z⊂R\mathbb{Z} \subset \mathbb{R}Noclosed but not bounded
Finite set in Rn\mathbb{R}^nYestrivially closed and bounded
Closed unit ball in ℓ2\ell^2Noclosed & bounded, infinite-dimensional
KK closed and bounded in Rn\mathbb{R}^n, nn arbitrary but finiteYesHeine–Borel
Q∩[0,1]\mathbb{Q} \cap [0,1]Nobounded but not closed in R\mathbb{R} (misses irrational limit points)

The mathematician behind it

Origins · 1 minÉmile Borel and how this was discovered
ÉB
Émile Borel
1871–1956 · French analysis and probability, foundational work on measure theory

Émile Borel, working in Paris at the turn of the twentieth century, proved the covering property for closed intervals as a lemma in his 1895 thesis on complex function theory, in the course of studying convergence properties of series. Eduard Heine, a German analyst working several decades earlier, had used a closely related covering idea implicitly in his study of uniform continuity of continuous functions on closed intervals, though the modern topological formulation with open covers and finite subcovers came later, refined and generalized by Henri Lebesgue and others into the shape used today. The theorem's name honors both contributions even though neither stated it in the exact modern topological language.

History
- 1872: Eduard Heine publishes work on uniform continuity relying on covering-type arguments for continuous functions on closed intervals.
- 1895: Émile Borel proves a covering lemma for closed bounded intervals in his doctoral thesis, establishing what is now the one-dimensional case.
- 1900s: Henri Lebesgue extends and clarifies the covering property in the context of measure theory and integration.
- 1910s–1920s: The theorem is generalized to Rn\mathbb{R}^n and recast in the modern open-cover, finite-subcover topological language.
- Mid-20th century: The theorem becomes a standard cornerstone of general topology textbooks, stated for metric and topological spaces with the sharp finite-dimensional Euclidean characterization as a special case.
Does Heine–Borel hold for subsets of Q\mathbb{Q}, viewed as a metric space in its own right?

No. Consider K={q∈Q:q2≤2}=Q∩[−2,2]K = \{ q \in \mathbb{Q} : q^2 \le 2 \} = \mathbb{Q} \cap [-\sqrt2, \sqrt2]. As a subset of Q\mathbb{Q} with the usual metric, KK is closed in Q\mathbb{Q} (its complement in Q\mathbb{Q} is open) and bounded, yet KK is not compact: the sequence of rational truncations of 2\sqrt2 lies in KK but has no limit within Q\mathbb{Q}, so no convergent subsequence exists in KK, violating sequential compactness (equivalent to compactness in metric spaces). The theorem genuinely needs completeness of the ambient space, which Rn\mathbb{R}^n has and Qn\mathbb{Q}^n lacks; this is hidden inside the least-upper-bound step of the nested box lemma.

Is "closed and bounded" the same as "compact" for subsets of any complete metric space?

No, completeness alone is not sufficient; ℓ2\ell^2 is complete (a Banach space) yet its closed unit ball is not compact, as shown in the counterexample. What actually characterizes compactness in a complete metric space is being closed and totally bounded (for every ε>0\varepsilon>0, coverable by finitely many balls of radius ε\varepsilon), a strictly stronger condition than plain boundedness in infinite dimensions. In Rn\mathbb{R}^n, boundedness and total boundedness coincide, which is precisely why ordinary Heine–Borel works there but fails to generalize verbatim.

How does Heine–Borel relate to sequential compactness?

In any metric space, compactness (every open cover has a finite subcover) is equivalent to sequential compactness (every sequence has a convergent subsequence with limit in the set); this is a general theorem about metric spaces, not special to Rn\mathbb{R}^n. Heine–Borel then gives, specifically in Rn\mathbb{R}^n, the further reduction to a simple checkable pair of conditions. Historically and pedagogically, the Bolzano–Weierstrass theorem (every bounded sequence in Rn\mathbb{R}^n has a convergent subsequence) is the sequential shadow of Heine–Borel and is often proved by essentially the same bisection technique used here.

Why does the proof need both "bisect into halves" and "shrinking diameters," rather than some other decomposition?

The two ingredients serve different roles. Bisection into finitely many (2n2^n) sub-boxes is what lets us pass from "no finite subcover for a big box" to "no finite subcover for at least one small sub-box," using only finite additivity of unions of finite covers. Shrinking diameters (going to zero) is what forces the nested intersection to be a single point rather than a whole subset, via the Nested Box Lemma. If the boxes did not shrink to a point (e.g. if we only ever cut off a fixed corner without shrinking), the intersection could be an entire smaller box, and we could not conclude a single open set from the cover contains an entire tail QkQ_k.

Does the theorem give an explicit bound on how many sets are needed in the finite subcover?

No, the proof is non-constructive: it proves finiteness exists by contradiction, without producing an explicit finite list or bound on its size, and in general no uniform bound independent of the specific cover can be given. For particular well-structured covers (e.g. covering [a,b][a,b] by intervals of a fixed length δ\delta) one can compute an explicit finite subcover size, but the general theorem only guarantees existence.

Is the empty set compact, and is it closed and bounded, consistent with Heine–Borel?

Yes on all counts, vacuously. The empty set is bounded (contained in any ball, vacuously) and closed (its complement, all of Rn\mathbb{R}^n, is open). It is compact because any cover of ∅\emptyset has the empty subcollection as a finite subcover, since the union of no sets is ∅\emptyset, which contains ∅\emptyset. This trivial case is consistent with, and often used as the base case in, inductive arguments involving Heine–Borel.

Does Heine–Borel say every closed bounded set in Rn\mathbb{R}^n is connected, or does compactness imply connectedness?

No — compactness and connectedness are entirely independent properties. A finite set of two points is compact (closed and bounded) but totally disconnected. Conversely R\mathbb{R} itself is connected but not compact (unbounded). Heine–Borel says nothing about connectedness; it is purely about the closed-and-bounded characterization of compactness.

Before this

Where this leads