Continuous vs. uniformly continuous
Continuity says that small changes in input cause small changes in output, and uniform continuity asks for this at the same scale everywhere. A continuous function may need a smaller $\delta$ at some points than at others. A uniformly continuous function has one $\delta$ that works everywhere.
uniformly continuous ⊂ continuous
Definitions
Think of a function $y = f(x)$. The graph of $f(x)$ is a plot that shows the value of $y$ for each values of $x$ by plotting the value of $x$ on a horizontal axis and the value $y = f(x)$ on the vertical axis. The function is continuous if you can draw its graph without lifting your pencil.
Consider a function $f$. The function $f$ is continuous if
\[\lim_{x \to a} f(x) = f(a)\]for every $a$ in the domain of $f$.
Consider a function $f : X \to Y$ between metric spaces. The function $f$ is continuous if for every $x \in X$ and every $\varepsilon > 0$, there exists $\delta > 0$ such that
\[d(f(x), f(y)) < \varepsilon \quad \text{for every } y \in X \text{ with } d(x, y) < \delta.\]The choice of $\delta$ may depend on both $\varepsilon$ and $x$.
Examples
-
$f(x) = x^2$ on $\reals$
$x \mapsto x^2$ is continuous.
-
$x \mapsto e^x$ on $\reals$
$x \mapsto e^x$ is continuous.
- $x \mapsto \sin(x)$ on $\reals$
- $x \mapsto \sqrt{x}$ on $[0, \infty)$
-
$x \mapsto \tan(x)$ on $(-\pi/2, \pi/2)$
$\tan$ is continuous on $(-\pi/2, \pi/2)$.
-
$x \mapsto x^2$ on $[0, 1]$
$x \mapsto x^2$ on $[0, 1]$ is continuous.
- $f(x) = x^2 \sin(1/x)$ for $x \neq 0$, $f(0) = 0$, on $[-1, 1]$
-
The Cantor function on $[0, 1]$
The Cantor function is continuous, and uniformly continuous because $[0, 1]$ is compact.
- $x \mapsto \sin(1/x)$ on $(0, 1]$
-
$x \mapsto \sin(1/x)$ on $(0, \infty)$
$x \mapsto \sin(1/x)$ is continuous on $(0, \infty)$.
-
$x \mapsto \sqrt{x}$ on $[0, 1]$
$x \mapsto \sqrt{x}$ on $[0, 1]$ is absolutely continuous because it is the integral of its derivative, so it is also uniformly continuous and continuous.
-
$x \mapsto x^3$, from $\reals$ to $\reals$
$x \mapsto x^3$ is a homeomorphism of $\reals$: it is continuous, with the continuous inverse $x \mapsto \sqrt[3]{x}$. So it maps open sets to open sets and closed sets to closed sets.
Non-examples
-
$f(x) = \frac{\sin x}{x}$, at $x = 0$
The function is not continuous at $x = 0$ because $f(0)$ is undefined, so $x = 0$ is not in the domain of $f$.
- The step function: $0$ for $x < 0$ and $1$ for $x \geq 0$
A function $f : \reals \to \reals$ is uniformly continuous if for every $\varepsilon > 0$, there exists $\delta > 0$ such that
\[\abs{f(x) - f(y)} < \varepsilon \quad \text{for all } \abs{x - y} < \delta.\]The choice of $\delta$ depends only on $\varepsilon$, so the same $\delta$ works at every point.
Consider a function $f : X \to Y$ between metric spaces. The function $f$ is uniformly continuous if for every $\varepsilon > 0$, there exists $\delta > 0$ such that
\[d(f(x), f(y)) < \varepsilon \quad \text{for all } x, y \in X \text{ with } d(x, y) < \delta.\]The choice of $\delta$ depends only on $\varepsilon$, so the same $\delta$ works at every point.
Examples
-
$x \mapsto \sin(x)$ on $\reals$
$\sin$ is uniformly continuous, and so continuous, because $\abs{\sin(x) - \sin(y)} \leq \abs{x - y}$, so the choice $\delta = \varepsilon$ works everywhere.
-
$x \mapsto \sqrt{x}$ on $[0, \infty)$
$x \mapsto \sqrt{x}$ is uniformly continuous, and so continuous, because $\abs{\sqrt{x} - \sqrt{y}} \leq \sqrt{\abs{x - y}}$, so the choice $\delta = \varepsilon^2$ works everywhere.
-
$x \mapsto \abs{x}$ on $[-1, 1]$
$x \mapsto \abs{x}$ on $[-1, 1]$ is Hölder continuous (with $\alpha = 1$) and uniformly continuous, because it is Lipschitz continuous.
-
$x \mapsto x^2$ on $[0, 1]$
$x \mapsto x^2$ on $[0, 1]$ is uniformly continuous because every continuous function on a compact set is uniformly continuous.
- $f(x) = x^2 \sin(1/x)$ for $x \neq 0$, $f(0) = 0$, on $[-1, 1]$
-
The Cantor function on $[0, 1]$
The Cantor function is uniformly continuous because it is continuous on the compact interval $[0, 1]$.
-
$x \mapsto \sqrt{x}$ on $[0, 1]$
$x \mapsto \sqrt{x}$ is Hölder continuous with $\alpha = \frac{1}{2}$, since $\abs{\sqrt{x} - \sqrt{y}} \leq \abs{x - y}^{1/2}$, and so it is uniformly continuous.
Non-examples
-
$f(x) = x^2$ on $\reals$
$f(x) = x^2$ is not uniformly continuous on $\reals$, because its graph gets steeper and steeper, so no single closeness of inputs works everywhere.
-
$x \mapsto e^x$ on $\reals$
$x \mapsto e^x$ is not uniformly continuous, because its graph gets steeper without bound as $x$ increases.
-
$x \mapsto \tan(x)$ on $(-\pi/2, \pi/2)$
$\tan$ is not uniformly continuous there, because its graph gets steeper without bound near the ends of the interval.
-
$x \mapsto \sin(1/x)$ on $(0, 1]$
$x \mapsto \sin(1/x)$ on $(0, 1]$ is not uniformly continuous, because points that are arbitrarily close together have values that differ by $2$. For each natural number $n$, let \[x_n = \frac{1}{\frac{\pi}{2} + 2 \pi n} \quad \text{and} \quad y_n = \frac{1}{\frac{3\pi}{2} + 2 \pi n}.\] Then $\sin(1/x_n) = 1$ and $\sin(1/y_n) = -1$, so $\abs{\sin(1/x_n) - \sin(1/y_n)} = 2$ for every $n$, but $\abs{x_n - y_n} \to 0$ as $n \to \infty$. Therefore, for $\varepsilon = 1$, no $\delta > 0$ satisfies the definition of uniform continuity: some pair $x_n, y_n$ is closer than $\delta$, but the values of the pair differ by more than $\varepsilon$.
-
$x \mapsto \sin(1/x)$ on $(0, \infty)$
$x \mapsto \sin(1/x)$ is not uniformly continuous, because it oscillates between $-1$ and $1$ faster and faster as $x \to 0$.
Properties
- Every uniformly continuous function is continuous. On a compact domain, every continuous function is uniformly continuous (the Heine–Cantor theorem).
- A uniformly continuous function maps Cauchy sequences to Cauchy sequences.
Examples
| Example | continuous | uniformly continuous | Why |
|---|---|---|---|
| $f(x) = x^2$ on $\reals$ | ✓ | ✗ | The squaring function, as a function $f : \reals \to \reals$. |
| $x \mapsto e^x$ on $\reals$ | ✓ | ✗ | |
| $x \mapsto \tan(x)$ on $(-\pi/2, \pi/2)$ | ✓ | ✗ | |
| $x \mapsto \sin(1/x)$ on $(0, \infty)$ | ✓ | ✗ | |
| $x \mapsto \sin(x)$ on $\reals$ | ✓ | ✓ | |
| $x \mapsto \sqrt{x}$ on $[0, \infty)$ | ✓ | ✓ | |
| $x \mapsto x^2$ on $[0, 1]$ | ✓ | ✓ |
Notes
- Every uniformly continuous function is continuous (as the name suggests), but some continuous functions are not uniformly continuous.
- Uniform continuity is defined for functions between metric spaces (or, more generally, uniform spaces), whereas continuity is defined for functions between all topological spaces.
- To distinguish continuity from uniform continuity, the former is sometimes called “ordinary continuity” or “pointwise continuity.”
- Uniform continuity is a global property, whereas continuity is a local property.
- On a compact domain, every continuous function is uniformly continuous (the Heine–Cantor theorem).