2.10 Compactness and Continuity

The reason compactness is worth the trouble is what it does to continuous functions. The three results below are the ones used repeatedly in the rest of the course.

Theorem 2.60. Let \(f:X\rightarrow Y\) be continuous and let \(X\) be compact. Then \(f(X)\) is compact.

Proof. Let \(\xi =\{G_i\}\) be an open cover of \(f(X)\) by sets open in \(Y\). Since \(f\) is continuous each \(f^{-1}(G_i)\) is open in \(X\), and these sets cover \(X\): any \(x\in X\) has \(f(x)\in G_i\) for some \(i\), so \(x\in f^{-1}(G_i)\). By compactness finitely many suffice, \[X = f^{-1}(G_1)\cup \cdots \cup f^{-1}(G_n) .\] Applying \(f\), every point of \(f(X)\) lies in one of \(G_1,\dots ,G_n\), so these finitely many sets cover \(f(X)\). □

Corollary 2.61 (Extreme value theorem). Let \(X\) be a non-empty compact metric space and \(f:X\rightarrow \mathbb {R}\) continuous. Then \(f\) is bounded and attains both its supremum and its infimum: there exist \(p,q\in X\) with \[f(p) = \sup _{x\in X}f(x),\qquad f(q) = \inf _{x\in X}f(x).\]

Proof. By the theorem \(f(X)\) is a compact subset of \(\mathbb {R}\), hence closed and bounded. Bounded and non-empty, it has a finite supremum \(M\); and \(M\) is a limit of points of \(f(X)\), so \(M\in f(X)\) because \(f(X)\) is closed. Thus \(M=f(p)\) for some \(p\in X\). The infimum is identical with the inequalities reversed. □

Remark. This is the theorem behind every argument of the form “choose the point where the function is largest”. On a non-compact domain the point need not exist: \(f(x)=x\) on \((0,1)\) is bounded and attains neither bound, and \(f(x)=x\) on \(\mathbb {R}\) is not even bounded.

Theorem 2.62. Let \(X\) be compact and \(f:X\rightarrow Y\) continuous. Then \(f\) is uniformly continuous: given \(\varepsilon >0\) there is \(\delta >0\), depending on \(\varepsilon \) alone, such that \[d(p,q)<\delta \implies d\big (f(p),f(q)\big )<\varepsilon \qquad \text {for all } p,q\in X .\]

Proof. Let \(\varepsilon >0\). By continuity, each \(x\in X\) has a \(\delta _x>0\) with \[d(x,z)<2\delta _x \implies d\big (f(x),f(z)\big )<\frac {\varepsilon }{2}.\] The balls \(B(x;\delta _x)\) cover \(X\), so by compactness finitely many do, say \(B(x_1;\delta _1),\dots ,B(x_n;\delta _n)\) with \(\delta _i=\delta _{x_i}\). Put \[\delta = \min \{\delta _1,\dots ,\delta _n\}>0 ,\] a number depending only on \(\varepsilon \), since the \(x_i\) were chosen once and for all.

Now suppose \(d(p,q)<\delta \). The point \(p\) lies in some \(B(x_i;\delta _i)\), so \(d(p,x_i)<\delta _i\), and then \[d(q,x_i)\leq d(q,p)+d(p,x_i) < \delta + \delta _i \leq 2\delta _i .\] Both \(p\) and \(q\) are therefore within \(2\delta _i\) of \(x_i\), so \[d\big (f(p),f(q)\big )\leq d\big (f(p),f(x_i)\big )+d\big (f(x_i),f(q)\big ) < \frac {\varepsilon }{2}+\frac {\varepsilon }{2} = \varepsilon .\] □

Note. The whole content of the word uniformly is that \(\delta \) does not depend on the point. Compactness is what converts the pointwise \(\delta _x\) into a single \(\delta \): finitely many numbers have a smallest member, infinitely many need not. That is the entire proof, and it is the pattern of most compactness arguments — a local statement, made global by taking a finite subcover.

Example 2.63. Show that \(\displaystyle {f(x)=\frac 1x}\) is continuous on \((0,1]\) but not uniformly continuous there, and reconcile this with the theorem.

Solution. Continuity at each point is standard. For uniform continuity, take \(\varepsilon =1\) and consider \[p_n = \frac 1n,\qquad q_n = \frac {1}{n+1} .\] Then \(d(p_n,q_n)=\dfrac {1}{n(n+1)}\rightarrow 0\), yet \[\big |f(p_n)-f(q_n)\big | = \big |n-(n+1)\big | = 1\] for every \(n\). So no \(\delta \) can work for \(\varepsilon =1\), and \(f\) is not uniformly continuous.

There is no contradiction: \((0,1]\) is not compact, as shown above. The theorem requires compactness, and this example shows the requirement is not decorative.

Questions on this section

Stuck on something here? Ask below and it stays attached to this topic.