Compactness is one of the most important ideas in topology and analysis. It lets you take techniques that work for finite collections and apply them to infinite ones. If a set is compact, it behaves "almost like a finite set" in key ways, which makes proving things about it much more tractable.
This guide covers the definition of compactness through open covers, its equivalent formulations, its core properties, and how it shows up across different areas of mathematics.
Definition of compactness
Compactness generalizes the notion of finiteness to infinite sets. A set is compact if, no matter how you try to cover it with open sets, you can always find a finite collection from that cover that still does the job. That single requirement turns out to have surprisingly deep consequences.
Open cover concept
An open cover of a set is a collection of open sets whose union contains every point of . The individual open sets can overlap, and the collection can be infinite (even uncountably so).
For example, consider the closed interval on the real line. You could cover it with the collection of open intervals . That's a finite open cover. But you could also cover it with infinitely many tiny intervals. The point is that any collection of open sets that contains all of counts as an open cover.
Finite subcover requirement
Here's where compactness gets its teeth: a set is compact if every open cover of has a finite subcover. That means no matter which open cover someone hands you, you can always pick out finitely many of those open sets that still cover all of .
This is a strong condition. It's not enough that some open covers have finite subcovers (that's trivially true). Every open cover must have one. This requirement is what lets you reduce infinite problems to finite ones when working with compact sets.
Equivalent formulations
The open cover definition is the standard one, but compactness can be characterized in several equivalent ways, each useful in different contexts.
Bolzano-Weierstrass property
The Bolzano-Weierstrass property says that every infinite subset of a compact set has a limit point (a point that every open neighborhood around it contains other points of the subset). In practical terms, points in a compact set can't "escape to infinity" or spread out without clustering somewhere.
This connects compactness directly to convergence: if you have an infinite sequence in a compact set, some subsequence must converge to a point within the set.
Heine-Borel theorem
The Heine-Borel theorem gives a concrete characterization of compactness in : a subset of Euclidean space is compact if and only if it is both closed and bounded.
- Closed means the set contains all its limit points.
- Bounded means the set fits inside some ball of finite radius.
This is extremely useful because checking "closed and bounded" is often much easier than verifying the open cover definition directly. But be careful: Heine-Borel applies specifically to Euclidean spaces. In general topological or metric spaces, closed and bounded does not guarantee compactness.
Sequential compactness
A set is sequentially compact if every sequence in the set has a subsequence that converges to a point within the set. In metric spaces, sequential compactness is equivalent to compactness. In general topological spaces, however, the two notions can differ.
Sequential compactness is often the most intuitive version to work with, especially in analysis, because it directly involves sequences and limits rather than abstract collections of open sets.
Properties of compact sets
Closed and bounded sets
In , compact sets are always closed and bounded (and vice versa, by Heine-Borel). Closedness ensures limit points stay in the set, while boundedness keeps the set from stretching out to infinity. Together, these properties enable results like the extreme value theorem and uniform continuity.
Intersection of compact sets
The intersection of any collection of compact subsets of a Hausdorff space is compact. This preserves compactness under set operations and is useful for constructing new compact sets from existing ones. It plays a role in fixed point theorems and other intersection arguments in topology.

Continuous image of compact sets
If is continuous and is compact, then is compact. This is one of the most frequently used properties of compactness. It means compactness is preserved under continuous maps, which is essential for optimization (guaranteeing that a continuous function on a compact set actually attains its extreme values) and for many existence proofs in analysis.
Compactness in metric spaces
Completeness vs compactness
These two concepts are related but distinct:
- A space is complete if every Cauchy sequence converges within the space.
- A space is compact if every sequence has a convergent subsequence within the space.
Every compact metric space is complete, but the converse fails. For instance, with the standard metric is complete but not compact (it's unbounded). The real line shows that completeness alone doesn't force the "clustering" behavior that compactness requires.
Total boundedness
A metric space is totally bounded if, for every , you can cover the entire space with finitely many open balls of radius . This is a stronger condition than ordinary boundedness.
The key equivalence in metric spaces is:
A metric space is compact if and only if it is both complete and totally bounded.
This gives you a two-part test for compactness in metric spaces that's often easier to check than the open cover definition.
Compactness in topological spaces
Hausdorff spaces
A Hausdorff space is one where any two distinct points can be separated by disjoint open neighborhoods. In Hausdorff spaces, compact subsets are always closed, and limits of sequences (when they exist) are unique. Most spaces you encounter in analysis are Hausdorff, so compact subsets there automatically carry the "closed" property.
Local compactness
A space is locally compact if every point has a neighborhood whose closure is compact. This is a weaker condition than global compactness but still very useful. The real line is locally compact (every point sits inside a closed bounded interval) but not compact. Local compactness is important in the study of manifolds, locally compact groups, and harmonic analysis.
Applications of compactness
Extreme value theorem
If is a continuous real-valued function on a compact set , then attains its maximum and minimum values on . There exist points such that for all .
Without compactness, this can fail. For example, on the open interval gets arbitrarily close to 0 and 1 but never reaches either value.

Uniform continuity on compact sets
A continuous function on a compact set is automatically uniformly continuous. This means the "rate" of continuity doesn't depend on where you are in the set. Formally, for any , there's a single that works everywhere in the domain, not just at each individual point.
This is a significant upgrade from ordinary continuity and is important for approximation theory, numerical methods, and proving convergence results.
Compactness in optimization
Many optimization problems require you to show that an optimal solution exists before you try to find it. Compactness, combined with continuity, guarantees existence: a continuous function on a compact set achieves its minimum and maximum. This principle underlies results in linear programming, game theory (existence of Nash equilibria), and the calculus of variations.
Counterexamples and non-compact sets
Understanding why certain sets fail to be compact solidifies the concept.
Open intervals
The open interval is bounded but not closed, and it's not compact. Consider the open cover . Every point of lies in some , but no finite subcollection covers points arbitrarily close to 0. This shows that boundedness alone isn't enough; you also need closedness (in ).
Unbounded closed sets
The set is closed but not bounded, and it's not compact. The open cover covers the entire set, but no finite subcollection reaches all the way to infinity. This shows that closedness alone isn't enough either.
Compactness in analysis
Arzelà-Ascoli theorem
The Arzelà-Ascoli theorem characterizes compact subsets of the space of continuous functions (with the uniform norm). A subset is relatively compact if and only if it is:
- Uniformly bounded: there exists such that for all and all .
- Equicontinuous: for every , there exists such that whenever , uniformly across all .
This theorem is a workhorse for proving existence of solutions to differential equations and for approximation arguments in functional analysis.
Stone-Weierstrass theorem
The Stone-Weierstrass theorem says that certain subalgebras of (continuous functions on a compact space ) are dense in the uniform norm. It generalizes the classical Weierstrass approximation theorem (which says polynomials can approximate any continuous function on ) to much more abstract settings. Compactness of the underlying space is essential to the result.
Compactness in algebra
Compact groups
A compact group is a topological group that is compact as a topological space. Key examples include the circle group (complex numbers of modulus 1 under multiplication) and the orthogonal group (rotation and reflection matrices). Every compact group admits a unique normalized Haar measure, which enables integration over the group and is foundational for representation theory and harmonic analysis.
Compactification of spaces
Compactification is the process of embedding a non-compact space into a compact one as a dense subset. Two important constructions:
- One-point compactification: adds a single "point at infinity." For example, compactifying this way gives the sphere .
- Stone-Čech compactification: the "largest" compactification, adding as many points as needed to make every bounded continuous function extendable.
Compactification lets you apply compact-space techniques to non-compact spaces by working in the larger compact space and then restricting back.