Skip to main content
Home
Pimath

Menu EN

  • Home
  • ๐ŸŒ EN
    • ๐Ÿ‡ฎ๐Ÿ‡น IT
    • ๐Ÿ‡ช๐Ÿ‡ธ ES
    • ๐Ÿ‡ต๐Ÿ‡น PT
    • ๐Ÿ‡ซ๐Ÿ‡ท FR
    • ๐Ÿ‡ท๐Ÿ‡ด RO
  • ๐Ÿ‘จโ€๐ŸŽ“ About Me
  • ๐Ÿšง Theory & Exercises
User account menu
  • Log in

Breadcrumb

  1. Home

Heine-Borel Theorem: Statement, Proof, Meaning and Examples

Profile picture for user Pimath
By Pimath, 6 June, 2026

The Heine-Borel theorem is one of the cornerstone results of real analysis. It provides a complete characterization of the compact subsets of the real line, showing that in \(\mathbb R\) compactness coincides exactly with two properties that are far easier to recognize: being closed and being bounded.

In other words, a subset of \(\mathbb R\) is compact if and only if it is closed and bounded. This result turns the abstract definition of compactness in terms of open covers into something concrete, and it explains why intervals such as \([a,b]\) are compact, whereas sets such as \((a,b)\) or \([0,+\infty)\) are not.

In what follows we state the Heine-Borel theorem, clarify its meaning, prove both implications, and work through key examples and counterexamples.


Contents

  • Statement of the Heine-Borel theorem
  • The meaning of the theorem
  • Why boundedness is necessary
  • Why closedness is necessary
  • Proof: every compact subset of \(\mathbb R\) is closed and bounded
  • Proof: every closed and bounded subset of \(\mathbb R\) is compact
  • Examples of compact sets via Heine-Borel
  • Examples of non-compact sets via Heine-Borel
  • Heine-Borel and sequences
  • Summary

Statement of the Heine-Borel theorem

The Heine-Borel theorem completely characterizes the compact subsets of the real line.

Heine-Borel theorem. A set \(K\subseteq\mathbb R\) is compact if and only if it is closed and bounded.

In symbols:

\[ K \subseteq \mathbb R \text{ is compact} \quad \Longleftrightarrow \quad K \text{ is closed and bounded}. \]

The theorem comprises two distinct statements:

  • if \(K\subseteq\mathbb R\) is compact, then \(K\) is closed and bounded;
  • if \(K\subseteq\mathbb R\) is closed and bounded, then \(K\) is compact.

The first implication shows that compactness rules out both escape to infinity and the presence of missing limit points. The second implication shows, conversely, that on the real line these two conditions are enough to guarantee compactness.


The meaning of the theorem

The definition of a compact set is phrased in terms of open covers: a set \(K\subseteq\mathbb R\) is compact if every open cover of \(K\) admits a finite subcover.

This definition is very general, but it is not always straightforward to verify. The Heine-Borel theorem makes compactness far more concrete in the case of subsets of the real line.

Indeed, thanks to the theorem, to decide whether a set \(K\subseteq\mathbb R\) is compact we need not check all of its open covers directly. It is enough to verify two properties:

  • \(K\) is bounded, meaning its points cannot wander off without bound;
  • \(K\) is closed, meaning it contains all of its limit points.

For instance, the interval

\[ [0,1] \]

is closed and bounded, hence compact.

The interval

\[ (0,1) \]

is bounded but not closed, and therefore not compact.

The half-line

\[ [0,+\infty) \]

is closed but not bounded, and therefore not compact.

The Heine-Borel theorem thus shows that, in \(\mathbb R\), compactness means exactly this: no escape to infinity and no missing limit points.


Why boundedness is necessary

Let us first see why a compact set cannot be unbounded.

A set \(K\subseteq\mathbb R\) is said to be bounded if there exists \(M>0\) such that

\[ K\subseteq [-M,M]. \]

Equivalently, all points of \(K\) have absolute value bounded by a single constant:

\[ |x|\leq M \qquad \text{for every } x\in K. \]

If, on the other hand, \(K\) is not bounded, then its points can lie arbitrarily far from the origin. In this case one can construct an open cover of \(K\) that admits no finite subcover.

Indeed, consider the family of open sets

\[ U_n=(-n,n), \qquad n\in\mathbb N,\ n\geq 1. \]

The union of all these open sets is the entire real line:

\[ \bigcup_{n=1}^{+\infty}(-n,n)=\mathbb R. \]

Hence, in particular,

\[ K\subseteq \bigcup_{n=1}^{+\infty}(-n,n). \]

The family \(\{(-n,n)\}_{n\geq 1}\) is therefore an open cover of \(K\).

If we select only finitely many open sets from this cover, there is a largest index \(N\) among those chosen. Since the intervals \((-n,n)\) grow as \(n\) increases, the finite union of the selected open sets is contained in

\[ (-N,N). \]

But if \(K\) is unbounded, there exists at least one point \(x\in K\) such that

\[ |x|>N. \]

Such a point does not lie in \((-N,N)\). Consequently, no finite subfamily of these open sets can cover all of \(K\).

Hence an unbounded set cannot be compact.

Therefore, every compact subset of \(\mathbb R\) must be bounded.


Why closedness is necessary

Let us now see why a compact subset of \(\mathbb R\) must be closed.

A set \(K\subseteq\mathbb R\) is closed if it contains all of its limit points. In other words, whenever a sequence of points of \(K\) converges to a real number \(x\), the limit \(x\) must itself belong to \(K\).

If a set is not closed, it can happen that some of its points cluster arbitrarily close to a point lying outside the set. This phenomenon is incompatible with compactness.

For example, the interval

\[ (0,1) \]

is not closed, because \(0\) and \(1\) are limit points of the interval that do not themselves belong to it.

Consider the sequence

\[ x_n=\frac{1}{n}. \]

For every \(n\geq 2\) we have

\[ x_n\in(0,1), \]

yet

\[ x_n\to 0. \]

The limit \(0\) does not belong to \((0,1)\). Thus the sequence \(\left(\displaystyle \frac{1}{n}\right)\), although contained in the open interval \((0,1)\), converges to a point outside the set.

This shows why closedness is necessary: a compact set cannot lose the limits of the sequences that live inside it.

More precisely, if \(K\) is compact, then every sequence of points of \(K\) has a subsequence converging to a point of \(K\). If \(K\) had a limit point lying outside it, one could build a sequence of points of \(K\) converging to that external point, contradicting compactness.

Therefore, every compact subset of \(\mathbb R\) must be closed.


Proof: every compact subset of \(\mathbb R\) is closed and bounded

We now prove the first implication of the Heine-Borel theorem:

\[ K \text{ compact} \quad \Longrightarrow \quad K \text{ closed and bounded}. \]

The proof splits naturally into two parts:

  • first we show that \(K\) is bounded;
  • then we show that \(K\) is closed.

A compact subset of \(\mathbb R\) is bounded

Suppose \(K\subseteq\mathbb R\) is compact.

Consider the family of open sets

\[ U_n=(-n,n), \qquad n\in\mathbb N,\ n\geq 1. \]

Since

\[ \bigcup_{n=1}^{+\infty}(-n,n)=\mathbb R, \]

we certainly have

\[ K\subseteq \bigcup_{n=1}^{+\infty}(-n,n). \]

Hence \(\{U_n\}_{n\geq 1}\) is an open cover of \(K\).

Since \(K\) is compact, we can extract a finite subcover from this open cover. There therefore exist indices

\[ n_1,n_2,\ldots,n_m \]

such that

\[ K\subseteq (-n_1,n_1)\cup(-n_2,n_2)\cup\cdots\cup(-n_m,n_m). \]

Let

\[ N=\max\{n_1,n_2,\ldots,n_m\}. \]

Since the intervals \((-n,n)\) grow as \(n\) increases, we have

\[ (-n_j,n_j)\subseteq (-N,N) \qquad \text{for every } j=1,\ldots,m. \]

Therefore

\[ K\subseteq (-N,N). \]

Hence every point \(x\in K\) satisfies

\[ |x|<N. \]

We have thus found a constant \(N>0\) that bounds all points of \(K\). Hence \(K\) is bounded.

A compact subset of \(\mathbb R\) is closed

We now show that \(K\) is closed.

We use the sequential characterization of closed sets: a set \(K\subseteq\mathbb R\) is closed if and only if, for every sequence \((x_n)\subseteq K\) converging to a real number \(x\), one necessarily has \(x\in K\).

Let \((x_n)\), then, be a sequence of points of \(K\) such that

\[ x_n\to x \qquad \text{with } x\in\mathbb R. \]

Since \(K\) is compact, by the sequential characterization of compactness in \(\mathbb R\), every sequence of points of \(K\) has a subsequence converging to a point of \(K\). There therefore exists a subsequence \((x_{n_k})\) such that

\[ x_{n_k}\to y \qquad \text{with } y\in K. \]

But \((x_{n_k})\) is a subsequence of \((x_n)\), and every subsequence of a convergent sequence converges to the same limit. Since \(x_n\to x\), it follows that

\[ x_{n_k}\to x. \]

We therefore have

\[ x_{n_k}\to x \qquad \text{and} \qquad x_{n_k}\to y. \]

By uniqueness of the limit in \(\mathbb R\), we obtain

\[ x=y. \]

Since \(y\in K\), it follows that \(x\in K\) as well.

We have shown that every sequence of points of \(K\) that converges in \(\mathbb R\) has its limit in \(K\). Hence \(K\) is closed.

We have thus proved that every compact subset of \(\mathbb R\) is both closed and bounded.


Proof: every closed and bounded subset of \(\mathbb R\) is compact

We now prove the second implication of the Heine-Borel theorem:

\[ K \text{ closed and bounded} \quad \Longrightarrow \quad K \text{ compact}. \]

This is the deeper part of the theorem. It is not enough to know intuitively that a closed and bounded set is well behaved: we must prove that every open cover of it admits a finite subcover.

We proceed in two steps:

  • first we prove that every closed and bounded interval \([a,b]\) is compact;
  • then we use this result to prove that every closed and bounded subset of \(\mathbb R\) is compact.

Step 1: every interval \([a,b]\) is compact

Let \(a,b\in\mathbb R\), with \(a\leq b\). We want to prove that the interval

\[ [a,b] \]

is compact.

Consider an arbitrary open cover of \([a,b]\):

\[ [a,b]\subseteq \bigcup_{i\in I} U_i, \]

where each \(U_i\) is an open subset of \(\mathbb R\).

We must show that there exist \(i_1,\ldots,i_m\in I\) such that

\[ [a,b]\subseteq U_{i_1}\cup\cdots\cup U_{i_m}. \]

We argue by contradiction. Suppose there is an open cover of \([a,b]\) from which no finite subcover can be extracted.

Divide the interval \([a,b]\) into two halves:

\[ \left[a,\frac{a+b}{2}\right], \qquad \left[\frac{a+b}{2},b\right]. \]

If both of these halves admitted a finite subcover, then their unionโ€”namely all of \([a,b]\)โ€”would admit a finite subcover too. This would contradict our assumption.

Hence at least one of the two halves admits no finite subcover. Call it \(I_1\).

Now divide \(I_1\) into two halves. Again, at least one of the two halves cannot admit a finite subcover; otherwise \(I_1\) would be covered by finitely many open sets. Denote this half by \(I_2\).

Continuing in this way, we build a nested sequence of closed and bounded intervals

\[ I_1\supseteq I_2\supseteq I_3\supseteq \cdots \]

such that:

  • each \(I_n\) is a closed subinterval of \([a,b]\);
  • no \(I_n\) admits a finite subcover by the open sets of the original cover;
  • the length of \(I_n\) tends to \(0\).

More precisely, if \(I_n=[a_n,b_n]\), then

\[ b_n-a_n=\frac{b-a}{2^n}. \]

By the nested interval theorem, there exists at least one point

\[ x\in \bigcap_{n=1}^{+\infty} I_n. \]

Since \(x\in[a,b]\) and the family \(\{U_i\}_{i\in I}\) covers \([a,b]\), there exists an index \(i_0\in I\) such that

\[ x\in U_{i_0}. \]

Since \(U_{i_0}\) is open, there exists \(r>0\) such that

\[ (x-r,x+r)\subseteq U_{i_0}. \]

Since the length of the intervals \(I_n\) tends to \(0\), we can choose \(N\in\mathbb N\) such that

\[ b_N-a_N<r. \]

Moreover \(x\in I_N\). Hence, for every \(y\in I_N\), we have

\[ |y-x|\leq b_N-a_N<r. \]

Therefore

\[ I_N\subseteq (x-r,x+r)\subseteq U_{i_0}. \]

But then \(I_N\) is covered by a single open set of the original cover, namely \(U_{i_0}\). In particular, \(I_N\) admits a finite subcover.

This contradicts the construction of the intervals \(I_n\), according to which no \(I_n\) was supposed to admit a finite subcover.

The contradiction arises from having assumed that \([a,b]\) was not compact. Hence every closed and bounded interval \([a,b]\) is compact.

Step 2: every closed and bounded \(K\subseteq\mathbb R\) is compact

Now let \(K\subseteq\mathbb R\) be a closed and bounded set.

Since \(K\) is bounded, there exists \(M>0\) such that

\[ K\subseteq [-M,M]. \]

We have just shown that the interval \([-M,M]\) is compact.

Now consider an arbitrary open cover of \(K\):

\[ K\subseteq \bigcup_{i\in I} U_i. \]

We want to prove that a finite subcover can be extracted from this cover.

Since \(K\) is closed, its complement

\[ \mathbb R\setminus K \]

is open.

We add this open set to the family \(\{U_i\}_{i\in I}\). We thereby obtain the family

\[ \{U_i\}_{i\in I}\cup\{\mathbb R\setminus K\}. \]

This new family is an open cover of the whole interval \([-M,M]\).

Indeed, if \(x\in[-M,M]\), two cases can occur:

  • if \(x\in K\), then \(x\) belongs to at least one of the open sets \(U_i\), because \(\{U_i\}_{i\in I}\) covers \(K\);
  • if \(x\notin K\), then \(x\in\mathbb R\setminus K\).

Hence

\[ [-M,M]\subseteq \left(\bigcup_{i\in I} U_i\right)\cup(\mathbb R\setminus K). \]

Since \([-M,M]\) is compact, we can extract a finite subcover from this open cover of \([-M,M]\).

There therefore exist finitely many open sets of the original cover, which we denote by

\[ U_{i_1},\ldots,U_{i_m}, \]

and possibly also the open set \(\mathbb R\setminus K\), such that

\[ [-M,M]\subseteq U_{i_1}\cup\cdots\cup U_{i_m}\cup(\mathbb R\setminus K). \]

Now we restrict attention to the points of \(K\). Since no point of \(K\) lies in \(\mathbb R\setminus K\), the set \(\mathbb R\setminus K\) contributes nothing to covering \(K\).

Therefore the open sets

\[ U_{i_1},\ldots,U_{i_m} \]

alone suffice to cover \(K\):

\[ K\subseteq U_{i_1}\cup\cdots\cup U_{i_m}. \]

We have thus extracted a finite subcover from the original open cover of \(K\).

Since the original open cover was arbitrary, \(K\) is compact.

We have thus proved that every closed and bounded subset of \(\mathbb R\) is compact.


Examples of compact sets via Heine-Borel

The Heine-Borel theorem lets us quickly recognize many compact subsets of \(\mathbb R\) without having to verify the open-cover definition directly.

In \(\mathbb R\), indeed, it is enough to check two properties:

  • the set must be closed;
  • the set must be bounded.

Closed and bounded intervals

Every interval of the form

\[ [a,b], \qquad a,b\in\mathbb R,\ a\leq b, \]

is compact.

Indeed, \([a,b]\) is closed, since it contains its own endpoints, and bounded, since every point \(x\) in it satisfies

\[ a\leq x\leq b. \]

Hence, by the Heine-Borel theorem, \([a,b]\) is compact.

Finite sets

Every finite set of real numbers is compact.

For example, consider

\[ A=\{-2,0,3,7\}. \]

The set \(A\) is closed, since all of its points are isolated and it has no limit points outside the set. It is also bounded, since all of its elements belong, for instance, to the interval \([-2,7]\).

Hence, by the Heine-Borel theorem, \(A\) is compact.

An infinite set containing its limit point

Consider the set

\[ K=\{0\}\cup\left\{\frac{1}{n}:n\in\mathbb N,\ n\geq 1\right\}. \]

This set is bounded, since

\[ K\subseteq [0,1]. \]

It is also closed: the only limit point of the sequence \(\displaystyle \frac{1}{n}\) is \(0\), and \(0\) belongs to \(K\).

Hence \(K\) is closed and bounded. By the Heine-Borel theorem, \(K\) is compact.

A finite union of closed and bounded intervals

Sets such as

\[ A=[-2,-1]\cup[0,3]\cup[5,6] \]

are compact as well.

Indeed, \(A\) is bounded, since it is contained in the interval \([-2,6]\). It is also closed, being a finite union of closed sets.

Hence, by the Heine-Borel theorem, \(A\) is compact.


Examples of non-compact sets via Heine-Borel

The Heine-Borel theorem also lets us quickly recognize when a set of real numbers fails to be compact.

In \(\mathbb R\), a set is not compact if it lacks at least one of the two properties required by the theorem: closedness or boundedness.

Bounded open intervals

The interval

\[ (0,1) \]

is not compact.

Indeed, it is bounded but not closed. The points \(0\) and \(1\) are limit points of \((0,1)\) that do not belong to the interval.

Since \((0,1)\) is not closed, by the Heine-Borel theorem it is not compact.

Half-open intervals

The interval

\[ [0,1) \]

is not compact either.

It is bounded but not closed, because \(1\) is a limit point of the set and \(1\notin[0,1)\).

Hence \([0,1)\) is not compact.

Closed but unbounded sets

The half-line

\[ [0,+\infty) \]

is not compact.

Indeed, it is closed but not bounded: its points can run off indefinitely toward \(+\infty\).

By the Heine-Borel theorem, a subset of \(\mathbb R\) is compact if and only if it is closed and bounded. Since \([0,+\infty)\) is not bounded, it is not compact.

A bounded but non-closed set

Consider the set

\[ A=\left\{\frac{1}{n}:n\in\mathbb N,\ n\geq 1\right\}. \]

The set \(A\) is bounded, since

\[ A\subseteq (0,1]. \]

However, it is not closed, because the sequence

\[ \frac{1}{n} \]

converges to \(0\), yet \(0\notin A\).

Hence \(A\) is not closed. By the Heine-Borel theorem, \(A\) is not compact.


Heine-Borel and sequences

The Heine-Borel theorem is closely tied to the sequential characterization of compactness.

In \(\mathbb R\), saying that a set \(K\) is compact is equivalent to saying that every sequence of points of \(K\) has a subsequence converging to a point of \(K\).

The Heine-Borel theorem explains why this property is equivalent to being closed and bounded.

The role of boundedness

Boundedness prevents sequences from escaping to infinity.

For example, in the set

\[ [0,+\infty) \]

the sequence

\[ x_n=n \]

lies entirely within the set, yet it has no subsequence convergent in \(\mathbb R\). Every subsequence of it tends to \(+\infty\).

This shows why boundedness is necessary for compactness.

The role of closedness

Closedness prevents sequences from converging to points outside the set.

For example, in the interval

\[ (0,1) \]

the sequence

\[ x_n=\frac{1}{n} \]

lies in \((0,1)\) for every \(n\geq 2\), but converges to \(0\), which does not belong to the interval.

This shows why closedness is necessary for compactness.

Closedness and boundedness together

If a set \(K\subseteq\mathbb R\) is bounded, then every sequence of points of \(K\) is bounded. By the Bolzano-Weierstrass theorem, it has a subsequence convergent in \(\mathbb R\).

If, moreover, \(K\) is closed, the limit of that subsequence still belongs to \(K\).

Hence every sequence of points of \(K\) has a subsequence converging to a point of \(K\).

This is the sequential content of compactness, and it represents another form of the Heine-Borel theorem on the real line.


Summary

The Heine-Borel theorem states that a subset \(K\subseteq\mathbb R\) is compact if and only if it is closed and bounded.

In symbols:

\[ K\subseteq\mathbb R \text{ is compact} \quad \Longleftrightarrow \quad K \text{ is closed and bounded}. \]

Compactness is defined via open covers: every open cover of \(K\) must admit a finite subcover.

The Heine-Borel theorem makes this definition concrete in the case of the real line. Instead of checking all open covers directly, it is enough to verify two properties:

  • \(K\) is closed, hence it contains all of its limit points;
  • \(K\) is bounded, hence its points cannot escape to infinity.

Boundedness rules out escape to infinity, while closedness rules out missing limit points.

For this reason, in \(\mathbb R\) the compact sets are exactly the closed and bounded sets.

The Heine-Borel theorem is thus the result that definitively links the abstract definition of compactness, based on open covers, with a simple and concrete characterization on the real line: being closed and bounded.

This characterization underlies many later results in analysis, among them the Weierstrass theorem, the sequential characterization of compactness, and the study of continuous functions defined on compact sets.


Your feedback is important to us! Leave a comment and help us improve this content. Thank you!

Feedback

Support us by liking the page:
Or, share:

Tags

  • Mathematical Analysis 1

Support us by liking the page:
Or, share:

Copyright ยฉ 2026 | Pimath | All Rights Reserved