# Heine–Cantor 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 bounded interval to the real numbers is uniformly continuous.

## Proof

Suppose that $M$ and $N$ are two metric spaces with metrics $d_{M}$ and $d_{N}$ , respectively. Suppose further that $f:M\to N$ is continuous, and that $M$ is compact. We want to show that $f$ is uniformly continuous, that is, for every $\varepsilon >0$ there exists $\delta >0$ such that for all points $x,y$ in the domain $M$ , $d_{M}(x,y)<\delta$ implies that $d_{N}(f(x),f(y))<\varepsilon$ .

Fix some $\varepsilon >0$ . By continuity, for any point $x$ in the domain $M$ , there exists some $\delta _{x}>0$ such that $d_{N}(f(x),f(y))<\varepsilon /2$ when $y$ is within $\delta _{x}$ of $x$ .

Let $U_{x}$ be the open $\delta _{x}/2$ -neighborhood of $x$ , i.e. the set

$U_{x}=\left\{y\mid d_{M}(x,y)<{\frac {1}{2}}\delta _{x}\right\}.$ Since each point $x$ is contained in its own $U_{x}$ , we find that the collection $\{U_{x}\mid x\in M\}$ is an open cover of $M$ . Since $M$ is compact, this cover has a finite subcover $\{U_{x_{1}},U_{x_{2}},\ldots ,U_{x_{n}}\}$ where $x_{1},x_{2},\ldots ,x_{n}\in M$ . Each of these open sets has an associated radius $\delta _{x_{i}}/2$ . Let us now define $\delta =\min _{1\leq i\leq n}\delta _{x_{i}}/2$ , i.e. the minimum radius of these open sets. Since we have a finite number of positive radii, this minimum $\delta$ is well-defined and positive. We now show that this $\delta$ works for the definition of uniform continuity.

Suppose that $d_{M}(x,y)<\delta$ for any two $x,y$ in $M$ . Since the sets $U_{x_{i}}$ form an open (sub)cover of our space $M$ , we know that $x$ must lie within one of them, say $U_{x_{i}}$ . Then we have that $d_{M}(x,x_{i})<{\frac {1}{2}}\delta _{x_{i}}$ . The triangle inequality then implies that

$d_{M}(x_{i},y)\leq d_{M}(x_{i},x)+d_{M}(x,y)<{\frac {1}{2}}\delta _{x_{i}}+\delta \leq \delta _{x_{i}},$ implying that $x$ and $y$ are both at most $\delta _{x_{i}}$ away from $x_{i}$ . By definition of $\delta _{x_{i}}$ , this implies that $d_{N}(f(x_{i}),f(x))$ and $d_{N}(f(x_{i}),f(y))$ are both less than $\varepsilon /2$ . Applying the triangle inequality then yields the desired

$d_{N}(f(x),f(y))\leq d_{N}(f(x_{i}),f(x))+d_{N}(f(x_{i}),f(y))<{\frac {\varepsilon }{2}}+{\frac {\varepsilon }{2}}=\varepsilon .$ For an alternative proof in the case of $M=[a,b]$ , a closed interval, see the article Non-standard calculus.