# Prove the Uniform Continuity on Compact Sets

compactnesscontinuityreal numbersreal-analysisuniform-continuity

The proof is from Stephen Abbott's Understanding Analysis, Second Edition.

Theorem: A function that is continuous on a compact set $$K$$ is uniformly continuous on K.

Proof: Assume $$f:K\to\Bbb{R}$$ is continuous at every point of a compact set $$K\subseteq\Bbb{R}$$. To prove that $$f$$ is uniformly continuous on $$K$$ we argue by contradiction.

By the Sequential Criterion for Absence of Uniform Continuity (A function $$f:A\to\Bbb{R}$$ fails to be uniformly continuous on $$A$$ if and only if there exists a particular $$\epsilon_0\gt0$$ and two sequences $$(x_n)$$ and $$(y_n)$$ in $$A$$ satisfying $$\vert x_n-y_n\vert\to0$$ but $$\vert f(x_n)-f(y_n)\vert\geq\epsilon_0$$), if $$f$$ is not uniformly continuous, then there exist two sequence $$(x_n)$$ and $$(y_n)$$ in $$K$$ such that $$\lim\vert x_n-y_n\vert=0$$ while $$\vert f(x_n)-f(y_n)\vert\ge\epsilon_0$$ for some particular $$\epsilon_0\gt0$$. Because $$K$$ is compact, then sequence $$(x_n)$$ has a convergent subsequence $$(x_{n_k})$$ with $$x=\lim x_{n_k}$$ also in $$K$$.

We could use the compactness of $$K$$ again to produce a convergent subsequence of $$(y_n)$$, but notice what happens when we consider the particular subsequence $$(y_{n_k})$$ consisting of those terms in $$(y_n)$$ that correspond to the terms in the convergent subsequence $$(x_{n_k})$$. By the Algebraic Limit Theorem, $$\lim(y_{n_k})=\lim((y_{n_k}-x_{n_k})+x_{n_k})=0+x$$. The conclusion is that both $$x_{n_k}$$ and $$(y_{n_k})$$ converge to $$x\in K$$. Because f is assumed to be continuous at $$x$$, we have $$\lim f(x_{n_k})=f(x)$$ and $$lim f(y_{n_k})=f(x)$$. A contradiction arises when we recall that $$x_n$$ and $$y_n$$ were chosen to satify $$\vert f(x_n)-f(y_n)\vert\geq\epsilon_0$$ for all $$n\in\Bbb{N}$$.

Indeed, if by "consider the particular subsequence $$(y_{n_k})$$ consisting of those terms in $$(y_n)$$ that correspond to the terms in the convergent subsequence $$(x_{n_k})$$", the author were referring to a subsequence within the subsequence $$y_{n_k}$$ such that each $$n_k$$ in $$y_{n_k}$$ is equal to the $$n_k$$ in $$(x_{n_k})$$, then the proof clearly follows; but there is no guarantee that such a subsequence within $$(y_{n_k})$$ exists.

Here is the contradiction: $$\epsilon_0\le |f(x_{n_k}) - f(y_{n_k})|\le |f(x_{n_k}) - f(x)| + |f(x)-f(y_{n_k})|\,\to\,0$$ as $$k\to\infty$$.
"the author were referring to a subsequence within the subsequence $$y_{n_k}$$"
They never did, actually. They choose a convergent subsequence $$x_{n_k}\to x$$ and then conclude that also $$y_{n_k}\to x$$.