On this page
"Compact" is the word analysts use for sets that behave a little like finite ones, even when they hold infinitely many points. We work slowly through (0, 1), which is not compact, and [0, 1], which is.
What does compact mean in real analysis?
An open cover of a set S is a collection of open sets (in ℝ, think open intervals) whose union contains every point of S. A finite subcover is a finite selection from that collection that still covers S.
A set is compact if every open cover of it has a finite subcover, which is the formal definition in the compact space article on Wikipedia.
The hard word is "every". One big interval covers any bounded set, so one finite cover proves nothing: whatever cover someone hands you, you must be able to throw away all but finitely many of its sets.
Why is (0, 1) not compact?
Here is a cover built to defeat you. For n = 2, 3, 4 and so on, let U(n) be the open interval (1/n, 1).
It is a cover: for any x in (0, 1), choose n larger than 1/x, and x lies in U(n).
Pick any finitely many of these intervals and let N be the largest n picked. They are nested, so their union is just (1/N, 1).
The point 1/(2N) lies in (0, 1) but not in (1/N, 1). Something is always missed.
So (0, 1) is not compact. The Compact space article gives (0, 1) as its own example of a set that is not compact.
Now try [0, 1]. The U(n) miss 0 and 1, so add (−0.01, 0.01) and (0.99, 1.01) to the cover. Now three sets are enough: those two plus U(101) = (1/101, 1), since 1/101 is less than 0.01. That settles one cover only; the Heine–Borel theorem promises the same for every cover.
What does the Heine–Borel theorem say?
The Heine–Borel theorem says that a subset of ℝⁿ is compact if and only if it is closed and bounded (Heine–Borel theorem). The same page records that Émile Borel, in 1895, was the first to state and prove a form of it, for countable covers. Eduard Heine, who formulated uniform continuity according to his MacTutor biography, shares the name; our post on uniform continuity and the single δ shows compactness at work in the Heine–Cantor theorem.
In ℝ the theorem gives a two-question test: is the set bounded, and is it closed (does it contain every limit point of its points)? If both answers are yes, it is compact. Try it:
[0, 1]: closed and bounded, so compact.
(0, 1): not closed, since 0 and 1 are missing.
[0, ∞): closed but not bounded.
{1, 1/2, 1/3, …}: not closed, since it lacks the limit point 0. Add 0 and it becomes compact.
The rationals in [0, 1]: not closed, since √2/2 is a limit of rationals.
The Cantor set: closed and bounded, so compact, though, as our post on the Cantor set and measure zero explains, it has total length zero.
One warning: the same page notes that many other metric spaces, such as the rationals, lack this property, so outside ℝⁿ use the open-cover definition.
Why does a continuous function on a compact set reach a maximum?
The extreme value theorem says that if f is continuous on the closed, bounded interval [a, b], then f attains a maximum and a minimum, each at least once (Extreme value theorem). That page records that Bernard Bolzano proved it in the 1830s, in work unpublished until 1930. More generally, every continuous real-valued function on a nonempty compact space attains its maximum and minimum (Compact space).
The reason, for a nonempty compact set K:
Cover f(K) by open sets. Their preimages are open, because f is continuous, and they cover K.
Finitely many preimages cover K, so the matching finitely many sets cover f(K). So f(K) is compact.
By Heine–Borel, f(K) is a nonempty, closed and bounded set of real numbers, so its least upper bound exists and belongs to f(K). That value is the maximum; the minimum works the same way.
Drop compactness and it fails: on (0, 1], f(x) = 1 − x never reaches its least upper bound 1, and f(x) = 1/x is unbounded (both examples are on the same page).
How do you make compactness stick?
Write the (0, 1) proof from memory, then the [0, 1] version with a cover of your own. If limits feel shaky, our explainer on Cauchy sequences and the ε–N idea is a good warm-up, because "closed" is really a statement about limits.
To revisit open sets, limit points or suprema, the Fermi Concept Library gives each concept in mathematics its own lesson. For practice, the Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning rather than printing an answer.
![Nested open intervals covering (0, 1) versus three intervals covering [0, 1]](https://news.fermi.ai/media/images/2026/11/nested-open-intervals-covering-0-1-versus-three-intervals-co-1aa6da0e-1600x900.webp)


