Continuous Functions and Maxima
Compactness: A Foundational Concept in Topology and Analysis
Introduction: The Puzzle
Consider a bounded segment of the x‑axis, for example the open interval (0,1) — all real numbers strictly between 0 and 1, not including the endpoints. Can one draw the graph of a continuous function on (0,1) that has no finite maximum? Many ordinary curves would have a highest point, but the function f(x)=1/x provides a solution. Its graph forms a vertical asymptote at x=0; the height grows without bound as x approaches 0, but the function never reaches x=0, so there is no finite maximum.
Now modify the requirement: the graph must touch both x=0 and x=1 — that is, the function must be defined and continuous on the closed interval [0,1], including the endpoints, and still be a single continuous curve. Can one draw such a curve that has no highest point? It becomes much harder: any attempt to insert an asymptote would create a discontinuity because the function must be defined at the actual asymptote point. It seems impossible to avoid having both a maximum and a minimum. But is it truly impossible? This is exactly the kind of question that the concept of compactness helps resolve.
Definition of Compactness
A standard definition:
A subset K of a topological space (or metric space) is called compact if every open cover of K has a finite subcover.
Unpacking the Definition
To understand this, recall some basic notions from topology:
A topological space (or metric space) is a set where concepts like open, closed, interior, exterior, and boundary make sense.
A set S divides the ambient space into three parts:
Interior: points that can be enclosed in a ball entirely contained in S.
Exterior: points that can be enclosed in a ball completely disjoint from S.
Boundary: points where every ball around them, no matter how small, contains points both inside and outside S.
An open set contains only interior points. This means open sets always have a little “fatness” — every point has a ball around it that stays inside the set.
A closed set contains all of its boundary points.
A set may include part of its boundary, but only the two extremes (fully open, fully closed) are given special names.
Now back to the definition:
An open cover of a set K is a collection of open sets (possibly infinite) whose union contains K.
A subcover is a subcollection of those open sets that still covers K. (The original cover is considered a subcover of itself.)
A compact set is one where for any open cover you can pick out a finite subcollection that still covers the set.
Important nuance: This is not the same as saying a set can be covered by finitely many open sets — that is true for every set (just use the whole space). Compactness says that no matter how complicated or infinite the cover is, you can always reduce it to a finite one. In other words, any infinite open cover of a compact set overcovers it; you can discard infinitely many open sets and still cover the target.
Intuitive Understanding via Sequential Compactness
An equivalent way to think about compactness (in metric spaces) is sequential compactness:
A set K is compact if and only if every sequence of points in K has a subsequence that converges to a point in K.
How a Set Can Fail Sequential Compactness
Sequence diverges to infinity: If a sequence escapes to arbitrarily large distances, no subsequence can converge. Thus a compact set must be bounded.
Sequence approaches a missing point: If the set has a “hole” (a gap in the interior) or is missing its boundary, a sequence that converges to that missing point will have no convergent subsequence inside the set. Hence a compact set must be complete (closed, in the sense of containing all limit points).
A more subtle failure in infinite‑dimensional spaces: Consider an infinite‑dimensional space where each point is an infinite list of numbers (a1,a2,a3,…) that eventually becomes all zeros. Define a sequence where the nth point has a 1 in the nth coordinate and zeros elsewhere. All these points are at distance 1 from the zero list, so the sequence is bounded. Yet it does not converge — and no subsequence converges — because each point is “too far” from every other point and from the origin. Such a sequence explores infinitely many dimensions while staying at a fixed distance.
To prevent this third failure, a set must be totally bounded:
A set is totally bounded if, for any fixed size ε>0, it can be covered by a finite number of balls of radius ε.
In finite‑dimensional Euclidean space, ordinary boundedness implies total boundedness (a bounded blob can be covered by finitely many small balls). But in infinite‑dimensional spaces, a bounded set may not be totally bounded — the example above requires infinitely many ε‑balls to cover it for small ε.
Putting it together: A metric space is compact if and only if it is complete and totally bounded.
Complete: all limits of Cauchy sequences are inside the set (no holes, includes boundary).
Totally bounded: the set is “small” enough that you can’t have infinitely many points that are all separated by a fixed distance.
In ordinary Euclidean space Rn, compact sets are exactly the closed and bounded sets. This is the Heine‑Borel theorem, a foundational result in analysis.
Why Compactness Matters: Local to Global
One of the main reasons compact sets are so important is that they allow properties that hold locally on a set to be extended to the whole set globally.
Example: The Extreme Value Theorem
Every continuous function defined on a compact set attains both a maximum and a minimum. (It is also bounded.)
Proof sketch (showing boundedness): Let f be continuous on a compact set K (take K=[0,1] for concreteness). For each x in [0,1], continuity means that there exists some δx>0 such that f stays within a fixed bound on the open interval (x−δx,x+δx) — say, ∣f(y)−f(x)∣<1 for all y in that interval. Thus f is locally bounded around each x.
The collection of all these open intervals {(x−δx,x+δx):x∈[0,1]} forms an open cover of [0,1]. Because [0,1] is compact, there is a finite subcover — finitely many such intervals that still cover the whole interval. On each of these finitely many intervals, f is bounded. Taking the maximum of all the individual bounds gives a finite global upper bound for f on [0,1]. A lower bound is obtained similarly.
What happens if the domain is not compact? Consider f(x)=1/x on the open interval (0,1). Near x=0, the function grows so steeply that the δx intervals become thinner and thinner. No finite subcollection of these δ‑intervals can cover all the way down to 0, because the intervals shrink as x→0 and you would need infinitely many to reach the endpoint. Hence the local‑to‑global argument fails, and indeed 1/x is unbounded on (0,1).
This pattern appears over and over in mathematics: compactness enables us to take a property that holds in small neighborhoods and “stitch together” a finite number of those neighborhoods to obtain a property that holds over the entire set.
Conclusion: Compactness in Higher Mathematics
Compactness is one of the most important concepts in topology and analysis. It is used to prove the Extreme Value Theorem, the Bolzano–Weierstrass Theorem (every bounded sequence has a convergent subsequence), and many results in functional analysis, probability, and differential equations. Because compact sets mimic finite sets in topological ways, they allow arguments that would otherwise only work for finite collections to be applied to infinite (but compact) ones.
In function spaces, compactness helps define convergent subsequences of functions, leading to results like the Arzelà–Ascoli theorem.
In probability theory, compactness is crucial for the existence of limits of probability measures (Prokhorov’s theorem).
Understanding compactness — both the formal definition and the intuitive ideas of boundedness, completeness, and total boundedness — unlocks a deep and powerful toolset for modern mathematics.

Ask anything
We've read this whole study set, so questions about it get the best answers.