# Heine–Borel theorem

In real analysis the Heine–Borel theorem, named after Eduard Heine and Émile Borel, states:
For a subset S of Euclidean space R$^n$, the following two statements are equivalent:
* S is compact, that is, every open cover of S has a finite subcover
* S is closed and bounded.

## History and motivation

The history of what today is called the Heine–Borel theorem starts in the 19th century, with the search for solid foundations of real analysis. Central to the theory was the concept of uniform continuity and the theorem stating that every continuous function on a closed and bounded interval is uniformly continuous. Peter Gustav Lejeune Dirichlet was the first to prove this and implicitly he used the existence of a finite subcover of a given open cover of a closed interval in his proof. He used this proof in his 1852 lectures, which were published only in 1904. Later Eduard Heine, Karl Weierstrass and Salvatore Pincherle used similar techniques. Émile Borel in 1895 was the first to state and prove a form of what is now called the Heine–Borel theorem. His formulation was restricted to countable covers. Pierre Cousin (1895), Lebesgue (1898) and Schoenflies (1900) generalized it to arbitrary covers.

## Proof

If a set is compact, then it must be closed.
Let S be a subset of R$^n$. Observe first the following: if a is a limit point of S, then any finite collection C of open sets, such that each open set U ∈ C is disjoint from some neighborhood V$_U$ of a, fails to be a cover of S. Indeed, the intersection of the finite family of sets V$_U$ is a neighborhood W of a in R$^n$. Since a is a limit point of S, W must contain a point x in S. This x ∈ S is not covered by the family C, because every U in C is disjoint from V$_U$ and hence disjoint from W, which contains x.
If S is compact but not closed, then it has a limit point a not in S. Consider a collection C′ consisting of an open neighborhood N(x) for each x ∈ S, chosen small enough to not intersect some neighborhood V$_x$ of a. Then C′ is an open cover of S, but any finite subcollection of C′ has the form of C discussed previously, and thus cannot be an open subcover of S. This contradicts the compactness of S. Hence, every limit point of S is in S, so S is closed.
The proof above applies with almost no change to showing that any compact subset S of a Hausdorff topological space X is closed in X.
If a set is compact, then it is bounded.
Let $S$ be a compact set in $\mathbf {R} ^{n}$, and $U_{x}$ a ball of radius 1 centered at $x\in \mathbf {R} ^{n}$. Then the set of all such balls centered at $x\in S$ is clearly an open cover of $S$, since $\cup _{x\in S}U_{x}$ contains all of $S$. Since $S$ is compact, take a finite subcover of this cover. This subcover is the finite union of balls of radius 1. Consider all pairs of centers of these (finitely many) balls (of radius 1) and let $M$ be the maximum of the distances between them. Then if $C_{p}$ and $C_{q}$ are the centers (respectively) of unit balls containing arbitrary $p,q\in S$, the triangle inequality says:
$d(p,q)\leq d(p,C_{p})+d(C_{p},C_{q})+d(C_{q},q)\leq 1+M+1=M+2.$
So the diameter of $S$ is bounded by $M+2$.
Lemma: A closed subset of a compact set is compact.
Let K be a closed subset of a compact set T in R$^n$ and let C$_K$ be an open cover of K. Then U = R$^n$ \ K is an open set and
$C_{T}=C_{K}\cup \{U\}$
is an open cover of T. Since T is compact, then C$_T$ has a finite subcover $C_{T}',$ that also covers the smaller set K. Since U does not contain any point of K, the set K is already covered by $C_{K}'=C_{T}'\setminus \{U\},$ that is a finite subcollection of the original collection C$_K$. It is thus possible to extract from any open cover C$_K$ of K a finite subcover.
If a set is closed and bounded, then it is compact.
If a set S in R$^n$ is bounded, then it can be enclosed within an n-box
$T_{0}=[-a,a]^{n}$
where a > 0. By the lemma above, it is enough to show that T$_0$ is compact.
Assume, by way of contradiction, that T$_0$ is not compact. Then there exists an infinite open cover C of T$_0$ that does not admit any finite subcover. Through bisection of each of the sides of T$_0$, the box T$_0$ can be broken up into 2$^n$ sub n-boxes, each of which has diameter equal to half the diameter of T$_0$. Then at least one of the 2$^n$ sections of T$_0$ must require an infinite subcover of C, otherwise C itself would have a finite subcover, by uniting together the finite covers of the sections. Call this section T$_1$.
Likewise, the sides of T$_1$ can be bisected, yielding 2$^n$ sections of T$_1$, at least one of which must require an infinite subcover of C. Continuing in like manner yields a decreasing sequence of nested n-boxes:
$T_{0}\supset T_{1}\supset T_{2}\supset \ldots \supset T_{k}\supset \ldots$
where the side length of T$_k$ is (2 a) / 2$^k$, which tends to 0 as k tends to infinity. Let us define a sequence (x$_k$) such that each x$_k$ is in T$_k$. This sequence is Cauchy, so it must converge to some limit L. Since each T$_k$ is closed, and for each k the sequence (x$_k$) is eventually always inside T$_k$, we see that L ∈ T$_k$ for each k.
Since C covers T$_0$, then it has some member U ∈ C such that L ∈ U. Since U is open, there is an n-ball B(L) ⊆ U. For large enough k, one has T$_k$ ⊆ B(L) ⊆ U, but then the infinite number of members of C needed to cover T$_k$ can be replaced by just one: U, a contradiction.
Thus, T$_0$ is compact. Since S is closed and a subset of the compact set T$_0$, then S is also compact (see the lemma above).

## Generalization of the Heine-Borel theorem

In general metric spaces, we have the following theorem:
For a subset $S$ of a metric space $(X,d)$, the following two statements are equivalent:
* $S$ is compact,
* $S$ is precompact and complete.
The above follows directly from Jean Dieudonné, theorem 3.16.1, which states:
For a metric space $(X,d)$, the following three conditions are equivalent:
* (a) $X$ is compact;
* (b) any infinite sequence in $X$ has at least a cluster value;
* (c) $X$ is precompact and complete.

## Heine–Borel property

The Heine–Borel theorem does not hold as stated for general metric and topological vector spaces, and this gives rise to the necessity to consider special classes of spaces where this proposition is true. These spaces are said to have the Heine–Borel property.

### In the theory of metric spaces

A metric space $(X,d)$ is said to have the Heine–Borel property if each closed bounded set in $X$ is compact.
Many metric spaces fail to have the Heine–Borel property, such as the metric space of rational numbers (or indeed any incomplete metric space). Complete metric spaces may also fail to have the property; for instance, no infinite-dimensional Banach spaces have the Heine–Borel property (as metric spaces). Even more trivially, if the real line is not endowed with the usual metric, it may fail to have the Heine–Borel property.
A metric space $(X,d)$ has a Heine–Borel metric which is Cauchy locally identical to $d$ if and only if it is complete, $\sigma$-compact, and locally compact.

### In the theory of topological vector spaces

A topological vector space $X$ is said to have the Heine–Borel property (R.E. Edwards uses the term boundedly compact space) if each closed bounded set in $X$ is compact. No infinite-dimensional Banach spaces have the Heine–Borel property (as topological vector spaces). But some infinite-dimensional Fréchet spaces do have, for instance, the space $C^{\infty }(\Omega )$ of smooth functions on an open set $\Omega \subset \mathbb {R} ^{n}$ and the space $H(\Omega )$ of holomorphic functions on an open set $\Omega \subset \mathbb {C} ^{n}$. More generally, any quasi-complete nuclear space has the Heine–Borel property. All Montel spaces have the Heine–Borel property as well.