# Heine–Cantor theorem

Not to be confused with Cantor's theorem.

In mathematics, the Heine–Cantor theorem, named after Eduard Heine and Georg Cantor, states that if f : MN is a continuous function between two metric spaces, and M is compact, then f is uniformly continuous. An important special case is that every continuous function from a closed interval to the real numbers is uniformly continuous.

## Proof

Uniform continuity for a function f is stated as follows:

$\forall \varepsilon > 0 \ \exists \delta > 0 \ \forall x, y \in M : \left (d_M(x,y) < \delta \Rightarrow d_N (f(x) , f(y) ) < \varepsilon\right),$

where dM, dN are the distance functions on metric spaces M and N, respectively. Now assume for a contradiction that f is continuous on the compact metric space M but not uniformly continuous; in this case, the negation of uniform continuity for f is that

$\exists \varepsilon_0 > 0 \ \forall \delta > 0 \ \exists x, y \in M : \left (d_M (x,y) < \delta \wedge d_N (f(x) , f(y) ) \ge \varepsilon_0\right) .$

Fixing ε0, for every positive number δ we have a pair of points x and y in M with the above properties. Setting δ = 1/n for n = 1, 2, 3, ... gives two sequences {xn}, {yn} such that

$d_M(x_n, y_n) < \frac {1}{n} \wedge d_N ( f (x_n), f (y_n)) \ge \varepsilon_0.$

As M is compact, the Bolzano–Weierstrass theorem shows the existence of two converging subsequences ($x_{n_k}$ to x0 and $y_{n_k}$ to y0) of these two sequences. It follows that

$d_M (x_{n_k}, y_{n_k}) < \frac{1}{n_k} \wedge d_N ( f (x_{n_k}), f (y_{n_k})) \ge \varepsilon_0 .$

But as f is continuous and $x_{n_k}$ and $y_{n_k}$ converge to the same point, this statement is impossible. The contradiction proves that our assumption that f is not uniformly continuous cannot be true, so f must be uniformly continuous as the theorem states.

For an alternative proof in the case of M = [a, b] a closed interval, see the article on non-standard calculus.