I've read many times that 'compactness' is such an extremely important and useful concept, though it's still not very apparent why. The only theorems I've seen concerning it are the Heine-Borel theorem, and a proof continuous functions on R from closed subintervals of R are bounded. It seems like such a strange thing to define; why would the fact every open cover admits a finite refinement be so useful? Especially as stating "for every" open cover makes compactness a concept that must be very difficult thing to prove in general - what makes it worth the effort?

If it helps answering, I am about to enter my third year of my undergraduate degree, and came to wonder this upon preliminary reading of introductory topology, where I first found the definition of compactness.

  • 4
    $\begingroup$ Finite subcover. A refinement is something different, used to define weaker related ideas. $\endgroup$
    – dfeuer
    Commented Sep 6, 2013 at 15:32
  • 18
    $\begingroup$ Essentially, compactness is "almost as good as" finiteness. I can't think of a good example to make this more precise now, though. $\endgroup$ Commented Sep 6, 2013 at 15:36
  • 4
    $\begingroup$ FireGarden, perhaps you are reading about paracompactness? $\endgroup$
    – Asaf Karagila
    Commented Sep 6, 2013 at 16:39
  • 21
    $\begingroup$ M. R. Sundström's paper A pedagogical history of compactness may be useful here. It discusses the original motivations for the notion of compactness, and its historical development. If you want to understand the reasons for studying compactness, then looking at the reasons that it was invented, and the problems it was invented to solve, is one of the things you should do. $\endgroup$
    – MJD
    Commented Sep 6, 2013 at 16:47
  • 6
    $\begingroup$ @dfeuer: The condition of having finite subcover and finite refinement are equivalent. $\endgroup$
    – user87690
    Commented Sep 6, 2013 at 17:33

13 Answers 13


As many have said, compactness is sort of a topological generalization of finiteness. And this is true in a deep sense, because topology deals with open sets, and this means that we often "care about how something behaves on an open set", and for compact spaces this means that there are only finitely many possible behaviors.

But why finiteness is important? Well, finiteness allows us to construct things "by hand" and constructive results are a lot deeper, and to some extent useful to us. Moreover finite objects are well-behaved ones, so while compactness is not exactly finiteness, it does preserve a lot of this behavior (because it behaves "like a finite set" for important topological properties) and this means that we can actually work with compact spaces.

The point we often miss is that given an arbitrary topological space on an infinite set $X$, the well-behaved structures which we can actually work with are the pathologies and the rare instances. This is throughout most of mathematics. It's far less likely that a function from $\Bbb R$ to $\Bbb R$ is continuous, differentiable, continuously differentiable, and so on and so forth. And yet, we work so much with these properties. Why? Because those are well-behaved properties, and we can control these constructions and prove interesting things about them. Compact spaces, being "pseudo-finite" in their nature are also well-behaved and we can prove interesting things about them. So they end up being useful for that reason.

  • 6
    $\begingroup$ +1. I particularly like the phrase "finitely many possible behaviors". In every other respect, one could have used "discrete" in place of "compact". Honestly, discrete spaces come closer to my intuition for finite spaces than do compact spaces. However, as you pointed out, compactness is deep; in contrast, discreteness is the ultimate separation axiom while most spaces we're interested in are comparatively low on the separation hierarchy. $\endgroup$ Commented Sep 6, 2013 at 21:37
  • 5
    $\begingroup$ And when one learns about first order logic, gets the feeling that compactness is, somehow, deduce information about an "infinite" object by deducing it from its "finite" (or from a finite number of) parts. By the way, as always, very nice to read your answers. $\endgroup$
    – leo
    Commented Sep 11, 2013 at 3:12
  • $\begingroup$ @leo: Thank you for the compliment. $\endgroup$
    – Asaf Karagila
    Commented Sep 11, 2013 at 5:37
  • $\begingroup$ @AsafKaragila This seems to be on par with what Qiaochu mentioned here: math.stackexchange.com/questions/31859/…, and I think it's a really interesting point of view. I was wondering if you had any nice examples that illustrate that first paragraph? $\endgroup$
    – user171308
    Commented Dec 15, 2015 at 1:57
  • 1
    $\begingroup$ @AsafKaragila Can you elaborate a bit on "finitely many possible behaviours"? Different (finite) subcovers of the same compact set may lead to different behaviours, and thus infinitely many possibilities, no? $\endgroup$
    – Atom
    Commented May 8, 2023 at 21:32

Compactness does for continuous functions what finiteness does for functions in general.

If a set $A$ is finite, then every function $f:A\to \mathbb R$ has a max and a min, and every function $f:A\to\mathbb R^n$ is bounded. If $A$ is compact, then every continuous function from $A$ to $\mathbb R$ has a max and a min and every continuous function from $A$ to $\mathbb R^n$ is bounded.

If $A$ is finite, then every sequence of members of $A$ has a sub-sequence that is eventually constant, and "eventually constant" is the only sort of convergence you can talk about without talking about a topology on the set. If $A$ is compact, then every sequence of members of $A$ has a convergent subsequence.


Compactness is the next best thing to finiteness.

Think about it this way:

Let $A$ be a finite set, let $f: A \to \mathbb{R}$ be a function. Then $f$ is trivially bounded.

Now let $X$ be a compact set, set $f: X \to \mathbb{R}$ be a continuous function. Then $f$ is also bounded...

  • $\begingroup$ To extend the analogy, compactness, like finiteness, is "intrinsic". That is, if $X \subset Y$ are topological spaces (say metric spaces) and $K \subset X$, then $K$ is compact as a subset of $X$ if and only if $K$ is compact as a subset of $Y$. It does not matter how we embed $K$; it already "knows" if it's compact. This is in contrast to properties like "closed" that depend crucially on the ambient space. $\endgroup$ Commented Sep 16, 2023 at 0:43

It's already been said that compact spaces act like finite sets. A variation on that theme is to contrast compact spaces with discrete spaces.

A compact space looks finite on large scales. A discrete space looks finite on small scales. A $T_1$ space is finite if and only if it is both compact and discrete. So we have the slogan "compactness = finiteness modulo discreteness".

A locally compact abelian group is compact if and only if its Pontryagin dual is discrete. So we have another slogan, "compactness = Fourier transform of discreteness".

  • 1
    $\begingroup$ Is there a redefinition of discrete so this principle works for all topological spaces (e.g., discrete modulo indistinguishability)? Or of compactness. $\endgroup$
    – zyx
    Commented Sep 6, 2013 at 19:08
  • 1
    $\begingroup$ @zyx I guess we could loosen the discreteness condition (every point has a singleton neighborhood) by requiring instead that every point has a finite neighborhood. Not sure what this property P should be called... Anyway, a topological space is finite iff it is both compact and P. $\endgroup$ Commented Sep 6, 2013 at 22:20

One reason is that boundedness doesn't make sense in a general topological space. For example $(-1, 1) \subset \mathbb{R}$ is bounded when viewing $\mathbb{R}$ as a metric space with the usual Euclidean metric, but as topological spaces, $(-1, 1)$ and $\mathbb{R}$ really are the same, that is, homeomorphic.

So why then compactness? Well, I suppose part of the motivation is the Heine-Borel Theorem, which says a subset of $\mathbb{R}^n$ is compact if and only if it is closed and bounded; or said another way, a closed set is compact if and only if it is bounded. So, at least for closed sets, compactness and boundedness are the same. This relationship is a useful one because we now have a notion which is strongly related to boundedness which does generalise to topological spaces, unlike boundedness itself. In addition, at least for Hausdorff topological spaces, compact sets are closed. So one way to think about compact sets in topological spaces is that they are analogous to the bounded sets in metric spaces. The analogy here is not exact because the Heine-Borel Theorem only applies to $\mathbb{R}^n$, not every metric space, but hopefully this gives you some intuition.


Compactness is important because:

1)It behaves greatly when using topological operations

a)It's a condition that is carried on by continuous functions on any topological space, that is, if $C$ is compact and $f:C \rightarrow Y$ where $Y$ is a topological space, then $f(C)$ is compact in Y.

b)An arbitrary product of compact sets is compact in the product topology.

2) Compact sets behave almost as finite sets, which are way easier to understand and work with than uncountable pathologies which are common in topology.

Compactness is useful even when it emerges as a property of subspaces:

3) Most of topological groups we face in math every day are locally compact, e.g $\mathbb{R}$, $\mathbb{C}$, even $\mathbb{Q_P}$ and $\mathbb{R_P}$ the p-adic numbers.

4) It is often easier to solve a differential equation in a compact domain than in a non-compact.

5) There are many types of convergence of functions, one of which is convergence in compact set.

6) Regular borel measure, one of the most important class of measures is defined by limits of measures in compact sets.

This list is far from over...

Anyone care to join in?

  • $\begingroup$ Historically, it led to the compactness theorem for first-order logic, but that's over my head. $\endgroup$
    – dfeuer
    Commented Sep 6, 2013 at 15:44

Well, here are some facts that give equivalent definitions:

  1. Every net on a compact set has a convergent subnet.

  2. Every ultrafilter on a compact set converges.

  3. Every filter on a compact set has a limit point.

  4. Every net in a compact set has a limit point.

  5. Every universal net in a compact set converges.

Here are some more useful things:

  1. Every continuous bijection from a compact space to a Hausdorff space is a homeomorphism.

  2. Every compact Hausdorff space is normal.

  3. The image of a compact space under a continuous function is compact.

  4. Every infinite subset of a compact space has a limit point.


I would like to give here a example showing why compactness is important. Consider the following Theorem:

Theorem: Let $f:\mathbb{R}\to \mathbb{R}$ be a continuous coercive function. Then, there exist $x_0\in \mathbb{R}$ such that $$\tag{1} f(x_0)=\inf_{x\in\mathbb{R}}f(x)$$

Proof: Let $I=\inf_{x\in\mathbb{R}}f(x) $ and choose $x_n\in \mathbb{R}$ with $f(x_n)\to I$. We claim that $x_n$ is bounded. Indeed, if $x_n$ was not bounded, then we could extract a subsequence of $x_n$ not relabeld such that $f(x_n)\to \infty$ (by coercivity) which is an absurd. Now, $x_n$ being bounded implies without loss of generality that (compactness) $x_n\to x$. Because $f$ is continuous, we conclude that $f(x_n)\to f(x)=I$.

The main argument of the proof was the fact that the closure of any bounded set in $\mathbb{R}$ is compact. Now consider the problem ($\Omega\subset\mathbb{R}^N$ bounded domain)

$$ \tag{P} \left\{ \begin{array}{ccc} -\Delta u =f&\mbox{ in $\Omega$} \\ u\in H_0^1(\Omega) &\mbox{ } \end{array} \right. $$

We say that $u\in H_0^1(\Omega)$ is a solution of (P) if $$\int_\Omega\nabla u\nabla v=\int_\Omega fv,\ \forall\ v\in H_0^1(\Omega)\tag{3}$$

Let $F:H_0^1(\Omega)\to \mathbb{R}$ be defined by $$F(u)=\frac{1}{2}\int_\Omega |\nabla u|^2-\int_\Omega fu$$

$(3)$ is equivalently to $\langle F'(u),v\rangle =0$ for all $v\in H_0^1(\Omega)$ and this equality is equivalently to find a local minimum of $F$ in $H_0^1(\Omega)$. One can check that $F$ is continuous and coercive, so we could try to use the same argument as above to find a minimum to $F$, but the problem here is lack of compactness, i.e. if $K\subset H_0^1(\Omega)$ is bounded we can't conclude that the closure of $K$ is compact.

Therefore to see how important compactness is, the above problem can be solved by considering a new topology in $H_0^1(\Omega)$, to wit, the weak topology. In this topology we have less open sets which implies more compact sets and in particular, bounded sets are pre-compact sets. It can be show that $F$ is weakly sequentially lower semi continuous, i.e. $F$ is lower sequentially continuous in the weak topoogy, which together with coercivity implis the existence of a minimum.

To conclude,take a look on these examples (they show how worse can be lack of compactnes): here and here.

  • 2
    $\begingroup$ The concept of a "coercive" function was unfamiliar to me until I read your answer; I suspect the same will be true for many readers. If by "coercive" you mean that $\lim_{x \rightarrow \pm \infty} = \infty$, then the fact that a continuous coercive function must attain its minimum value is an exercise that I assign to my honors calculus students: it requires only the extreme value theorem (which of course can be thought of in terms of compactness but need not be, and probably most of us learn it without compactness first). So I'm not sure this is a good example... $\endgroup$ Commented Sep 18, 2013 at 18:39
  • $\begingroup$ (The rest of your example is very interesting and strong...if not necessarily accessible to the broadest possible audience who could be interested in the question.) $\endgroup$ Commented Sep 18, 2013 at 18:42
  • $\begingroup$ Thank you for your comment @PeteL.Clark. Let me ask you one thing: in my point of view the extreme value theorem (EVT) relies strongly on the fact that the domain is compact, hence this would implie that compactness is important in proving the statement, howerver, even if we do not use this argument, I think that a proof using (EVT) would use compactness. For example, a proof which comes from my head is: write $(-\infty,\infty)=\cup_{i=1}^\infty [-i,i]$. Take the infimum of $f$ in each $[-i,i]$ (which exist because of EVT) and show that this sequence WLOG converge (using compactness) $\endgroup$
    – Tomás
    Commented Sep 18, 2013 at 19:03
  • 1
    $\begingroup$ My point is this: that the compactness of various spaces is important in mathematics seems beyond any reasonable debate: if $[a,b]$ were not compact, calculus would crumble. The real question is what is the advantage of making explicit the compactness concept. You can go quite far in one-variable calculus without having to use the Heine-Borel Theorem. This set of lecture notes is a good test case: math.uga.edu/~pete/2400full.pdf. The HB Theorem is stated and proved therein but used very rarely...and only for things which were too advanced to be covered in the course! $\endgroup$ Commented Sep 18, 2013 at 19:34
  • 3
    $\begingroup$ To prove your theorem without it: since $\lim_{x \rightarrow \pm \infty} f(x) = \infty$, there is some $M > 0$ such that $f(x) > f(0)$ for all $x$ with $|x| > M$. Thus the minimum value of $f$ on $[-M,M]$ is its minimum value on all of $\mathbb{R}$. $\endgroup$ Commented Sep 18, 2013 at 19:37

If you have some object, then compactness allows you to extend results that you know are true for all finite sub-objects to the object itself.

The main result used to prove this kind of thing is the fact that if $X$ is a compact space, and $(K_\alpha)_{\alpha\in A}$ is a family of closed sets with the finite intersection property (no finite collection has empty intersection) then $(K_\alpha)$ has non-empty intersection. For if $(K_\alpha)$ has empty intersection then the complements of the $K_\alpha$ form an open cover of $X$, which then has to have a finite subcover $(X\setminus K_{\alpha(i)})_{i=1}^n$, and so the $(K_{\alpha(i)})_{i=1}^n$ is a finite collection of the $K_\alpha$ with empty intersection.

For example, the De Bruijn-Erdős Theorem in graph theory states that an infinite graph $G$ is $n$-colourable if all its finite subgraphs are $n$-colourable (i.e., you can colour the vertices with $n$ colours in such a way that no two vertices connected by an edge are the same colour). You can prove this by noting that the space $X$ of all colourings of the vertices of $G$ with $n$ colours (for which vertices of the same colour may share an edge) is a compact topological space (since it is the product of discrete spaces). Then, for each finite subgraph $F$, let $X_F$ be the set of all colourings of $G$ that give an $n$-colouring of $F$. It can be checked that the $X_F$ are closed and have the finite intersection property, so they have non-empty intersection, and any member of their intersection must $n$-colour the whole of $G$.

In general, if you have some property that you know is true for finite sub-objects, then you can often encode that in a collection of closed sets in a topological space $X$ that have the finite intersection property. Then, if $X$ is compact, you can show that the closed sets have non-empty intersection, which normally tells you that the result is true for the object itself (sorry that this is all so imprecise!)

A very closely-related example is the compactness theorem in propositional logic: an infinite collection of sentences is consistent if every finite sub-collection is consistent. This can be proved using topological compactness, or it can be proved using the completeness theorem: if the collection is inconsistent, then it must be possible to derive a contradiction using finitely many finite statements, so some finite collection of sentences must be inconsistent. Either way you look at it, though, the compactness theorem is a statement about the topological compactness of a particular space (products of compact Stone spaces).


Simply put, compactness gives you something to work with, this "something" depending on the particular context. But for example, it gives you extremums when working with continuous functions on compact sets. It gives you convergent subsequences when working with arbitrary sequences that aren't known to converge; the Arzela-Ascoli theorem is an important instance of this for the space of continuous functions (this point of view is the basis for various "compactness" methods in the theory of non-linear PDE). It gives you the representation of regular Borel measures as continuous linear functionals (Riesz Representation theorem). Etc.


I want to elaborate Sargera's and Tomás' theme.

Topological considerations are great, but to me the examples are not as concrete as for when we speak of "sequential compactness" (which unfortunately in general topologies does not equate to compactness, but includes for example weak/weak* compactness).

In this situation, for practical purposes, all I want to know about topologically for a given setting is, given a sequence of points in my space, define a notion of convergence. Give me the definition of convergence to play with, and we can talk about sequential compactness. For sequential compactness of a set, we ask: "Given an arbitrary sequence in the set, does there exist a convergent subsequence?"

In general, the usefulness of this is that often we want to find a function with some property $P$, but we can only find functions with property $P_n$, which is close to $P$ as $n$ gets larger, and taking a limit as $n \to \infty$ would get property $P$. (In Tomás' example, $P_n$: "functions that achieve objective value within $1/n$ of the infimum", and $P$: "function that achieves infimum"). However, the functions satisfying property $P_n$ may not converge as we take $n$ to $\infty$, so we would not be able to take a limit of the function sequence. If the set of functions is sequentially compact (with respect to whatever notion of convergence we are working with), we can take a subsequence that converges and obtain the desired function satisfying property $P$!

(Replace function in previous part by point in set, and we can talk about other things like measures, $\mathbb{R}^N$, etc... it's just so often I am applying this to functions or measures. In probability they use the term "tightness" for measures)

Hmm.. one caveat for the above: for the notion of convergence being used, one would have to prove that the convergence preserves the property, or the property is continuous with respect to the notion of convergence. So in Tomás' example again, weak convergence is still good enough to obtain the minimizer. I think it's a great example because it motivates the study of weaker notions of convergence. Note that we need weak convergence in that example (the PDE example with $H^1$) because it is infinite dimensional, and it is not true that the feasible set of the optimization problem is compact under the usual norm-convergence.


We can think of a closed set in $X$ as being like the locus of $x\in X$ where a continuous function $f(x)$ is $0$.

Now suppose there is a continuous function $f(x,p)$ which depends on a parameter $p$. Under what conditions can we say that the locus of $x$ for which there exists $p$ so that $f(x,p)=0$? The condition is that $p$ various over a compact space.

Put differently, we know that a union of closed sets need not be closed. Under what condition is the union of a parametric family of closed sets closed? With appropriate definitions, if it is a "continuous family" where the parameter space is compact.

In more formal terms: A space $P$ is compact if and only if $X\times P\to X$ is closed for every space $X$.

This can be useful in many contexts. For example, given parametric equations $T^n+a_1(p)T^{n-1}+\dots+a_n(p)=0$, the collection of solutions is a closed set as long as $a_i$'s are continuous functions on a compact set.


Every continuous function is Riemann integrable-uses Heine-Borel theorem. Since there are a lot of theorems in real and complex analysis that uses Heine-Borel theorem, so the idea of compactness is too important.

  • 1
    $\begingroup$ Perhaps you could improve this Answer by adding further specific examples of "theorems in real and complex analysis that [use] Heine-Borel theorem", or by explaining how proving continuous $\implies$ Riemann integrable makes use of it. $\endgroup$
    – hardmath
    Commented Mar 16, 2014 at 14:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .