2.6 Uniform Continuity

Definition 2.6.1. A function \(f\) defined on an interval \(I\subseteq \mathbb {R}\) is said to be uniformly continuous on \(I\) if for each \(\varepsilon > 0\) there exists \(\delta > 0\) such that \(|f(x) - f(y)| < \varepsilon \) whenever \(x, y\in I\) and \(|x - y| < \delta \).

Note. Here \(\delta \) depends only on \(\varepsilon \), not on the point: one \(\delta \) serves throughout \(I\). In ordinary continuity \(\delta \) may also depend on the point.

Example 2.6.2. The function \(f(x) = x^2\) is uniformly continuous on \([-1,1]\). For \(x, y\in [-1,1]\) we have \(|x+y|\leq 2\), so \[|f(x) - f(y)| = |x^2 - y^2|= |x - y|\,|x + y|\leq 2|x - y| .\] Given \(\varepsilon > 0\), take \(\delta = \frac {\varepsilon }{2}\). Then \(|f(x) - f(y)| < \varepsilon \) whenever \(|x - y| < \delta \).

Example 2.6.3. The function \(f(x) = \sin x\) is uniformly continuous on \((0,\infty )\). For any \(x,y\), \begin {align*} |\sin x - \sin y| & = 2\left |\sin \frac {x - y}{2}\right |\left |\cos \frac {x + y}{2}\right |\\ & \leq 2\left |\sin \frac {x - y}{2}\right | \leq |x - y|, \end {align*}

using \(|\cos t|\leq 1\) and \(|\sin t|\leq |t|\). Given \(\varepsilon > 0\), take \(\delta = \varepsilon \).

Definition 2.6.4 (Non-Uniform Continuity Criterion). A function \(f\) defined on an interval \(I\subseteq \mathbb {R}\) is not uniformly continuous on \(I\) if and only if there exists an \(\varepsilon > 0\) such that for every \(\delta > 0\) there are points \(x, y\in I\) (depending on \(\delta \)) with \(|x - y| < \delta \) and \(|f(x) - f(y)|\geq \varepsilon \).

Example 2.6.5. The function \(f(x) = \sin \left (\frac {1}{x}\right )\) is not uniformly continuous on \((0,\infty )\). Let \(\delta > 0\). By the Archimedean property there exists \(N\in \mathbb {N}\) with \(\frac {1}{N} < \delta \). Put \(x = \frac {1}{N\pi }\) and \(y = \frac {2}{(2N + 1) \pi }\). Then \[|x - y| = \frac {1}{N(2N + 1)\pi }<\frac {1}{N} < \delta ,\] but \(|f(x) - f(y)| = \left |\sin (N\pi ) - \sin \frac {(2N + 1)\pi }{2}\right | = 1\). So the criterion holds with \(\varepsilon = 1\).

Theorem 2.6.6. A uniformly continuous function on an interval \(I\subseteq \mathbb {R}\) is continuous on \(I\).

Proof. Let \(f\) be uniformly continuous on \(I\), let \(p\in I\) and \(\varepsilon >0\). Choose \(\delta >0\) as in the definition of uniform continuity. Taking \(y = p\) there, \(|f(x) - f(p)|<\varepsilon \) whenever \(x\in I\) and \(|x-p|<\delta \). So \(f\) is continuous at \(p\).

A continuous function need not be uniformly continuous. For example, \(f(x) = x^2\) is continuous on \(\mathbb {R}\) but not uniformly continuous. Given \(\delta > 0\), choose \(N\in \mathbb {N}\) with \(\frac {1}{N}<\delta \) and put \(x = N\), \(y = N + \frac {1}{N}\). Then \(|x - y| = \frac {1}{N} < \delta \), but \[|f(x) - f(y)| = \left (N + \frac {1}{N}\right )^2 - N^2 = 2 + \frac {1}{N^2}> 2 ,\] so the criterion holds with \(\varepsilon = 2\). □

Theorem 2.6.7. Every function that is continuous on a bounded closed interval \([a,b]\) is uniformly continuous on \([a,b]\).

Proof. Suppose \(f\) is continuous on \([a,b]\) but not uniformly continuous. By the criterion there is an \(\varepsilon _0 > 0\) such that for each \(\delta = \frac {1}{n}\), \(n\in \mathbb {N}\), there are points \(x_n, y_n\in [a,b]\) with \begin {equation} \label {eq:ucneg} |x_n - y_n| < \frac {1}{n} \qquad \text {and}\qquad |f(x_n) - f(y_n)|\geq \varepsilon _0 . \end {equation} The sequence \(\{x_n\}\) is bounded, so by the Bolzano–Weierstrass theorem it has a convergent subsequence \(\{x_{n_k}\}\), with limit \(x\in [a,b]\) (as \([a,b]\) is closed). By (2.9), \begin {equation} \label {eq:ucsub} |x_{n_k} - y_{n_k}| < \frac {1}{n_k} \qquad \text {and}\qquad |f(x_{n_k})- f(y_{n_k})|\geq \varepsilon _0 . \end {equation} Since \(|y_{n_k} - x| \leq |y_{n_k} - x_{n_k}| + |x_{n_k} - x| < \frac {1}{n_k} + |x_{n_k} - x|\longrightarrow 0\), also \(y_{n_k}\longrightarrow x\). As \(f\) is continuous at \(x\), both \(f(x_{n_k})\) and \(f(y_{n_k})\) converge to \(f(x)\), so \(f(x_{n_k}) - f(y_{n_k})\longrightarrow 0\). This contradicts the second inequality in (2.10). Hence \(f\) is uniformly continuous. □

Theorem 2.6.8. A function \(f\) defined on a bounded closed interval \([a,b]\) is uniformly continuous if and only if \(f\) is continuous on \([a,b]\).

Proof. A uniformly continuous function is continuous, as shown above, and a continuous function on \([a,b]\) is uniformly continuous by the previous theorem. □

Remark. The hypothesis that the interval is closed and bounded is essential, and it is where the Bolzano–Weierstrass theorem enters. On \((0,1)\) the function \(f(x)=\frac {1}{x}\) is continuous but not uniformly continuous: the sequences in the proof can escape to the end point \(0\), which the interval does not contain.

Theorem 2.6.9. If \(f\) is uniformly continuous on an interval \(I\subseteq \mathbb {R}\) and \(\{x_n\}\) is a Cauchy sequence in \(I\), then \(\{f(x_n)\}\) is also a Cauchy sequence.

Proof. Let \(\varepsilon > 0\). Since \(f\) is uniformly continuous on \(I\), there exists \(\delta > 0\) such that \(|f(x) - f(y)| < \varepsilon \) whenever \(x, y\in I\) and \(|x - y| < \delta \). Since \(\{x_n\}\) is a Cauchy sequence, there exists \(N\in \mathbb {N}\) such that \(|x_n - x_m| < \delta \) for all \(m, n > N\). Hence \(|f(x_n) - f(x_m)| < \varepsilon \) for all \(m, n> N\), and \(\{f(x_n)\}\) is a Cauchy sequence.

The theorem fails for functions that are merely continuous. For example, \(f(x) = \frac {1}{x}\) is continuous on \((0,1]\), and \(x_n = \frac {1}{n}\) is a Cauchy sequence in \((0,1]\), but \(f(x_n) = n\) is not a Cauchy sequence. □

Definition 2.6.10 (Lipschitz Function). Let \(A\subseteq \mathbb {R}\) and \(f: A\longrightarrow \mathbb {R}\). If there exists a constant \(K>0\) such that \(|f(x) - f(y)|\leq K |x - y|\) for all \(x, y\in A\), then \(f\) is said to be a Lipschitz function, with Lipschitz constant \(K\).

Theorem 2.6.11. A Lipschitz function \(f: A\longrightarrow \mathbb {R}\) is uniformly continuous on \(A\).

Proof. Let \(K\) be a Lipschitz constant for \(f\). Given \(\varepsilon >0\), put \(\delta = \frac {\varepsilon }{K}\). Then \(|x-y|<\delta \) gives \[|f(x)-f(y)| \leq K|x-y| < K\cdot \frac {\varepsilon }{K} = \varepsilon .\] Since \(\delta \) depends on \(\varepsilon \) alone, \(f\) is uniformly continuous. □

Note. Being Lipschitz is strictly stronger than uniform continuity: it means that \(\delta \) may be taken proportional to \(\varepsilon \). The next example shows that the converse of the theorem fails.

Example 2.6.12. Let \(g(x) = \sqrt {x}\) on \(I=[0,2]\). Then \(g\) is continuous on the closed bounded interval \(I\), and hence uniformly continuous there. But \(g\) is not a Lipschitz function. If it were, then taking \(y = 0\) we would have \(\sqrt {x}\leq K x\) for some \(K>0\) and all \(x\in I\), that is, \(K\geq \frac {1}{\sqrt {x}}\) for all \(x\in (0,2]\). This is impossible, since \(\frac {1}{\sqrt {x}}\longrightarrow \infty \) as \(x\longrightarrow 0^+\).

Theorem 2.6.13. If \(f\) is continuous on a compact set \(K\subseteq \mathbb {R}\), then \(f\) is uniformly continuous on \(K\).

Proof. Let \(\varepsilon >0\). For each \(x\in K\) there exists \(\delta _x > 0\) such that \(|f(y) - f(x)| < \frac {\varepsilon }{2}\) whenever \(y\in K\) and \(|y - x| < \delta _x\). The open intervals \[I(x) = \left (x - \tfrac {1}{2}\delta _x,\; x + \tfrac {1}{2}\delta _x\right ), \qquad x\in K,\] form an open covering of the compact set \(K\), so there are finitely many points \(x_1, x_2, \dots , x_n\) in \(K\) with \(K\subseteq I(x_1) \cup \dots \cup I(x_n)\). Let \[\delta = \min \left \{\tfrac {1}{2}\delta _{x_1}, \dots , \tfrac {1}{2}\delta _{x_n}\right \}>0 .\] Suppose \(x, y\in K\) and \(|x - y| < \delta \). Then \(x\in I(x_p)\) for some \(p\), so \(|x - x_p|<\frac {1}{2}\delta _{x_p}\), and \[|y - x_p| \leq |y - x| + |x - x_p| < \delta + \tfrac {1}{2}\delta _{x_p} \leq \delta _{x_p} .\] Hence \(|f(y) - f(x)|\leq |f(y) - f(x_p)| + |f(x_p) - f(x)| < \frac {\varepsilon }{2}+\frac {\varepsilon }{2} = \varepsilon \), which proves that \(f\) is uniformly continuous on \(K\). □

Example 2.6.14. Show that \(f(x) = \frac {1}{x}\) is uniformly continuous on \([a,\infty )\) for each \(a>0\), but not on \((0,\infty )\).

Solution. For \(x,y\geq a\), \[\left |\frac {1}{x} - \frac {1}{y}\right | = \frac {|x-y|}{xy}\leq \frac {|x-y|}{a^2},\] so \(f\) is Lipschitz with constant \(\frac {1}{a^2}\), and \(\delta = a^2\varepsilon \) works.

On \((0,\infty )\) take \(x_n = \frac {1}{n}\) and \(y_n = \frac {1}{n+1}\). Then \(|x_n - y_n| = \frac {1}{n(n+1)}\longrightarrow 0\) but \(|f(x_n) - f(y_n)| = 1\) for every \(n\). By the Non-Uniform Continuity Criterion with \(\varepsilon = 1\), \(f\) is not uniformly continuous on \((0,\infty )\).

Example 2.6.15. Show that \(f(x) = \sqrt {x}\) is uniformly continuous on \([0,\infty )\), although it is not Lipschitz.

Solution. For \(0\leq y\leq x\) we have \(\sqrt {x} - \sqrt {y}\leq \sqrt {x-y}\), because squaring gives \(x - 2\sqrt {xy} + y\leq x - y\), that is, \(y\leq \sqrt {xy}\), which is true. Hence \(|\sqrt {x}-\sqrt {y}|\leq \sqrt {|x-y|}\) for all \(x,y\geq 0\), and \(\delta = \varepsilon ^2\) works for every point at once. (It is not Lipschitz, by the example earlier in this section.)

Example 2.6.16. For \(f(x) = x^2\) on \([0,R]\), find a \(\delta \) that works for \(\varepsilon \) uniformly, and explain why no \(\delta \) works on \([0,\infty )\).

Solution. For \(x,y\in [0,R]\), \(|x^2-y^2| = |x+y|\,|x-y|\leq 2R|x-y|\), so \(\delta = \frac {\varepsilon }{2R}\) works. This \(\delta \) tends to \(0\) as \(R\longrightarrow \infty \), and indeed on \([0,\infty )\) there is no \(\delta \): for any \(\delta >0\), the points \(x\) and \(x+\frac {\delta }{2}\) satisfy \(\left |(x+\frac {\delta }{2})^2 - x^2\right | = \delta x + \frac {\delta ^2}{4}\), which exceeds \(1\) for large \(x\).

Questions on this section

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