112

I am struggling with this question:

Prove or give a counterexample: If $f : X \to Y$ is a continuous mapping from a compact metric space $X$, then $f$ is uniformly continuous on $X$.

Thanks for your help in advance.

the code
  • 1,351
  • 2
  • 10
  • 10
  • 2
    Basic real analysis should be a source of at least some intuition (which is misleading at times, granted). Can you think of some compact sets in $\mathbf R$? Are continuous functions on those sets uniformly continuous? Can you remember any theorems regarding those? Another idea is to start to try to prove the statement and see whether things start to fall apart. – Dylan Moreland Feb 18 '12 at 06:49
  • 30
    Hint: Continuity tells you that for every $\epsilon\gt 0$ and every $x$, you can find a $\delta_x\gt 0$ such that $f(B(x,\delta_x))\subseteq B(f(x),\epsilon)$; for uniform continuity, you need a $\delta$ that does not depend on $x$. Now, if there were only finitely many values of $\delta_x$, then you could just pick the smallest one... – Arturo Magidin Feb 18 '12 at 07:19
  • 13
    @ArturoMagidin Actually, just picking the smallest one is not good enough because then the two points might not lie in the same delta ball. – Rudy the Reindeer Feb 18 '12 at 08:12

4 Answers4

140

The answer is yes, if $f$ is continuous on a compact space then it is uniformly continuous:

Let $f: X \to Y$ be continuous, let $\varepsilon > 0$ and let $X$ be a compact metric space. Because $f$ is continuous, for every $x$ in $X$ you can find a $\delta_x$ such that $f(B(\delta_x, x)) \subset B({\varepsilon\over 2}, f(x))$. The balls $\{B(\delta_x, x)\}_{x \in X}$ form an open cover of $X$. So do the balls $\left\{B \left(\frac{\delta_x}{2}, x\right)\right\}_{x \in X}$. Since $X$ is compact you can find a finite subcover $\left\{B \left( \frac{\delta_{x_i}}{2}, x_i \right) \right\}_{i=1}^n$. (You will see in a second why we are choosing the radii to be half only.)

Now let $\delta_{x_i}' = {\delta_{x_i}\over 2}$.

You want to choose a distance $\delta$ such that for any two $x,y$ they lie in the same $B(\delta_{x_i}', x_i)$ if their distance is less than $\delta$.

How do you do that?

Note that now that you have finitely many $\delta_{x_i}'$ you can take the minimum over all of them: $\min_i \delta_{x_i}'$. Consider two points $x$ and $y$. Surely $x$ lies in one of the $B(\delta_{x_i}', x_i) $ since they cover the whole space and hence $x$ also lies in $B(\delta_{x_i}', x_i)$ for some $i$.

Now we want $y$ to also lie in $B(\delta_{x_i}', x_i)$. And this is where it comes in handy that we chose a subcover with radii divided by two:

If you pick $\delta : = \min_i \delta_{x_i}'$ (i.e. $\delta = \frac{\delta_{x_i}}{2}$ for some $i$) then $y$ will also lie in $B(\delta_{x_i}, x_i)$:

$d(x_i, y) \leq d(x_i, x) + d(x,y) < \frac{\delta_{x_i}}{2} + \min_k \delta_{x_k} \leq \frac{\delta_{x_i}}{2} + \frac{\delta_{x_i}}{2} = \delta_{x_i}$.

Hope this helps.

AJY
  • 9,086
  • 20
    The question being homework, isn't it better to give hints rather than a full answer? – wildildildlife Feb 18 '12 at 13:45
  • 2
    Matt, I think you've missed another factor of 2. You have namely shown $y \in B(\delta_{x_i}, x_i)$, so that $d(x_{i},y) < \delta \implies d(f(x_{i}), f(y)) < \epsilon$, but you also need to show that $d(x,y) < \delta \implies d(f(x), f(y)) < \epsilon$. – Ryker Mar 12 '13 at 19:55
  • @Ryker The $\delta$ was constructed such that $x,y$ with $d(x,y) < \delta$ are in the same ball $B(\delta_{x_i}, x_i)$. It follows that $d(x,y) < \delta_{x_i}$. But $\delta_{x_i}$ is such that $d(x,y) < \delta_{x_i}$ implies $d(f(x), f(y)) < \varepsilon$. I cannot find where I am missing the factor of $2$, perhaps you could point out where? – Rudy the Reindeer Mar 12 '13 at 20:12
  • 2
    @MattN., I think the original $\delta_{x_{i}}$ need to be chosen in such a way so as to satisfy the continuity condition for $\frac{\epsilon}{2}$ rather than $\epsilon$. Then you can use the triangle inequality in the final step after you've shown both x and y lie in the same ball. – Ryker Mar 12 '13 at 20:30
  • @Ryker But we want to show $d(f(x),f(y)) < \varepsilon$ and if we chose $\delta$ to be half of the min $\delta_{x_i}$ then $x$ and $y$ are everywhere no further apart than $\delta_{x_i}$ if $d(x,y) < \delta$ from which $d(f(x),f(y)) < \varepsilon$ follows. – Rudy the Reindeer Mar 12 '13 at 20:52
  • 1
    @MattN.: Hmm, we chose $\delta_{x_{i}}$ in relation to a particular $x_{i}$, and the original condition is $d(x_{i},y)< \delta_{x_{i}} \implies d(f(x_{i}), f(y)) < \epsilon$. x, y in that ball are arbitrary and continuity of f at x would only imply we can find $\delta_{x}$, as well. But x is not one of the $x_{i}$ picked out by compactness, so $\delta$ doesn't necessarily relate to the $\delta_{x}$ needed. The one thing we do, however, know is that $d(x,y) \leq d(x, x_{i}) + d(x_{i}, y) < \epsilon + \epsilon = 2\epsilon$. – Ryker Mar 12 '13 at 23:41
  • @Ryker But the last expression you wrote makes no sense: $\delta$ is used to indicate distance in the domain $X$, $\varepsilon$ is used to indicate distance in the range $Y$. – Rudy the Reindeer Mar 13 '13 at 06:55
  • 1
    @MattN., sorry, you're right, I meant $d(f(x),f(y)) \leq d(f(x), f(x_{i})) + d(f(x_{i}),f(y))$. But the argument still stands, though. – Ryker Mar 13 '13 at 14:52
  • 1
    @MattN. To add to it, in your first response to me in the comments you said "But $\delta_{x{i}}$ is such that $d(x,y) < \delta_{x{i}}$ implies $d(f(x),f(y)) < \epsilon$", but this isn't true. Take for example the identity function on the real numbers, and consider $x_{i}=0$. For $\epsilon =1$, if $|x|<1$, then $d(f(x),f(x_{i})) < 1.$ But if $x=0.6, y=0.6$, they both lie in $B(1,0)$, but $d(f(x),f(y)) > \epsilon$. I hope this clears up the confusion, if there was any, of what I was trying to say. – Ryker Mar 13 '13 at 19:14
  • 1
    @Ryker Your second comment makes even less sense than what you wrote before: the real numbers $\mathbb R$ isn't a compact space and in your "example", $d(f(x),f(y)) = 0$ since $f(x) = x = 0.6 = y = f(y)$. – Rudy the Reindeer Mar 13 '13 at 19:30
  • 1
    @MattN. OK, consider the domain to be $[-3,3]$ then (I was just giving reals as an example, no need to take the whole set) and I made another typo in that I wanted to write $x=0.6, y=-0.6$. Hopefully it's more clear now, as I can't edit the original comment. – Ryker Mar 13 '13 at 20:50
  • 1
    @Ryker No. For $f(x) = x$ on $[-3,3]$ with $\varepsilon = 1$ take $\delta = 1/2$. It immediately follows that for $d(x,y) < 1/2$ we also have $d(f(x), f(y)) < 1$ since $d(f(x),f(y)) = d(x,y) < 1/2$. All your counter examples will be broken because you are trying to disprove an established theorem. – Rudy the Reindeer Mar 13 '13 at 21:44
  • 1
    @MattN. Again, I wasn't trying to provide a full counter-example and I realize you can just pick a smaller $\delta$. That's exactly my point, though, you have to pick a smaller one that the one continuity guarantees, since for continuity's sake, $\delta=1$ would be sufficient in my example. I'm saying that $d(x,y)< \delta$ does not imply $d(f(x),f(y)) < \epsilon$, $d(x,y) < \delta_{x}$ does. But x might not be in the finite subcover, so the definition of $\delta$ did not take it into account. So you must relate x and y to one of the $x_{i}$ first before saying anything about $\epsilon$. – Ryker Mar 13 '13 at 22:10
  • @Ryker "But x might not be in the finite subcover,": If $x$ was not in the finite subcover it wouldn't be a (sub)cover. – Rudy the Reindeer Mar 14 '13 at 06:54
  • 1
    @MattN. I mean x might not be one of the $x_{i}$ in the subcover (hence the remark about $\delta$ not taking it into account). – Ryker Mar 14 '13 at 13:53
  • I do not understand why choosing the min of the $\delta_i/2$ would ensure that $y$ is in that ball. – shilov Nov 20 '15 at 19:26
  • @shilov You should look at the last line of the proof. The inequality should explain it. – Rudy the Reindeer Nov 21 '15 at 23:35
  • I have read this proof over and over again, and it's gotten the stamp of approval from 38 people, yet I can't understand why choosing $\delta$ to be the minimum of $\delta_{x_{i}}$ implies that $\delta = \frac{\delta_{x_{j}}}{2}$ for some $j$.....is that a typo? – layman Jan 09 '16 at 00:21
  • @user46944 No, it's not a typo. – Rudy the Reindeer Jan 09 '16 at 00:27
  • @RudytheReindeer So you aren't interested in explaining why the implication holds? – layman Jan 09 '16 at 00:32
  • 4
    @RudytheReindeer Ryker is right, you are missing a factor of 2. You say in a comment that $\delta_{x_i}$ is such that $d(x,y)<\delta_{x_i}$ implies that $d(f(x),f(y))<\epsilon$. But that's not true. From continuity, $\delta_{x_i}$ is such that if both $x$ and $y$ are in the $B(\delta_{x_i},x_i)$, then $f(x)$ and $f(y)$ are both in the $B(\epsilon,f(x_i))$, which gives the distance between $f(x)$ and $f(y)$ at most $2\epsilon$, not $\epsilon$ . – Theo Mar 17 '16 at 02:46
  • @Theo No: In the second paragraph the $\delta_i$ are actually equal to ${\delta_i \over 2}$ from the first paragraph. I believe this to be the factor of two that everybody is criticising in the comments. Right, that's the factor you are talking about? – Rudy the Reindeer Mar 18 '16 at 05:16
  • 1
    @Theo Oh, I see now what you mean! All this time I thought people where saying the $\delta$ were off by a factor of $2$. Duh. Of course one has to replace $\varepsilon$ by ${\varepsilon \over 2}$. The proof stays the same though. – Rudy the Reindeer Mar 18 '16 at 05:34
  • question, is there a way to show this by partitioning the interval in such a way that if $P={x_0,x_1,...,x_n}$ is a partition we have that $\vert x_i-x_{i-1}\vert<\delta$? And then use continuity? – MyMathYourMath Jan 31 '21 at 23:23
54

Let $(X, d)$ be a compact metric space, and $(Y, \rho)$ be a metric space. Suppose $f : X \to Y$ is continuous. We want to show that it is uniformly continuous.

Let $\epsilon > 0$. We want to find $\delta > 0$ such that $d(x,y) < \delta \implies \rho(f(x), f(y))< \epsilon$.

Ok, well since $f$ is continuous at each $x \in X$, then there is some $\delta_{x} > 0$ so that $f(B(x, \delta_{x})) \subseteq B(f(x), \frac{\epsilon}{2})$.

Now, $\{B(x, \frac{\delta_{x}}{2})\}_{x \in X}$ is an open cover of $X$, so there is a finite subcover $\{B(x_{i}, \frac{\delta_{x_{i}}}{2})\}_{i =1}^{n}$.

If we take $\delta := \min_{i} (\frac{\delta_{x_{i}}}{2})$, then we claim $d(x,y) < \delta \implies \rho(f(x), f(y)) < \epsilon$. Why?

Well, suppose $d(x,y) < \delta$. Since $x \in B(x_{i}, \frac{\delta_{x_{i}}}{2})$ for some $i$, we get $y \in B(x_{i}, \delta_{x_{i}})$. Why? $d(y, x_{i}) \leq d(y,x) + d(x,x_{i}) < \frac{\delta_{x_{i}}}{2} + \frac{\delta_{x_{i}}}{2} = \delta_{x_{i}}$.

Ok, finally, if $d(x,y) < \delta$, then we claim $\rho(f(x), f(y)) < \epsilon$. This is because $\rho(f(x), f(y)) \leq \rho(f(x), f(x_{i})) + \rho(f(x_{i}), f(y)) < \frac{\epsilon}{2} + \frac{\epsilon}{2} = \epsilon$.

layman
  • 20,819
  • at the third line, shouldn't it be $B(x, \frac{\delta_{x}}{2})$? – Poperton Jun 25 '16 at 15:32
  • @GuerlandoOCs Do you mean when we find $\delta_{x} > 0$ so that $f(B(x, \delta_{x})) \subseteq B(f(x), \frac{\epsilon}{2})$? – layman Jun 26 '16 at 03:02
  • yes thats it .. – Poperton Jun 26 '16 at 03:24
  • @GuerlandoOCs It doesn't matter. The way the proof is written is correct. But you can also say "Let $\delta_{x} > 0$ be such that $f(B(x, \frac{\delta_{x}}{2})) \subseteq B(f(x), \frac{\epsilon}{2})$". It doesn't change the rest of the proof as it is written. I recommend you spend time thinking about this and drawing some pictures of the proof so you can see for yourself that it doesn't matter which one you say. :) – layman Jun 26 '16 at 03:34
6

$f:X\rightarrow Y$ is uniformly continuous iff for every pair of sequences $(x_n),(y_n)$ in $X$ satisfying $d(x_n,y_n)\rightarrow 0$ we have $d(f(x_n),f(y_n))\rightarrow 0$. Now let $(a_n)$ be any subsequence of $(x_n)$ and $(b_n)$ be that of $(y_n)$. X being compact, $(a_n)$ has a convergent subsequence $(a_{n_k})$, with limit, say $l$. But since $d(x_n,y_n) \to 0$, we have $b_{n_k} \to l$. And since $f$ is continuous, $f(a_{n_{k}})\rightarrow f(l)$ and $f(b_{n_{k}})\rightarrow f(l)$. Hence, $d(f(a_{n_{k}}),f(b_{n_{k}}))\rightarrow 0$. So that every subsequence of $d(f(x_n),f(y_n))$ has a further subsequence converging to $0$. This proves $f$ to be uniformly continuous.

  • 1
    You only prove there exist subsequences such that $d(f(a_{n_{k_l}}),f(b_{n_{k_l}}))\rightarrow 0$. But this doesn't guarantee $d(f(x_n),f(y_n))\rightarrow 0$ – MathFail Aug 13 '22 at 21:51
  • 2
    @MathFail Thanks for the downvote! I proved that every subsequence of the sequence $d(f(x_n), f(y_n))$ has a further subsequence converging to $0$. This proves $d(f(x_n), f(y_n))$ itself converges to $0$. This is pretty elementary so I thought any reader would comprehend this. – Smooth Alpert Frame Aug 14 '22 at 13:05
  • Can you add this proof? – MathFail Aug 14 '22 at 15:04
  • This is Cauchy continuity right? How is equivalence to uniform continuity established? – Tavin Nov 12 '22 at 03:59
  • @Tavin The criterion I am using is stated in my first sentence. – Smooth Alpert Frame Nov 16 '22 at 11:29
1

I offer a proof by contradiction.

Suppose $f$ is not uniformly continuous. Then for some $\varepsilon > 0$, there is a sequence of positive real $\delta_n \to 0$ with associated $x_n \in X$ such that

$$\forall n : f[B(x_n, \delta_n)] \nsubseteq B(f(x_n), \varepsilon). \tag{1}$$

$X$ is compact so $x_n$ contains a convergent subsequence $x_m \to x \in X$. By pointwise continuity, $\exists \delta_x > 0$ such that

$$f[B(x, \delta_x)] \subseteq B(f(x), \frac{1}{2} \varepsilon). \tag{2}$$

The convergence of $x_m$ implies $x_{m \ge M} \in B(x, \frac{1}{2} \delta_x)$ for some $M < \infty$. In such cases $B(x_m, \frac{1}{2} \delta_x) \subseteq B(x, \delta_x)$ and then using $(2)$,

\begin{align} y \in B(x_m, \frac{1}{2} \delta_x) & \implies d(f(x_m), f(y)) \le d(f(x_m), f(x)) + d(f(x), f(y)) < \frac{1}{2} \varepsilon + \frac{1}{2} \varepsilon \\ & \implies f(y) \in B(f(x_m), \varepsilon). \tag{3} \end{align}

For some finite $m \ge M$ it holds that $\delta_m < \frac{1}{2} \delta_x$ where $\delta_m$ is given by the original sequences $\delta_n$ and $x_n$. A contradiction with $(1)$ follows from $(3)$ and uniform continuity is proven.

$$\exists m : f[B(x_m, \delta_m)] \subseteq f[B(x_m, \frac{1}{2} \delta_x)] \subseteq B(f(x_m), \varepsilon) \tag{4}$$

Tavin
  • 245
  • 1
  • 10
  • I believe your contradiction assumption is stronger than you may take - uniform continuity gives only for each $n$ the existence of one particular $y_n \in f(B(x_n,\delta_n))$ such that $y_n \not \in B(f(x),\dfrac{1}{2} \epsilon)$. (This does match up with your contradiction: (3) is $f(B(x_m,\delta_m) \subseteq B(f(x_m),\epsilon)$, so $y_m \in B(f(x_m,\epsilon))$.) – George Sep 09 '23 at 13:42
  • Thanks @George. – Tavin Sep 14 '23 at 21:03