# Difference between continuity and uniform continuity

Tags:
1. May 7, 2015

### Yunjia

I noticed that uniform continuity is defined regardless of the choice of the value of independent variable, reflecting a function's property on an interval. However, if on a continuous interval, the function is continuous on every point. It seems that the function on that interval must be uniformly continuous. Is this correct? Is there a counterexample for the statement?

2. May 7, 2015

### jbunniii

What you said is almost true. If, on a closed, bounded interval, a function is continuous at every point, then the function is uniformly continuous on that interval.

Counterexample on a non-closed interval: $f(x) = 1/x$ on the interval $(0,1)$.

Counterexample on a closed but unbounded interval: $f(x) = x^2$ on the interval $[0,\infty)$.

3. May 8, 2015

### Svein

Even more general: If a function is continuous at every point in a compact set, it is uniformly continuous on that set.
The proof is simple: Let the compact set be K and take an ε>0. Since the function is continuous at every point x in the set, there is a δx for every x∈K such that |f(w)-f(x)|<ε for every w in <x-δx, x+δx>. Let Ox=<x-δx, x+δx>, then K is contained in $\bigcup_{x\in K}O_{x}$. Since K is compact, it is contained in the union of a finite number of the Ox, say $\bigcup_{n=1}^{N}O_{n}$. Take δ to be the minimum of the δn and |f(w)-f(x)|<ε whenever |w-x|<δ.

4. May 8, 2015

### jbunniii

And here's the proof that a closed, bounded interval is compact, so you can apply Svein's proof.

Let $[a,b]$ be a closed, bounded interval, and let $\mathcal{U}$ be any collection of open sets which covers $[a,b]$. Let $S$ be the set of all $x \in [a,b]$ such that $[a,x]$ can be covered by finitely many of the sets in $\mathcal{U}$. Clearly $a \in S$. This means that $S$ is nonempty and is bounded above (by $b$), so it has a supremum, call it $c$. Since $c \in [a,b]$, it is contained in some $U_c \in \mathcal{U}$, hence there is some interval $(c - \epsilon, c + \epsilon)$ contained in $U_c$. Since only finitely many sets from $\mathcal{U}$ are needed to cover $[a,c - \epsilon/2]$, those sets along with $U_c$ form a finite cover of $[a,c+\epsilon/2]$. This shows that $c \in S$ and moreover, that $c$ cannot be less than $b$. Therefore $c=b$, so all of $[a,b]$ can be covered by finitely many sets in $\mathcal{U}$.

Last edited: May 8, 2015
5. May 8, 2015

### Svein

Excellent! And, of course, since one closed and bounded interval is compact, the union of a finite number of closed and bounded intervals is again compact.

6. May 8, 2015

### jbunniii

I don't think this will work if $w$ and $x$ are not contained in the same $O_n$. I think you need to take $O_x = (x - \delta_x/2, x + \delta_x/2)$ and $\delta$ to be $\min\{\delta_n/2\}$ in order to ensure that $|w-x| < \delta$ implies $|f(w) - f(x)| < \epsilon$.

7. May 8, 2015

### Svein

Possibly. I need to think about that. The crux of the matter is that there is a finite number of intervals that cover K, which means that the minimum of the (finite number of) δ's exist and is greater than 0.

8. May 8, 2015

### HallsofIvy

Staff Emeritus
Here is the fundamental difference between "continuous" and "uniformly continuous":

A function is said to be continuous at a point, x= a, if and only if, given any $\epsilon> 0$ there exist $\delta> 0$ such that if $|x- a|< \delta$ then $|f(x)- f(a)|<\epsilon$.

A function is said to be continuous on a set, A, if and only if, given any $\epsilon> 0$ there exist $\delta> 0$ such that if $|x- a|< \delta$ then $|f(x)- f(a)|<\epsilon$ for all a in set A.

That is, a function is uniformly continuous on a set A if and only if it is continuous at every point in A and, given $\epsilon> 0$ the same $\delta$ can be used for ever point in A.

9. May 8, 2015

### Svein

Agree. I was sloppy and overlooked the simple fact that that the length of the interval Ox is 2⋅δx.

10. May 13, 2015

### Yunjia

The defition of uniformly continuous is perplexing for me. Is it possible for you to illustrate it with a proof about a function which is not uniformly continuous but continuous on a set so that I can compare the two? Thank you.

11. May 14, 2015

### Svein

OK. Take the function $f(x)=\frac{1}{x}$ on the open interval <0, 1>. It is continuous (and even differentiable) on that interval, but not uniformly continuous.

12. May 17, 2015

### Svein

After using pencil an paper for a bit, I came to the conclusion that I should have used ε/2 and δ/2. But - I recall a proof in "Complex analysis in several variables" that ended up in "... less than 10000ε, which is small when ε is small".

13. May 17, 2015

### HallsofIvy

Staff Emeritus
First note an important point about "uniform continuity" and "continuity" you may have overlooked: we define "continuous" at a single point and then say that a function is "continuous on set A" if and only if it is continuous at every point on A. We define "uniformly continuous" only on a set, not at a single points of a set.

A function is uniformly continuous on any closed set on which it is continuous and so on any set contained in a closed set on which it is continuous.
To give an example of a function that is continuous but not uniformly continuous, we need to look at f(x)= 1/x on the set (0, 1).

To show that it is continuous on (0, 1), let a be a point in (0, 1) and look at $|f(x)- f(a)|= |1/x- 1/a|= |a/ax- x/ax|= |(a- x)/ax|= |x- a|/ax< \epsilon$.
We need to find a number, $\delta> 0$ such that if $|x- a|< \delta$, then $|f(x)- f(a)|> \epsilon$. We already have $|x- a| ax\epsilon$ so we need an upper bound on ax. If we start by requiring that $\delta< a/2$ then $|x- a|< \delta< a/2$ so that $-a/2< x- a< a/2[itex] or [itex]a/2< x< 3a/2$ so an upper bound on ax is $3a^2/2$. If $|x- a|< a/2$ and $|x- a|< 3a/2$ then $|f(x)- f(a)|< |x- a|/ax< |x- a|/(3a^2/2)= 2|x- a|/3a^2$ which will be less than $\epsilon$ as long as $|x- a|< 3a^2\epsilon/2$

So we can take $\delta$ to be the smaller of $a/2$ and $3a^2/\epsilon$. Therefore, 1/x is continuous at any point a in (0, 1) so continuous on (0, 1).

Now the point is that this $\delta$ depends on a. It is a decreasing function of a and will go to 0 as a goes to 0. That's fine for "continuity" but for uniform continuity we must be able to use the same $\delta> 0$ for a given $\epsilon$ no matter what the "a" is and we cannot do that. If the problem were to prove uniform continuity on the set [p, 1), which is contained in the closed set [p, 1], we could use, for any a in that set, the $\delta$ that we get for a= p, the smallest x value in the set. But with (0, 1), the smallest $\delta$ is 0 which we cannot use since we must have $\delta> 0$.