# Compact Space

**Compactness** is a topological property that is fundamental in real analysis, algebraic geometry, and many other mathematical fields. In \( {\mathbb R}^n\) (with the standard topology), the compact sets are precisely the sets which are closed and bounded. Compactness can be thought of a generalization of these properties to more abstract topological spaces.

Compact sets are well-behaved with respect to continuous functions; in particular, the continuous image of a compact function is compact, so a continuous function from a compact set to \( \mathbb R\) must have a finite minimum and maximum, and must attain each of these at some point in the domain (the extreme value theorem). This is quite useful in applications to optimization and other related areas.

#### Contents

## Formal Definition

The definition of compactness, that is the most general and works best for proofs, turns out to be a relatively unintuitive definition in terms of open covers.

Let \(Z\) be a subset of a topological space \(X.\) Then \(Z\) is **compact** if, whenever \( Z\) is contained in a union \( \bigcup\limits_\alpha U_{\alpha} \) of open sets \(U_{\alpha},\) there are finitely many open sets \( U_{\alpha_1}, U_{\alpha_2}, \ldots, U_{\alpha_n}\) such that \( Z\) is contained in \( \bigcup\limits_{k=1}^n U_{\alpha_k}.\) That is,

\(Z\) is compact if every open cover has a finite subcover.

This definition is often extended to the whole space: a topological space \(X\) is compact if and only if it is compact as a subset of itself. It is not hard to show that \(Z\subseteq X\) is compact as a subset of \(X\) if and only if it is compact as a topological space, when given the subspace topology; so the definitions are consistent.

Is \( (0,1)\) compact as a subset of \(\mathbb R?\) Is \([0,\infty)?\) Is \([0,1]?\)

The answers to these questions are no, no, and yes, respectively. A "no" answer is easier to justify, simply by exhibiting an open cover with no finite subcover. E.g. for \( (0,1),\) consider the open sets \(\left(0,\frac12\right),\left(0,\frac23\right),\left(0,\frac34\right),\ldots\): \( U_\alpha = \left(0,\dfrac{\alpha}{\alpha+1}\right)\) for \(\alpha \in {\mathbb N}.\) Notice that the \( U_\alpha\) cover \( (0,1),\) since every element in that interval is in one (indeed, infinitely many) of the \( U_{\alpha}.\) But there is no finite subcover: if there were, then the union of the finite subcover would be \( U_k\) for some \(k\) (the largest of the finite set of indices), and \( U_k = \left(0,\frac{k}{k+1}\right)\) cannot equal all of \((0,1).\)

\([0,\infty)\) is even easier: Consider the open intervals \( (-1,1),(0,2),(1,3),\ldots\); these cover \( [0,\infty),\) but it is clear that no finite subset does.

The proof that \([0,1]\) is compact is considerably more difficult. It will follow from results in subsequent sections. \(_\square\)

The example suggests that an unbounded subset of \({\mathbb R}^n\) will not be compact (because there will be an open cover of bounded sets which cannot have a finite subcover), and that a non-closed set will not be compact (by taking covers "approaching" a limit point).

## Equivalent Formulations

When \(X\) is an abstract topological space, there is one other formulation of compactness that is occasionally useful.

\(X\) is compact if and only if any collection of closed subsets of \(X\) with the

finite intersection propertyhas nonempty intersection. (The "finite intersection property" is that any intersection of finitely many of the sets is nonempty.)

\(X\) is not compact if and only if there is an open cover with no finite subcover. The complements of the open sets in the cover form a collection of closed subsets of \(X\) with the finite intersection property (since there is no finite subcover), but whose intersection is empty (because the open sets form a cover). The result follows.

When \(X\) is a metric space, there are several more down-to-earth formulations which are often easier to work with.

The following are equivalent, for \(X\) a metric space:

- \(X\) is compact.
- \(X\) is
sequentially compact: every infinite sequence of points in \(X\) has a subsequence which converges to a limit in \(X.\)- \(X\) is
limit point compact: every infinite subset of \(X\) has a limit point in \(X.\)

\( (1) \Rightarrow (2):\) If \(X\) is compact, suppose there is an infinite sequence \(x_n\) of points in \(X\) with no convergent subsequence. Claim: for all \(x\) in \(X,\) there is an open set \(U_x\) containing \(x\) but only finitely many \(x_n.\) Proof of claim: if not, then for some \(x,\) every open set containing \(x\) contains infinitely many \(x_n.\) Let \(x_{n_k}\) be a point in \(B\big(x,\frac1k\big)\) such that \( n_k \) is larger than \( n_1,n_2,\ldots,n_{k-1}.\) Then \( x_{n_k} \to x,\) contradiction.Now the sets \( U_x\) form an open cover of \(X,\) so there must be a finite subcover. But each \(U_x\) contains finitely many points in the sequence, so this would imply that the sequence was finite; contradiction.

\( (2) \Rightarrow (3):\) This is immediate: given an infinite subset \(A,\) take an infinite sequence in that subset, find a convergent subsequence, and then its limit is a limit point for \(A.\)

\( (3) \Rightarrow (1):\) Omitted (but there is a proof here).

## Heine-Borel Theorem

The following theorem gives a characterization of compact subspaces of Euclidean space. It is not quite true for arbitrary metric spaces, but it shows that the definitions of compactness discussed above correspond to our intuition about what compactness should mean in "normal" circumstances.

Let \(Z\) be a subset of \({\mathbb R}^n\) with the standard metric. Then \(Z\) is compact if and only if it is closed and bounded.

First, we show that a compact set is closed and bounded. Boundedness is clear: pick any point \(x \in {\mathbb R}^n \) (e.g. the origin) and consider the open cover of \(Z\) by the balls \(B_k(x)\). If \(Z\) is compact, this has a finite subcover, and since the balls are ordered by inclusion, the largest ball contains all the others, so \( Z \) is completely contained in some ball \( B_N(x),\) and hence it is bounded.To see that compact implies closed, suppose \(Z\) is compact and \(x \notin Z.\) Then any point \(y\) in \(Z\) can be separated from \(x\) by balls \(B_y\) around \(y\) and \( U_y\) around \(x\) such that \( B_y\) and \(U_y\) are disjoint. \(\big(\)If the distance between \(x\) and \(y\) is \(d,\) then balls of radius \(\frac d2\) will suffice.\(\big)\) The balls \(B_y\) form an open cover of \(Z,\) and there is a finite subcover \(B_{y_1},B_{y_2},\ldots,B_{y_k}.\) The intersection of the \( U_{y_k}\) is disjoint from the union of the \(B_{y_k},\) so it is disjoint from \(Z\) since the \(U_{y_k}\) cover \(Z.\) This argument shows that there is a ball around any point in the complement of \(Z\) which is completely contained in the complement of \(Z\); that is, the complement of \(Z\) is open. So \(Z\) is closed.

For the converse, it is convenient to use the following lemma:

A closed subset of a compact set is compact.

Proof of the lemma:Let \(K\) be a closed subset of a compact set \(Z\). Let \( U_{\alpha}\) be a collection of open sets covering \(K,\) and let \( U = Z\setminus K.\) Then \( U_{\alpha}\) plus \( U\) give an open cover of \(Z,\) which has a finite subcover \( U_{\alpha_1}, \ldots, U_{\alpha_k}, U.\) \((\)If \(U\) is not in the finite subcover, it can't hurt to throw it in.\()\) It is clear that \( U_{\alpha_1}, \ldots, U_{\alpha_k}\) cover \(K.\) So \(K\) is compact.Since any bounded set of \( {\mathbb R}^n\) is a subset of \( [-k,k]^n\) for some \(k,\) the lemma implies that it is enough to prove that \( [-k,k]^n\) is compact. By Tychonoff's theorem (see below), it is enough to show that \( [-k,k]\) is compact. So let \( U_{\alpha}\) be an open cover of this closed interval, and define \[ t = \sup\big(\{x\in [a,b] \colon \text{ some finite subcollection of the } U_{\alpha} \text{ covers } [a,x]\}\big). \] Then \( a \le t \le b,\) and the idea is to show that \( t = b.\) This is left as an exercise for the reader, using properties of the supremum. \(_\square\)

## Other Properties of Compact Sets

**Tychonoff's theorem:** A product of compact spaces is compact. For a finite product, the proof is relatively elementary and requires some knowledge of the product topology. For a product of arbitrarily many sets, the axiom of choice is also necessary.

**Extreme value theorem:** A continuous image of a compact set is compact. This is clear from the definitions: given an open cover of the image, pull it back to an open cover of the preimage (the sets in the cover are open by continuity), which has a finite subcover; the corresponding sets in the open cover of the image must give a finite subcover of the image.

As mentioned in the introduction, this is especially useful when the range of the function is \( \mathbb R.\) In this case the extreme value theorem implies that the continuous image of a compact set has a maximum value and a minimum value which are both attained by the values of the function.