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

## Proof

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

Fix some positive ${\displaystyle \varepsilon >0}$. Then by continuity, for any point ${\displaystyle x}$ in our domain ${\displaystyle M}$, there exists a positive real number ${\displaystyle \delta _{x}>0}$ such that ${\displaystyle d_{N}(f(x),f(y))<\varepsilon /2}$ when ${\displaystyle y}$ is within ${\displaystyle \delta _{x}}$ of ${\displaystyle x}$.

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

${\displaystyle U_{x}=\left\{y\mid d_{M}(x,y)<{\frac {1}{2}}\delta _{x}\right\}}$

Since each point ${\displaystyle x}$ is contained in its own ${\displaystyle U_{x}}$, we find that the collection ${\displaystyle \{U_{x}\mid x\in M\}}$ is an open cover of ${\displaystyle M}$. Since ${\displaystyle M}$ is compact, this cover has a finite subcover. That subcover must be of the form

${\displaystyle U_{x_{1}},U_{x_{2}},\ldots ,U_{x_{n}}}$

for some finite set of points ${\displaystyle \{x_{1},x_{2},\ldots ,x_{n}\}\subset M}$. Each of these open sets has an associated radius ${\displaystyle \delta _{x_{i}}/2}$. Let us now define ${\displaystyle \delta =\min _{1\leq i\leq n}{\frac {1}{2}}\delta _{x_{i}}}$, i.e. the minimum radius of these open sets. Since we have a finite number of positive radii, this number ${\displaystyle \delta }$ is well-defined and positive. We may now show that this ${\displaystyle \delta }$ works for the definition of uniform continuity.

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

${\displaystyle 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 ${\displaystyle x}$ and ${\displaystyle y}$ are both at most ${\displaystyle \delta _{x_{i}}}$ away from ${\displaystyle x_{i}}$. By definition of ${\displaystyle \delta _{x_{i}}}$, this implies that ${\displaystyle d_{N}(f(x_{i}),f(x))}$ and ${\displaystyle d_{N}(f(x_{i}),f(y))}$ are both less than ${\displaystyle \varepsilon /2}$. Applying the Triangle Inequality then yields the desired

${\displaystyle d_{N}(f(x),f(y))\leq d_{N}(f(x_{i}),f(x))+d_{N}(f(x_{i}),f(y))<{\frac {1}{2}}\varepsilon +{\frac {1}{2}}\varepsilon =\varepsilon }$

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