Real Analysis • Woody Calculus Cornerstone Lesson
Last updated: August 11, 2026
Compactness is one of the central organizing ideas of Real Analysis. It begins with an abstract statement about open covers, but its purpose is intensely practical: compactness lets us replace infinitely many local pieces of information by finitely many pieces, so we can take a minimum, take a maximum, choose one global bound, and prove a conclusion that works everywhere on the set.
A compact set is a set for which every open cover contains a finite subcover. In finite-dimensional Euclidean space, compact sets are exactly the closed and bounded sets. In metric spaces, compactness is equivalent to the statement that every sequence in the set has a subsequence converging to a point of the set.
Intuition: compactness is a finite-extraction principle. It turns local control into global control.
Why Was Compactness Invented?
Many arguments in analysis begin locally. At each point \(x\), continuity may provide a radius \(\delta_x\). At each point, a function may have a local bound. At each point, some neighborhood may satisfy the property we need. The problem is that there may be infinitely many points and infinitely many different local choices.
Once only finitely many radii, bounds, or neighborhoods remain, we can take their minimum or maximum. That is the hidden engine behind the Extreme Value Theorem, the Heine–Cantor Theorem, and the fact that continuous images of compact sets remain compact.
Throughout the main lesson, we work primarily in \(\mathbb R\), because number-line examples make the geometry visible. The corresponding Heine–Borel and Bolzano–Weierstrass statements extend to \(\mathbb R^n\).
What Is an Open Cover?
Standalone theorem-ready statement: An open cover of a set \(K\) is a collection of open sets whose union contains every point of \(K\).
Let \(K\subseteq X\), where \(X\) is a topological space. A family \(\{U_\alpha\}_{\alpha\in A}\) is an open cover of \(K\) when every \(U_\alpha\) is open in \(X\) and
K\subseteq\bigcup_{\alpha\in A}U_\alpha.
\]
Equivalently, every point of \(K\) lies in at least one member of the family.
(-0.2,0.4),\qquad (0.2,0.8),\qquad (0.6,1.2)
\]
The first two intervals overlap, and the second and third intervals overlap. Their union is \((-0.2,1.2)\), which contains every point of \([0,1]\). Therefore they form an open cover of \([0,1]\).
What Is a Finite Subcover?
Standalone definition: A finite subcover is a finite selection of sets from the original cover that still covers the entire set.
A set \(K\) is compact if every open cover \(\{U_\alpha\}_{\alpha\in A}\) of \(K\) contains finitely many members \(U_{\alpha_1},\ldots,U_{\alpha_n}\) such that
K\subseteq U_{\alpha_1}\cup U_{\alpha_2}\cup\cdots\cup U_{\alpha_n}.
\]
Stop and Drill: Lock the Definitions Into Memory
Before using Heine–Borel as a shortcut, build the structural foundation.
Why Is \([0,1]\) Compact? A Proof Sketch From the Definition
Heine–Borel tells us immediately that \([0,1]\) is compact because it is closed and bounded. But a cornerstone lesson should also show how the finite-subcover mechanism works directly.
Let \(\mathcal U\) be any open cover of \([0,1]\). Define
S=\left\{x\in[0,1]:[0,x]\text{ can be covered by finitely many members of }\mathcal U\right\}.
\]
Conclusion: every open cover of \([0,1]\) has a finite subcover, so \([0,1]\) is compact.
This argument exposes the role of completeness of the real numbers: the supremum \(c\) exists. It also shows why openness matters: an open set containing \(c\) contains a whole interval around \(c\), allowing the finite cover to move beyond the supposed stopping point.
The Heine–Borel Theorem: Closed and Bounded in \(\mathbb R^n\)
Standalone theorem statement: A subset of \(\mathbb R^n\) is compact if and only if it is closed and bounded.
K\subseteq\mathbb R^n:
\qquad
K\text{ is compact}
\iff
K\text{ is closed and bounded}.
\]
Why boundedness matters
Boundedness prevents points and sequence terms from escaping to infinity. A set \(K\subseteq\mathbb R\) is bounded if there exists \(M\gt 0\) such that \(|x|\le M\) for every \(x\in K\).
Why closedness matters
Closedness prevents convergent sequences from escaping through a missing limit point. If \(x_n\in K\), \(x_n\to L\), and \(K\) is closed, then \(L\in K\).
Why “closed and bounded” is not the definition
Consider \(\mathbb R\) equipped with the discrete metric
d(x,y)=
\begin{cases}
0,&x=y,\\
1,&x\ne y.
\end{cases}
\]
Every subset is open and closed, and every subset is bounded because all distances are at most \(1\). Nevertheless, an infinite set is not compact: the cover by singleton open sets has no finite subcover. Thus closed and bounded does not imply compact in an arbitrary metric space.
Open Covers vs. Sequences vs. Heine–Borel
The same compactness phenomenon appears in different forms. The correct tool depends on the ambient space and the kind of proof requested.
| Viewpoint | Exact statement | Where it applies | Best use |
|---|---|---|---|
| Open-cover definition | Every open cover has a finite subcover. | All topological spaces | Definition-level proofs and abstract topology |
| Sequential compactness | Every sequence has a subsequence converging to a point of the set. | Equivalent to compactness in metric spaces | Sequence proofs and noncompactness counterexamples |
| Heine–Borel | Compact if and only if closed and bounded. | Subsets of \(\mathbb R^n\) | Fastest classification method in undergraduate analysis |
| Complete plus totally bounded | A metric space is compact if and only if it is complete and totally bounded. | Metric spaces | Advanced metric-space arguments |
Compact and Noncompact Sets: Essential Examples
| Set with its usual metric | Closed? | Bounded? | Complete? | Compact? | Reason |
|---|---|---|---|---|---|
| \([0,1]\) | Yes | Yes | Yes | Yes | Heine–Borel |
| \((0,1)\) | No | Yes | No | No | Missing endpoint limits |
| \([0,\infty)\) | Yes | No | Yes | No | Unbounded |
| \(\mathbb Z\subseteq\mathbb R\) | Yes | No | Yes | No | Unbounded |
| \(\mathbb Q\cap[0,1]\subseteq\mathbb R\) | No | Yes | No | No | Irrational limit points are missing |
| Cantor set \(C\) | Yes | Yes | Yes | Yes | Closed subset of \([0,1]\) |
| Closed unit disk in \(\mathbb R^2\) | Yes | Yes | Yes | Yes | Heine–Borel in \(\mathbb R^2\) |
| \(\mathbb R\) | Yes | No | Yes | No | Unbounded |
The reciprocal sequence set
The set
K=\left\{\frac1n:n\in\mathbb N\right\}\cup\{0\}
\]
is compact. It is bounded, and including \(0\) captures the only accumulation point. Removing \(0\) would make the set nonclosed and therefore noncompact in \(\mathbb R\).
The Cantor set: compact does not mean interval-like
The Cantor set is closed and bounded, so it is compact. Yet it is uncountable, nowhere dense, totally disconnected, and has Lebesgue measure zero. It is one of the best examples showing that compact sets can be geometrically strange while remaining analytically well controlled. See The Cantor Set Explained for a complete visual lesson.
Why Is \((0,1)\) Not Compact?
Fast answer: \((0,1)\) is bounded but not closed, so it is not compact by Heine–Borel.
Definition-level answer: the following open cover has no finite subcover:
U_n=\left(\frac1n,1\right),
\qquad n=2,3,4,\ldots
\]
These sets cover \((0,1)\), because for any \(x\in(0,1)\), choosing \(n\gt 1/x\) gives \(1/n\lt x\), so \(x\in U_n\).
U_{n_1}\cup\cdots\cup U_{n_m}=U_N=\left(\frac1N,1\right).
\]
0\lt x\le\frac1N
\]
is uncovered.
Sequential Compactness: The Sequence Characterization
Standalone metric-space theorem: A metric space is compact if and only if every sequence has a subsequence converging to a point in the space.
K\text{ compact}
\iff
\text{every sequence in }K\text{ has a subsequence converging to a point of }K.
\]
This equivalence is a theorem for metric spaces. It is not a universal replacement for the open-cover definition in arbitrary topological spaces.
How to use sequences to prove noncompactness
In metric spaces, one of the fastest ways to prove that \(K\) is not compact is to construct a sequence in \(K\) for which no subsequence converges to a point of \(K\).
For \((0,1)\), take
x_n=\frac1{n+1}\in(0,1),
\qquad
x_n\to0\notin(0,1).
\]
Every subsequence also converges to \(0\), so no subsequence converges to a point of \((0,1)\).
The Bolzano–Weierstrass Theorem
Standalone theorem statement: Every bounded sequence in \(\mathbb R^n\) has a convergent subsequence.
(x_n)\text{ bounded in }\mathbb R^n
\Longrightarrow
\exists\,(x_{n_k})\text{ such that }x_{n_k}\to L\in\mathbb R^n.
\]
How Bolzano–Weierstrass and closedness combine
Compact vs. Closed and Bounded: What Is the Difference?
A closed set contains all of its limit points. A compact set satisfies the much stronger finite-subcover condition.
In a Hausdorff space, every compact set is closed. The converse is false: \(\mathbb R\), \([0,\infty)\), and \(\mathbb Z\) are closed subsets of \(\mathbb R\), but none is compact because each is unbounded.
Is every compact set closed?
Yes in Hausdorff spaces, including every metric space. Without a Hausdorff hypothesis, compact subsets need not be closed.
Is every closed set compact?
No. Closedness controls missing limit points; it does not prevent escape to infinity.
Is \(\mathbb R\) compact?
No. It is closed but unbounded. Directly, the open cover \(\{(-n,n):n\in\mathbb N\}\) has no finite subcover of \(\mathbb R\).
Compact vs. Complete: What Is the Difference?
Completeness controls Cauchy sequences; compactness controls all sequences through convergent subsequences.
A metric space is complete if every Cauchy sequence converges to a point of the space. Every compact metric space is complete, but a complete metric space need not be compact.
Every Cauchy sequence in \(\mathbb R\) converges in \(\mathbb R\), so \(\mathbb R\) is complete. But the sequence \(x_n=n\) has no convergent subsequence, and \(\mathbb R\) is unbounded, so it is not compact.
For metric spaces, the exact replacement for Heine–Borel is:
\text{compact}
\iff
\text{complete and totally bounded}.
\]
Why Is Compactness Important?
Compactness is important because it upgrades local hypotheses into global conclusions. Let \(K\) be a nonempty compact set and let \(f:K\to\mathbb R\) be continuous.
Continuous images of compact sets are compact
Standalone theorem statement: If \(K\) is compact and \(f:K\to Y\) is continuous, then \(f(K)\) is compact.
Let \(\{V_\alpha\}\) be an open cover of \(f(K)\). The inverse images \(f^{-1}(V_\alpha)\) are open in \(K\) and cover \(K\). Compactness gives finitely many inverse images covering \(K\). The corresponding finitely many sets \(V_\alpha\) cover \(f(K)\). Therefore \(f(K)\) is compact.
Extreme Value Theorem
Standalone theorem statement: A continuous real-valued function on a nonempty compact set attains both its maximum and its minimum.
\exists\,x_{\min},x_{\max}\in K
\quad\text{such that}\quad
\forall x\in K,
\qquad
f(x_{\min})\le f(x)\le f(x_{\max}).
\]
Let \(f:[0,1]\to\mathbb R\) be continuous. Since \([0,1]\) is compact, \(f([0,1])\) is compact in \(\mathbb R\). Therefore \(f([0,1])\) is bounded and closed. Its supremum and infimum belong to the image, so \(f\) actually attains a maximum and minimum.
Heine–Cantor Theorem
Standalone theorem statement: Every continuous function from a compact metric space into a metric space is uniformly continuous.
f\text{ continuous on compact }K
\Longrightarrow
f\text{ uniformly continuous on }K.
\]
How Compactness Proves Uniform Continuity
This proof is the clearest answer to the question “Why does the definition use finite subcovers?” The finite subcover lets us take one minimum radius that works everywhere.
Let \(f:K\to\mathbb R\) be continuous, where \(K\) is compact. Fix \(\varepsilon\gt 0\).
d(x,y)\lt\delta_x
\Longrightarrow
|f(y)-f(x)|\lt\frac{\varepsilon}{2}.
\]
K\subseteq\bigcup_{i=1}^{m}B\!\left(x_i,\frac{\delta_{x_i}}2\right).
\]
\delta=\min_{1\le i\le m}\frac{\delta_{x_i}}2\gt 0.
\]
The minimum is positive because only finitely many positive numbers remain.
|f(p)-f(q)|
\le |f(p)-f(x_i)|+|f(x_i)-f(q)|
\lt\frac\varepsilon2+\frac\varepsilon2
=\varepsilon.
\]
Conclusion: the same \(\delta\) works for every pair \(p,q\in K\), so \(f\) is uniformly continuous.
Compactness Theorems You Should Know
Why the Cantor set is compact in one line
The Cantor set is closed in \([0,1]\). Since \([0,1]\) is compact and a closed subset of a compact space is compact, the Cantor set is compact.
How Do You Prove a Set Is Compact?
The proof method should match the ambient space and the prompt.
If \(K\subseteq\mathbb R^n\), Heine–Borel is usually the fastest route. In an arbitrary metric or topological space, do not assume closed and bounded is enough.
Look for missing endpoints, omitted accumulation points, or a representation as a preimage of a closed set under a continuous function.
Find an explicit radius, interval, or ball containing the set.
Apply Heine–Borel for Euclidean classification, sequential compactness for sequence arguments, or the open-cover definition for topology proofs.
Show the set is not closed or not bounded in \(\mathbb R^n\), exhibit an open cover with no finite subcover, or build a sequence with no subsequence converging inside the set.
| Prompt language | Best first move | What must be shown |
|---|---|---|
| “Determine whether compact” in \(\mathbb R^n\) | Heine–Borel | Closed and bounded |
| “Use the definition of compactness” | Open covers | Every cover has a finite subcover |
| “Use sequences” | Sequential compactness | Convergent subsequence with limit in the set |
| “Prove not compact” | Find one failure | Unboundedness, missing limit, bad cover, or bad sequence |
| General metric space | Check available hypotheses | Often completeness plus total boundedness |
Compact or Not? Practice Problems With Solutions
Decide first. Then open the solution and compare the theorem, hypothesis, and conclusion.
Practice 1: Is \(\mathbb Z\subseteq\mathbb R\) compact?
No. The integers are closed in \(\mathbb R\), but they are unbounded. Therefore \(\mathbb Z\) is not compact by Heine–Borel. Sequentially, the sequence \(x_n=n\) has no convergent subsequence.
Practice 2: Is every finite subset of a topological space compact?
Yes. Let \(F=\{x_1,\ldots,x_m\}\) and let \(\mathcal U\) be an open cover of \(F\). For each \(x_i\), choose one member of \(\mathcal U\) containing \(x_i\). At most \(m\) selected sets cover \(F\).
Practice 3: Is \(\mathbb Q\cap[0,1]\) compact as a subset of \(\mathbb R\)?
No. It is bounded but not closed in \(\mathbb R\). A sequence of rational numbers can converge to an irrational point in \([0,1]\), so the limit lies outside \(\mathbb Q\cap[0,1]\).
Practice 4: Is the Cantor set compact?
Yes. The Cantor set is closed and contained in \([0,1]\), so it is bounded. Heine–Borel gives compactness. Equivalently, it is a closed subset of the compact set \([0,1]\).
Practice 5: Is the closed unit disk \(D=\{(x,y):x^2+y^2\le1\}\subseteq\mathbb R^2\) compact?
Yes. The function \(g(x,y)=x^2+y^2\) is continuous, and \(D=g^{-1}(( -\infty,1])\), so \(D\) is closed. It is bounded because every point satisfies \(\sqrt{x^2+y^2}\le1\). Therefore \(D\) is compact by Heine–Borel.
Practice 6: Is \(\{1/n:n\in\mathbb N\}\) compact?
No as a subset of \(\mathbb R\). It is bounded, but it omits the limit point \(0\). The sequence \(x_n=1/n\) lies in the set and converges to \(0\), while no subsequence can converge to a different point in the set.
Common Compactness Mistakes
Mistake 1: Reversing the quantifiers. “There exists a finite open cover” is nearly meaningless; every set has one. The definition says every open cover contains a finite subcover.
Mistake 2: Treating closed and bounded as the definition. That equivalence is Heine–Borel in \(\mathbb R^n\), not the universal definition.
Mistake 3: Saying every bounded sequence converges. Bolzano–Weierstrass guarantees a convergent subsequence, not convergence of the full sequence.
Mistake 4: Forgetting where the limit lands. Sequential compactness requires the subsequential limit to belong to the set.
Mistake 5: Choosing new sets for a finite subcover. Every member of the subcover must come from the original cover.
Mistake 6: Proving sequential compactness and silently calling it compactness. State that you are invoking the separate metric-space equivalence theorem.
Mistake 7: Ignoring the ambient space. A set can be closed in one space and not closed in another.
Mistake 8: Forgetting nonemptiness in the Extreme Value Theorem. A maximum and minimum require a nonempty compact domain.
The Compactness Theorem Network
K\subseteq\mathbb R^n:
\qquad
\boxed{\text{closed and bounded}}
\iff
\boxed{\text{compact}}.
\]
\text{metric space}:
\qquad
\boxed{\text{compact}}
\iff
\boxed{\text{sequentially compact}}.
\]
\boxed{\text{compact domain}}
+
\boxed{\text{continuous function}}
\Longrightarrow
\begin{cases}
\text{compact image},\\
\text{attained maximum and minimum},\\
\text{uniform continuity}.
\end{cases}
\]
Compactness in Real Analysis FAQ
What is compactness in Real Analysis?
A set is compact if every open cover of the set contains a finite subcover. In \(\mathbb R^n\), compactness is equivalent to being closed and bounded.
What is an open cover?
An open cover of \(K\) is a collection of open sets whose union contains \(K\). Every point of \(K\) must lie in at least one member of the collection.
What is a finite subcover?
A finite subcover is a finite selection from an existing cover that still covers the entire set. The selected sets must come from the original cover.
What does the Heine–Borel Theorem say?
For subsets of \(\mathbb R^n\), a set is compact if and only if it is closed and bounded.
Why is \([0,1]\) compact?
The interval \([0,1]\) is closed and bounded in \(\mathbb R\), so it is compact by Heine–Borel. It can also be proved directly from the open-cover definition using the least-upper-bound property.
Why is \((0,1)\) not compact?
The interval is bounded but not closed. Directly, the open cover \(U_n=(1/n,1)\) covers \((0,1)\) but has no finite subcover.
Is every closed set compact?
No. The real line and the interval \([0,\infty)\) are closed but unbounded, so they are not compact.
Is every bounded set compact?
No. The interval \((0,1)\) is bounded but not closed, so it is not compact.
Does closed and bounded imply compact in every metric space?
No. For example, under the discrete metric every subset of \(\mathbb R\) is closed and bounded, but an infinite subset is not compact.
What is sequential compactness?
A set is sequentially compact if every sequence in the set has a subsequence converging to a point of the set. In metric spaces, sequential compactness and compactness are equivalent.
What does Bolzano–Weierstrass say?
Every bounded sequence in \(\mathbb R^n\) has a convergent subsequence.
What is the difference between compact and complete?
Completeness says every Cauchy sequence converges inside the space. Compactness says every sequence has a convergent subsequence inside the space. Compact metric spaces are complete, but complete spaces need not be compact.
Is \(\mathbb R\) compact?
No. The real line is closed and complete, but it is unbounded and therefore not compact.
Why is compactness important for continuous functions?
Continuous functions send compact sets to compact sets. On a nonempty compact domain, a continuous real-valued function attains its maximum and minimum and is uniformly continuous.
Is the Cantor set compact?
Yes. The Cantor set is closed and bounded in \(\mathbb R\), so it is compact. It is also a closed subset of the compact interval \([0,1]\).
How do you prove a set is not compact?
In \(\mathbb R^n\), show it is not closed or not bounded. More generally, find an open cover with no finite subcover or a sequence with no subsequence converging to a point of the set.
University Compactness Resources
A focused lecture note covering topological compactness, sequential compactness, Heine–Borel, and Bolzano–Weierstrass.
The full lecture-note sequence places compactness inside the broader study of metric spaces.
A university Real Analysis course outline that includes compactness and sequential compactness.
An advanced bridge explaining how finite-dimensional structure interacts with compactness and why sequence language must be handled carefully in general topological settings.
Master Real Analysis With a System
Compactness becomes manageable when definitions, quantifiers, examples, counterexamples, theorem hypotheses, and proof structures are practiced as one connected system—not as isolated facts.
Real Analysis Help
Join the Woody Calculus Mastery Lab
Private Advanced Math Instruction