Tutorials › Real Analysis › Compactness in Finite Dimensions

Function Spaces · Tutorial 626 of 1000

Compactness in Finite Dimensions

Use finite-dimensional compactness to recognize compact sets through subsequences and to control continuous functions.

Advanced 10 min read

What You'll Learn

  • State compactness using open covers in the norm topology.
  • Characterize compact subsets of finite-dimensional normed spaces by convergent subsequences.
  • Apply the finite-dimensional Heine–Borel property without reproving it.
  • Prove that continuous real-valued functions on nonempty compact sets attain their extrema.
  • Explain why continuous functions on compact finite-dimensional sets are uniformly continuous.

Compactness Beyond Completeness

The previous tutorial showed that every finite-dimensional normed space is complete: each Cauchy sequence converges to a vector in the space. Compactness gives a stronger kind of control on subsets. Rather than asking whether a sequence whose terms become close has a limit, compactness ensures that every sequence in the set has a convergent subsequence whose limit remains in the set.

Throughout, let \(V\) be a finite-dimensional real normed vector space with norm \(N\). An open set in \(V\) means an open set for the metric \(d(x,y)=N(x-y)\). Compactness is defined by open covers, but in finite dimensions it can be recognized by sequences. This makes compactness practical in problems about limits and continuous functions.

Definition: A set \(K\subseteq V\) is compact if every collection of open sets whose union contains \(K\) has a finite subcollection whose union still contains \(K\). Such a collection is called an open cover of \(K\).

The empty set is compact, since the empty subcollection covers it. The results about maxima and minima below will assume \(K\) is nonempty. For nonempty sets, the finite-dimensional Heine–Borel Property established in the tutorial Finite-Dimensional Normed Spaces says that a set is compact if and only if it is closed and bounded. We will use that theorem, not re-prove it. The new criterion below replaces the open-cover definition with a condition on sequences.

A Sequential Test for Compactness

Theorem (Sequential Characterization of Compactness in Finite Dimensions): Let \(K\subseteq V\). Then \(K\) is compact if and only if every sequence in \(K\) has a subsequence that converges to a point of \(K\).

Proof. First suppose \(K\) is compact, and let \((x_n)\) be a sequence in \(K\). We will find a point \(x\in K\) such that every open neighborhood of \(x\), relative to \(K\), contains \(x_n\) for infinitely many indices \(n\). If such a point exists, we can choose indices \(n_1<n_2<\cdots\) so that \(N(x_{n_j}-x)<1/j\). Then \(x_{n_j}\to x\), as required.

Suppose, to the contrary, that no such point exists. For every \(x\in K\), there is then a relative open neighborhood \(U_x\) of \(x\) that contains \(x_n\) for only finitely many indices. The sets \(U_x\), as \(x\) ranges over \(K\), cover \(K\). Compactness gives a finite subcover \(U_{x_1},\ldots,U_{x_m}\). Each of these sets contains terms with only finitely many indices, so their finite union contains terms with only finitely many indices. But the union covers \(K\), and every \(x_n\) lies in \(K\). It must therefore contain \(x_n\) for every index \(n\), a contradiction. This proves that the desired subsequence exists.

Now suppose every sequence in \(K\) has a subsequence converging to a point of \(K\). We show that \(K\) is closed and bounded in \(V\), then apply the finite-dimensional Heine–Borel Property.

To see that \(K\) is bounded, suppose it were unbounded. For each positive integer \(n\), choose \(x_n\in K\) with \(N(x_n)>n\). By hypothesis, some subsequence \(x_{n_j}\) converges to a point of \(K\). A convergent sequence is bounded, but \(N(x_{n_j})>n_j\) and \(n_j\to\infty\), which is impossible. Hence \(K\) is bounded.

To see that \(K\) is closed, let \(x\) belong to the closure of \(K\). For each \(n\geq1\), choose \(x_n\in K\) such that \(N(x_n-x)<1/n\). Then \(x_n\to x\). The hypothesis gives a subsequence \(x_{n_j}\) converging to some \(y\in K\). Since that subsequence also converges to \(x\), uniqueness of norm limits gives \(x=y\). Thus \(x\in K\), so \(K\) is closed. The Heine–Borel Property now shows that \(K\) is compact. \(\square\)

This argument also explains why the limit must be required to lie in \(K\). A subsequence may converge in the ambient space without its limit belonging to the set. Closedness prevents that failure. In the other direction, compactness rules out sequences that escape without any subsequence settling near a point of the set.

Worked Example: A Box Is Compact in Any Norm on \(\mathbb{R}^3\)

Let \(N\) be any norm on \(\mathbb{R}^3\), and consider

$$ K=\{(a,b,c)\in\mathbb{R}^3:-1\leq a\leq1,\ 0\leq b\leq2,\ -2\leq c\leq0\}. $$

The set is closed in the coordinate Euclidean norm: each coordinate interval is closed, so a coordinatewise limit of points in \(K\) still satisfies all six inequalities. It is also bounded in the coordinate Euclidean norm, since for every \((a,b,c)\in K\),

$$ |(a,b,c)|_2 =\sqrt{a^2+b^2+c^2} \leq\sqrt{1+4+4}=3. $$

The Equivalence of Norms in Finite Dimensions theorem gives a constant \(C>0\) such that \(N(v)\leq C|v|_2\) for every \(v\in\mathbb{R}^3\). Therefore \(N(a,b,c)\leq3C\) on \(K\), so \(K\) is bounded in \(N\) as well. Equivalent norms give the same open sets, and hence \(K\) is closed in \(N\). The finite-dimensional Heine–Borel Property now shows that \(K\) is compact for \(N\). In particular, every sequence of points in this box has a subsequence converging to a point in the box.

Worked Example: Two Different Subsequence Limits on a Compact Curve

Consider the curve

$$ K=\{(t,t^2):-1\leq t\leq1\}\subseteq\mathbb{R}^2. $$

It is closed and bounded, so it is compact. For \(n\geq1\), set \(t_n=(-1)^n(1-1/n)\) and \(x_n=(t_n,t_n^2)\). Since \(0\leq1-1/n<1\), every \(t_n\) lies in \([-1,1]\), and consequently \(x_n\in K\).

For even indices \(n=2j\), we have \(t_{2j}=1-1/(2j)\to1\), and thus

$$ x_{2j}=\left(1-\frac{1}{2j},\left(1-\frac{1}{2j}\right)^2\right)\longrightarrow(1,1). $$

For odd indices \(n=2j-1\), we have \(t_{2j-1}=-(1-1/(2j-1))\to-1\), while \(t_{2j-1}^2\to1\). Therefore \(x_{2j-1}\to(-1,1)\). Both limits belong to \(K\). The sequence itself does not converge, but it has convergent subsequences, precisely as the sequential characterization predicts. Compactness guarantees at least one such subsequence; it does not require the whole sequence to converge or make the subsequential limit unique.

Continuous Functions Attain Their Extreme Values

The sequential characterization turns compactness into a useful tool for optimizing continuous functions. In one real variable, the Extreme-Value Theorem applies to compact subsets of \(\mathbb{R}\). The same conclusion holds when the domain is a compact subset of any finite-dimensional normed space.

Theorem (Extreme-Value Theorem on a Finite-Dimensional Compact Set): Let \(K\subseteq V\) be nonempty and compact, and let \(f:K\to\mathbb{R}\) be continuous. Then \(f\) is bounded on \(K\), and there exist \(x_{\min},x_{\max}\in K\) such that \(f(x_{\min})\leq f(x)\leq f(x_{\max})\) for every \(x\in K\).

Proof. First we prove that \(f\) is bounded. If it were unbounded, we could choose a sequence \((x_n)\) in \(K\) such that \(|f(x_n)|>n\). By the sequential characterization, some subsequence \(x_{n_j}\) converges to a point \(x\in K\). Continuity implies \(f(x_{n_j})\to f(x)\), so the real sequence \((f(x_{n_j}))\) is bounded. This contradicts \(|f(x_{n_j})|>n_j\to\infty\). Thus \(f(K)\) is bounded.

Let \(M=\sup f(K)\), which exists as a finite real number because \(f(K)\) is nonempty and bounded. For each \(n\geq1\), the definition of supremum gives \(x_n\in K\) such that \(M-1/n<f(x_n)\leq M\). Choose a subsequence \(x_{n_j}\) converging to \(x_{\max}\in K\). By continuity, \(f(x_{n_j})\to f(x_{\max})\). The inequalities

$$ M-\frac{1}{n_j}<f(x_{n_j})\leq M $$

then imply \(f(x_{\max})=M\). Applying the same argument to the continuous function \(-f\) shows that \(-f\) attains its maximum on \(K\), so \(f\) attains its minimum there. This proves the result. \(\square\)

Worked Example: Maximizing a Linear Function on a Disk

Let \(K=\{(x,y)\in\mathbb{R}^2:x^2+y^2\leq4\}\), which is closed and bounded and therefore compact. Consider the continuous function \(f(x,y)=x+2y\). For every \((x,y)\in K\),

$$ 5(x^2+y^2)-(x+2y)^2=(2x-y)^2\geq0. $$

It follows that

$$ |f(x,y)|^2\leq5(x^2+y^2)\leq20, \qquad\text{so}\qquad |f(x,y)|\leq2\sqrt5. $$

At the point \((2/\sqrt5,4/\sqrt5)\), the disk condition holds because

$$ \left(\frac{2}{\sqrt5}\right)^2+\left(\frac{4}{\sqrt5}\right)^2 =\frac45+\frac{16}{5}=4, $$

and \(f(2/\sqrt5,4/\sqrt5)=2\sqrt5\). Thus the maximum is \(2\sqrt5\). At \((-2/\sqrt5,-4/\sqrt5)\), the disk condition is again an equality and \(f=-2\sqrt5\), so the minimum is \(-2\sqrt5\). The example exhibits both the existence guarantee and the actual points where the extrema occur.

Uniform Continuity and a Common Pitfall

Compactness provides more than boundedness and attainment of extrema. A continuous function on a compact subset of a finite-dimensional normed space is uniformly continuous, even when that subset is not an interval. The proof again uses subsequences.

Theorem (Heine–Cantor Theorem in Finite Dimensions): Let \(K\subseteq V\) be compact, and let \(f:K\to\mathbb{R}\) be continuous. Then \(f\) is uniformly continuous on \(K\).

Proof. Suppose \(f\) were not uniformly continuous. Then there would be an \(\varepsilon_0>0\) such that, for every \(n\geq1\), there are \(x_n,y_n\in K\) satisfying

$$ N(x_n-y_n)<\frac1n \qquad\text{and}\qquad |f(x_n)-f(y_n)|\geq\varepsilon_0. $$

The sequential characterization gives a subsequence \(x_{n_j}\) converging to some \(x\in K\). The triangle inequality yields

$$ N(y_{n_j}-x) \leq N(y_{n_j}-x_{n_j})+N(x_{n_j}-x) <\frac1{n_j}+N(x_{n_j}-x)\longrightarrow0. $$

Thus \(y_{n_j}\to x\) as well. Continuity at \(x\) implies \(f(x_{n_j})\to f(x)\) and \(f(y_{n_j})\to f(x)\). Hence \(|f(x_{n_j})-f(y_{n_j})|\to0\), contradicting the lower bound \(\varepsilon_0\). Therefore \(f\) is uniformly continuous. \(\square\)

A common pitfall is to confuse completeness with compactness. Completeness says that Cauchy sequences converge; it does not say that every bounded sequence has a convergent subsequence. The previous tutorial established completeness of the whole finite-dimensional space. Here, compactness of a subset gives the stronger subsequence property for every sequence in that subset. In finite dimensions, closedness and boundedness identify exactly which subsets have this stronger property, by the Heine–Borel Property.

Takeaway: In a finite-dimensional normed space, compactness is equivalent to the property that every sequence in the set has a subsequence converging to a point in the set. This sequential viewpoint gives concise proofs that continuous functions on nonempty compact sets are bounded, attain their extrema, and are uniformly continuous.

Check Your Understanding

Use the sequential characterization and the results about continuous functions to answer the following questions.

  1. In the compactness-to-sequence direction, why would a finite subcover contradict the assumption that every sequence term lies in the compact set?
  2. How does a sequence with \(N(x_n)>n\) show that a set satisfying the sequential criterion must be bounded?
  3. Why must the limit of the convergent subsequence in the criterion belong to the set?
  4. Where does the finite-dimensional Heine–Borel Property enter the proof of the sequential characterization?
  5. How does a sequence of function values approaching the supremum help prove that a continuous function attains its maximum?
  6. In the proof of uniform continuity, why does \(N(x_n-y_n)\to0\) ensure that a convergent subsequence of \((x_n)\) makes the matching subsequence of \((y_n)\) converge to the same point?