## Continuity and compactness

[From the 4AM Lectures series]

Today, my subject will be $n$-dimensional Euclidean space, so everything I say here applies strictly in this context. Any respectable analysis course will certainly have you acquainted with some elementary point-set topology. We’ll review some important notions. Note that $\| \vec{x} \|$ denotes the norm of $\vec{x}$.

Definitions. For a point $\vec{a} \in \mathbb{R}^n$ we define the open ball of radius $r$ centered at $\vec{a}$ by $B(\vec{a}; r) = \{ \vec{x} \in \mathbb{R}^n \mid \| \vec{x} - \vec{a} \| < r \}$, and the closed ball of radius $r$ centered at $\vec{a}$ by $\bar{B}(\vec{a}; r) = \{ \vec{x} \in \mathbb{R}^n \mid \| \vec{x} - \vec{a} \| \leq r \}$.

More definitions. Let $S \subseteq \mathbb{R}^n$. A point $\vec{a} \in S$ is said to be an interior point of $S$ if there exists $r > 0$ such that the open ball $B(\vec{a}; r)$ is contained within $S$. Now, we call a set $S$ open if every point in $S$ is an interior point. Furthermore, we call a set $S$ closed if the set $\mathbb{R}^n \setminus S$ (that is, the set of all points not in $S$) is open.

Even more definitions. A set $S$ is called bounded if there exists some open ball centered at $\vec{0}$ that contains all of $S$. Finally, a set $S$ is called compact if it is both closed and bounded. (The true notion of topological compactness is much more general, having to do with covering of sets. However, in the special case of $\mathbb{R}^n$, it is shown to be equivalent to the definition I have given here, by a rather significant result called the Heine-Borel Theorem.)

Exercise. Verify that open balls are indeed open sets and closed balls are indeed closed sets.

Now that we’re done with the modest topological groundwork we’ll need, we proceed to define what it means for a function to be continuous. Intuitively you may think of continuous functions as those functions which have no “jumps” in their graphs. However, this notion quickly shows itself insufficient for anything even remotely subtle. Also, the concept of a “jump” in the graph of a multivariable function becomes slightly vague.

Definition. Let $A \subseteq \mathbb{R}^n$ be nonempty, and let $\vec{a} \in A$. We say that a function $f : A \to \mathbb{R}^m$ is continuous at $\vec{a}$ if for every $\epsilon > 0$ there exists some $\delta > 0$ such that whenever $\vec{x} \in A$ and $\| \vec{x} - \vec{a} \| < \delta$, we have $\| f(\vec{x}) - f(\vec{a}) \| < \epsilon$. Note that the first norm is a norm in $\mathbb{R}^n$, whereas the second is a norm in $\mathbb{R}^m$. If $f$ is continuous at every point in $A$ we often say that $f$ is continuous on $A$.

So as it turns out, continuous functions and compact sets are pretty closely related. Related in the sense that something about the way these concepts are defined yields some nice interplay between them. Here are a few theorems.

Theorem. Let $K \subseteq \mathbb{R}^n$ be compact, and let $f : K \to \mathbb{R}^m$ be a continuous function. Then the image set, $f(K)$, is compact.

Or, stated more elegantly, that the continuous image of a compact set is compact.

The importance of this result cannot be overstated. Why? Because a major result known as the Extreme Value Theorem is an immediate corollary. The Extreme Value Theorem says that any map  $f : A \to \mathbb{R}$ attains its maximum and minimum value on $A$, given that $A$ is compact! But if $A$ is compact, then by the theorem above, $f(A) \subseteq \mathbb{R}$ is compact, and certainly any compact subset of the real line contains its supremum and infimum! And hence by taking the preimages of the L.U.B. and G.L.B. we see the EVT falls out in this manner. Now we move on to another concept, namely that of uniform continuity. Take care in noting the difference between uniform continuity and continuity, which may at first seem subtle.

Definition. Let $A \subseteq \mathbb{R}^n$ be nonempty, and let $\vec{a} \in A$. We say that a function $f : A \to \mathbb{R}^m$ is uniformly continuous on $A$ if for every $\epsilon > 0$ there exists some $\delta > 0$ such that whenever $\vec{x}, \vec{a} \in A$ with $\| \vec{x} - \vec{a} \| < \delta$, we obtain $\| f(\vec{x}) - f(\vec{a}) \| < \epsilon$.

If a function is uniformly continuous on a set, it is continuous at every point in that set. This is trivial to verify. We will now present something that is not so trivial to verify. But first, we should remark the following:

Proposition. If $A \subseteq \mathbb{R}^n$ is nonempty, and $f : A \to \mathbb{R}^m$ is continuous, then whenever $(\vec{x}_k)_{k=1}^\infty$ is a sequence in $A$ converging to some limit $\vec{x} \in A$, we have that the sequence $(f(\vec{x}_k))_{k=1}^\infty$ converges to $f(\vec{x}) \in f(A)$.

More elegantly put, this simply says that for a continuous function, the limit of the images is the image of the limit. This is not hard to prove. Now we can comfortably prove our theorem:

Theorem. Let $K \subseteq \mathbb{R}^n$ be a compact set, and let $f : K \to \mathbb{R}^m$ be continuous on $K$. Then $f$ is uniformly continuous on $K$.
Proof. Note that if $f$ is not uniformly continuous, there exists some $\epsilon > 0$ such that no $\delta > 0$ exists satisfying the definition. Fix $\epsilon > 0$, and assume, for the sake of contradiction, that indeed no such $\delta$ exists. For each natural number $k$, put $\delta_k = \frac{1}{k}$. Then our assumption furnishes points $\vec{x}_k, \vec{a}_k \in K$ such that $\| \vec{x}_k - \vec{a}_k \| < \delta_k$, but $\| f(\vec{x}_k) - f(\vec{a}_k) \| \geq \epsilon$. We construct sequences $(\vec{x}_k)_{k=1}^\infty$ and $(\vec{a}_k)_{k=1}^\infty$ from these points. Since $K$ is compact, every sequence in $K$ has a subsequence that converges to a point that is again in $K$, say $(\vec{x}_{k(p)})_{p=1}^\infty$, with $\vec{x}_{k(p)} \to \vec{x}_0$, where $\vec{x}_0 \in K$. We claim that $\vec{a}_{k(p)} \to \vec{x}_0$ also. To see this, note that by the triangle inequality, $0 \leq \| \vec{a}_{k(p)} - \vec{x}_0 \| \leq \| \vec{a}_{k(p)} - \vec{x}_{k(p)} \| + \| \vec{x}_{k(p)} - \vec{x}_0 \| < \frac{1}{k(p)} + \| \vec{x}_{k(p)} - \vec{x}_0 \|$.
But the rightmost expression here certainly converges to 0 as we let $p \to \infty$, and hence by the squeeze theorem, we obtain $\vec{a}_{k(p)} \to \vec{x}_0$ as previously claimed. Now, since the function $f$ is continuous on $K$, it respects sequences converging to points within $K$. Hence, the fact that $\vec{x}_{k(p)} \to \vec{x}_0$ implies that $f(\vec{x}_{k(p)}) \to f(\vec{x}_0)$ and similarly we obtain that $f(\vec{a}_{k(p)}) \to f(\vec{x}_0)$. Then certainly as $p \to \infty$ we obtain that $\| f(\vec{x}_{k(p)}) - f(\vec{a}_{k(p)}) \| \to 0$. But this is a contradiction, since we have for each natural $k$ that $\| f(\vec{x}_k) - f(\vec{a}_k) \| \geq \epsilon$! Hence our assumption that $f$ was not uniformly continuous must have been false. Therefore, $f$ is uniformly continuous on $K$ as required.

Note that the whole mechanics of the above proof rely on two key parts: firstly, the compactness of the domain allows us to invoke the Bolzano-Weierstrass theorem, and select a subsequence that converges within $K$. Secondly, the continuity of $f$ implies that the limit of the images is the image of the limit, which is where our contradiction comes from!

For more, see my MATH 247 notes.