21

Suppose $f:\mathbb{R}\mapsto\mathbb{R}$ is a continuous function. Define $f_n(x)=f(x+1/n)$ for all $n\in\mathbb{N}^+$. If $f_n(x)\to f(x)$ uniformly on $\mathbb{R}$, can we conclude that $f$ is actually uniformly continuous? If not, can you give a counterexample of $f$ to be not uniformly continuous but satisfies all above conditions?

I know that if $f_n(x)$'s are all uniformly continuous and $f_n(x)\to f(x)$ uniformly, then $f(x)$ must be uniformly continuous. However, here we do not assume $f(x)$ to be uniformly continuous, and $f_n(x)$ has specific structure related to $f(x)$, so at least you cannot directly conclude they are uniformly continuous. I guess the statement above is wrong but it's hard for me to find a counter-example. Can anyone help me?

William
  • 987

3 Answers3

13

Updated answer:

No, $f$ need not be uniformly continuous, as shown by the example below. The example is tailored to the sequence $\{1/n\}_{n \in \mathbb{N}}$, and does not shed light on the general question of whether the condition that $f(x + \epsilon_n) \to f(x)$ uniformly implies that $f$ is uniformly continuous, for a given sequence $\{\varepsilon_n\}$ converging to zero.

First, define a sequence recursively by $a_1 = 3$ and $a_{n+1} = (a_n)!$ for $n \geq 1$. Let $h$ be the periodic function with period $1$ such that $h(x) = 2x$ for $x \in [0, 1/2]$ and $h(x) = 2-2x$ for $x \in [1/2, 1]$. In particular, $h(k) = 0$ for each integer $k$, and $h$ is continuous and Lipschitz with constant $2$. Now using the sequence, for each $n$ we define the function $g_n$ by $$g_n(x) = \begin{cases} 0 & x < n \\ \frac{1}{n} h(a_n x) & x \geq n\end{cases}$$ so $g_n$ is continuous and Lipschitz with constant $2a_n/n$. Finally, define $f(x) = \sum_{n=1}^\infty g_n(x)$, where $f$ is continuous since each $g_n$ is continuous, and all but finitely many $g_n$ vanish on $(-\infty, b)$ for each $b$.

We will now show that $f_m \to f$ uniformly, where $f_m(x) = f(x + 1/m)$. Fix $m$, and let $k$ be the smallest index such that $a_k \geq m$. In particular, this means that $m$ divides $a_n$ for all $n \geq k+1$, and thus for each such $n$, $1/m$ is a multiple of $1/a_n$, so $g_n(x + 1/m) = g_n(x)$ for all $x$ not in $(n-1, n)$. Therefore for any $x$, there is at most one $n \geq k+1$ for which $g_n(x + 1/m) \neq g_n(x)$, and this $n$ necessarily satisfies $|g_n(x + 1/m) - g_n(x)| \leq \frac{1}{n} \leq \frac{1}{k}$. It follows that for sufficiently large $m$ we have

\begin{align*} |f(x + 1/m) - f(x)| &= \left|\sum_{n=1}^\infty g_n(x + 1/m) - g_n(x)\right| \\ &\leq \frac{1}{k} + \sum_{n=1}^k |g_n(x + 1/m) - g_n(x)| \\ &\leq \frac{1}{k} + \frac{1}{k} + \frac{1}{k-1} + \sum_{n=1}^{k-2} |g_n(x + 1/m) - g_n(x)| \\ &\leq \frac{4}{k} + \sum_{n=1}^{k-2} \frac{2a_n}{n} \cdot \frac{1}{m} \\ &\leq \frac{4}{k} + \frac{2ka_{k-2}}{m} \\ &\leq \frac{5}{k} \end{align*} where the last inequality follows from $m \geq a_{k-1} \geq 2k^2 a_{k-2}$, which clearly holds for sufficiently large $k$. Then if we define $k_m$ to be the smallest $k$ for which $a_k \geq m$, we see that $k_m \to \infty$ as $m \to \infty$, so since $|f(x + 1/m) - f(x)| \leq 5/k_m$ uniformly for sufficiently large $m$, it follows that $f(x + 1/m)$ converges to $f(x)$ uniformly.

However, $f$ is not uniformly continuous. Note that $\int_0^1 h(a_nx) \,dx = 1/2$, so for any positive integer $k$, $\int_0^1 f(k + x) \,dx = \frac{1}{2}\sum_{n=1}^k \frac{1}{n}$, and thus there is some $x_k \in (0, 1)$ with $f(k + x_k) \geq \frac{1}{2}\sum_{n=1}^k \frac{1}{n}$. On the other hand $f(k) = 0$ always. But if $f$ were uniformly continuous, there would be some $M$ for which $|f(x) - f(y)| \leq M$ whenever $|x - y| \leq 1$, which clearly does not hold, so $f$ cannot be uniformly continuous.

Original answer:

Too long for a comment:

Whatever the answer is, it might depend on the properties of the sequence $\{1/n\}_{n \in \mathbb{N}}$. Below is an example which shows that if we instead define $f_n(x) = f(x + 3^{-n})$, then the condition that $f_n \to f$ uniformly on $\mathbb{R}$ does not imply that $f$ is uniformly continuous. I was unable to construct a similar example for the sequence $\{1/n\}_{n \in \mathbb{N}}$.

Let $h(x)$ be the "triangle wave" function, such that $h(x)$ is periodic with period $1$ and has $h(x) = 2x$ for $x \in [0, 1/2]$ and $h(x) = 2 - 2x$ for $x \in [1/2, 1]$. In particular, $h$ is continuous and has $h(0) = h(1) = 0$, $h(1/2) = 1$, and $|h(x) - h(y)| \leq 2|x - y|$ for all $x, y$. Next, for each $n$, define $g_n(x)$ so that $g_n(x) = 0$ for $x < n$ and $g_n(x) = \frac{1}{n} h(3^n x)$ for $x \geq n$. With this definition, $g_n$ is continuous, and satisfies $|g_n(x) - g_n(y)| \leq \frac{2}{n} \cdot 3^n|x - y|$ for all $x, y$. Finally, define $f(x) = \sum_{n=1}^\infty g_n(x)$. Note $f$ is continuous since each $g_n$ is continuous, and all but finitely many $g_n$ vanish on $(-\infty, a)$ for each $a$.

Now we will show that $f_m \to f$ uniformly, where $f_m(x) = f(x + 3^{-m})$. For $n \geq m$, $g_n(x + 3^{-m}) = g_n(x)$ so long as $x \not \in (n - 3^{-m}, n)$, meaning $g_n(x + 3^{-m}) \neq g_n(x)$ only in $(n-1, n)$. Thus for any $x$, there is at most one $n$ with $n \geq m$ and $g_n(x + 3^{-m}) \neq g_n(x)$, and this $n$ necessarily satisfies $|g_n(x + 3^{-m}) - g_n(x)| \leq \frac{1}{n} \leq \frac{1}{m}$. Thus we have \begin{align*} |f(x + 3^{-m}) - f(x)| &= \left| \sum_{n=1}^\infty (g_n(x + 3^{-m}) - g_n(x)) \right| \\ &\leq \frac{1}{m} + \sum_{n=1}^{m-1} |g_n(x + 3^{-m}) - g_n(x)| \\ &\leq \frac{1}{m} + \sum_{n=1}^{m-1} \frac{2}{n} \cdot 3^{-(m - n)} \\ &\leq \frac{C}{m} \end{align*} for some sufficiently large $C$ not depending on $m$. Thus $|f_m - f| \leq C/m$, so $f_m \to f$ uniformly.

On the other hand, $f$ is not uniformly continuous. Consider $x$ of the form $k + \frac{1}{2}$ for $k$ a positive integer. For $n \leq k$ we have $g_n(x) = \frac{1}{n}$ since $3^n x = 1/2$ modulo $1$, so $f(k + \frac{1}{2}) = \sum_{n=1}^k \frac{1}{n}$. In particular, letting $k \to \infty$ we see $f(k + \frac{1}{2}) \to \infty$, while $f(k) = 0$ always, so $f$ is not uniformly continuous.

user125932
  • 8,813
  • This can’t work. If your example has $f(k+1/2)-f(k) \to \infty$ as $k \to \infty$, but for every $\epsilon > 0$ there exists $N$ s.t. $|f(x + 1/2N)-f(x)| < \epsilon$ for all real $x$, then by taking $N$ steps of size $1/2N$ from $x$ to $x + 1/2$, Triangle Inequality shows that $|f(x + 1/2) - f(x)| < N \epsilon$ for all real $x$, contradiction. – Rivers McForge Nov 25 '20 at 06:37
  • 1
    but I'm only assuming that $|f(x + 3^{-n}) - f(x)| \to 0$ uniformly in $x$; this doesn't imply that $|f(x + \frac{1}{2N}) - f(x)|$ is bounded for any fixed $N$ (I'm not assuming that the original condition from the question holds) – user125932 Nov 25 '20 at 06:50
  • Yeah, @user125932 only assumes $f(x+3^{-n})\to f(x)$ uniformly, instead of $f(x+1/n)\to f(x)$. In that case why there exists $N$ s.t. $|f(x+1/2N)-f(x)|<\epsilon$ for all real $x$? – William Nov 25 '20 at 07:09
  • @user125932 OK, then suppose for all $\epsilon$ there exists $N$ so that $|f(x + 3^{-j} - f(x)| < \epsilon$ whenever $j \geq N$. Then Triangle Inequality gives us estimates of the form $$|f(x + 1/2 - 3^{-j}/2) - f(x)| < \frac{3^{N}-1}{2}\epsilon + (j-N)\epsilon$$ which are uniform for all $x \in \Bbb{R}$. But if $f(k + 1/2) \to \infty$, eventually, for $k$ sufficiently large, you're asking the (continuous) function to make too big of a jump in too tiny of an interval. – Rivers McForge Nov 25 '20 at 17:24
  • 1
    I'm not sure how your bound implies any bound on $|f(x + 1/2) - f(x)|$. the trick of my function is that the condition that $|f(x + 3^{-n}) - f(x)|$ be bounded for all $n$ does not imply that $|f(x + 1/2) - f(x)|$ will be bounded, since $1/2$ cannot be expressed as a finite sum of terms of the form $\pm 3^{-n}$ – user125932 Nov 25 '20 at 18:22
  • 1
    @RiversMcForge continuous function indeed can make arbitrary big jump in a interval of fixed length. You can draw the graph of function $x\sin(x)$, although it is not a counterexample for my question, but it illustrates continuous function can make larger and larger jump in an interval of fixed length. – William Nov 25 '20 at 23:40
  • I have read your example and believe it to be correct. Well done! Maybe a similar example can be constructed for the case of rational $\epsilon_n$ ( I have not checked this, just a thought), but for irrational $\epsilon_n$ this will be much more difficult. – supinf Nov 27 '20 at 20:43
  • 1
    Also, I find it notable how quickly growing $a_n$ is and, conversely, how extremely slowly $f(x+1/n)$ converges to $f(x)$. – supinf Nov 27 '20 at 20:45
  • right, I don't know what to expect for the general case where $\epsilon_n$ might be irrational. it seems possible that some sequence would actually force uniform continuity. – user125932 Nov 27 '20 at 21:12
  • As the one who offered the bounty, I'll work through this example and let you know if I think it checks out. – Jake Mirra Nov 27 '20 at 21:23
  • Very smart counter-example! Thank you so much. I'm just curious are you a math PhD or mathematician? @user125932 – William Nov 28 '20 at 03:37
  • 1
    @Williampixel it's nice of you to ask, but I would rather not say anything about myself, sorry – user125932 Nov 28 '20 at 04:38
  • @user125932 I updated my answer, I'm pretty confident this time that no such counterexample along your lines actually works. If $f(x + 1/m) \to f(x)$ uniformly, then for any fixed $\epsilon$ we can build a $\delta$ for which $|f(y) - f(x)| < \epsilon$ whenever $y - x < \delta$, and then we get $$|f(k+1/2) - f(k)| < \lceil \frac{0.5}{\delta} \rceil \epsilon,$$ which in particular implies finiteness of $|f(k+1/2) - f(k)|.$ – Rivers McForge Nov 28 '20 at 04:54
  • @user125932 It's OK. – William Nov 28 '20 at 06:07
  • I checked it. Nice work. I would have preferred integrals and to not use "randomly select" in your proof, but I replaced it in my head with "integral" and "for some $x$", and it was perfectly fine. You must be some kind of statistician, so I will forgive you. Take your well-earned bounty (when it lets me award it in 54 minutes). – Jake Mirra Nov 28 '20 at 18:57
  • thanks -- that last part was written in a hurry, I've now updated it to use integrals – user125932 Nov 28 '20 at 19:36
  • Expectation is totally fine for people like me, somebody who is doing optimization. You can think the measure as Lebesgue or Borel measure. – William Nov 29 '20 at 01:55
  • @RiversMcForge This argument does not work if we set $\delta=\epsilon^2$. I would prefer it if you tell us where exactly there is a mistake in this answer. – supinf Nov 30 '20 at 09:55
  • @user125932 I noticed that right before I saw your comment, lol. – Rivers McForge Dec 01 '20 at 04:24
-1

Yes, such an $f$ must be uniformly continuous

Suppose that the sequence $$f_n(x) := f(x + 1/n) \to f(x)$$ uniformly on $\Bbb{R}$. This means for any $\epsilon > 0$, there exists $N_\epsilon$ so that $|f(x + 1/n) - f(x)| < \epsilon$ for all $n \geq N_\epsilon$ and all $x \in \Bbb{R}$.

So fix $\epsilon > 0$, and let $N_k := N_{\epsilon/2^k}$. For any $x \in \Bbb{R}$, define sets $S_k(x)$ via

\begin{align*} S_0(x) &:= \{ x \} \\ S_1(x) &:= S_0(x) \cup \{ x + 1/k_1: k \geq N_1 \} \\ S_2(x) &:= S_1(x) \cup \{ y_1 + 1/k_2: y_1 \in S_1, k_2 \geq N_2 \} \\ S_3(x) &:= S_2(x) \cup \{ y_2 + 1/k_3: y_2 \in S_2, k_3 \geq N_3 \} \\ \vdots \\ S_j(x) &:= S_{j-1}(x) \cup \{ y_{j-1} + 1/k_j: y_{j-1} \in S_{j-1}, k_j \geq N_j \} \\ \vdots \ \end{align*}

Clearly $S_j(x)$ is closed for all $j \geq 0$, every point in $S_{j-1}(x)$ is a limit point of $S_j(x)$, and if $y_j \in S_j(x)$ for $j \geq 1$, $$|f(y_j) - f(x)| < \epsilon(1 - 2^{-j}).$$ We want to show $$S_\infty(x) := \overline{\cup_{j = 0}^\infty S_j(x)}$$ contains some interval $[x, x + \delta)$ for $\delta > 0$, as this will establish uniform continuity of $f$. If $\sum_{k \geq 1} 1/N_k = \infty$, this is simple, so suppose $\sum_{k \geq 1} 1/N_k$ is convergent. WLOG we can assume $2 \leq N_1 \leq N_2 \leq ...$ Then a simple greedy algorithm establishes that if we set $$\delta = \frac{1}{N_1 N_2} + \frac{1}{N_1 N_2 N_3} + ...$$ then every number $y$ with $x < y \leq x + \delta$ can be written as a sum of the form $\sum_{j = 1}^\infty \frac{a_j}{m_j}$, where $a_j \in \{ 0, 1 \}$ and $m_j \geq N_j$ for each $j$. It follows that for such $y$, $|f(y) - f(x)| < \sum_{j = 1}^\infty \frac{\epsilon}{2^j} = \epsilon$. This establishes uniform continuity of $f$.

I haven't worked out the details, but I'm pretty sure you can use an analogous argument to establish that if $\{ a_n \}$ is any sequence converging to $0$ and $f_n(x) := f(x + a_n)$, then uniform convergence of the $f_n$ to $f$ is equivalent to uniform continuity of $f$.

  • 1
    However, for $a_n=3^{-n}$, we have already had a counter-example defined in the answer of @user125932. – William Nov 25 '20 at 06:27
  • @Williampixel I commented explaining why that “counterexample” ends up not working—$f_n$ cannot converge uniformly to $f$. – Rivers McForge Nov 25 '20 at 06:40
  • 1
    I don't think $\delta_\epsilon(x)$ will generally be continuous -- e.g. take $f(x) = x^4 - 2x^2$. Then $\delta_1(0) = 1$, while $\delta_1(x) > 3/2$ for $x$ in a neighborhood of $0$ – user125932 Nov 25 '20 at 07:03
  • @user125932 That's a good point. The assumption $\delta_\epsilon$ being continuous isn't integral to the argument here, though, I don't think; it makes the argument shorter and cleaner, but you can get by without it. I'm going to tidy this answer up later today when I have a work-around. – Rivers McForge Nov 25 '20 at 19:09
  • 1
    You use continuity at "this is possible since $\delta_{100\epsilon}$ is continuous and takes values arbitarily close to zero". Thus, if it is not continuous, then "this" may be impossible. – William Nov 25 '20 at 23:43
  • With the new example we now know that this approach cannot be fixed for discontinuous $\delta_\epsilon$. – supinf Nov 27 '20 at 20:48
  • @supinf The other possibility is that the new example doesn't work, now that I've given a completely reworked answer. – Rivers McForge Nov 28 '20 at 04:56
  • your choice of $\delta$ doesn't seem to work. if, say, $N_1 = 2$ and $N_k = 2^{k+2}$ for $k \geq 2$, then $S_\infty(x)$ is disjoint from $(x + \frac{11}{24}, x + \frac{1}{2})$, even though this is a subset of $[x, x+\delta)$ – user125932 Nov 28 '20 at 08:07
  • @user125932 True, I realize I can't start with $1/N_1$ as the first fraction, but I'm pretty sure if I take that one out, anything smaller is representable now. – Rivers McForge Nov 28 '20 at 16:04
  • It seems that every point in $S_{j-1}$ is a limit point of $S_j$ but $S_{j}$ does not contain $S_{j-1}$, e.g., $S_1$ does not contain $S_0$, so how can $S_j$ be closed if it does not contain some of its limit point? – William Nov 28 '20 at 16:19
  • @Williampixel Fixed! – Rivers McForge Nov 28 '20 at 16:40
  • 1
    I believe my example invalidates this argument, and I think I could give a choice of $N_1, N_2, \dots$ for which $S_\infty(x)$ does not contain any $[x, x+\delta)$, but my first response is: what is your greedy algorithm? the bulk of your argument is hidden in the assumption that there is an algorithm that does what you say it does, but I have no idea what algorithm you're referring to, or why it would succeed in representing all numbers in $[x, x+\delta)$ – user125932 Nov 28 '20 at 22:20
  • I found another mistake: If $N_k=2^{k+2}$ and $y=9$, then there is no way to write $y$ as $\sum_{i=1}^\infty \frac{a_j}{m_j}$, where $a_j\in{0,1}$, $m_j\geq N_j$. – supinf Nov 30 '20 at 09:45
  • I do not think this answer should be deleted, but it would be nice to start with a disclaimer that the current answer does not (yet) constitute a proof, instead of starting with a big bold "Yes". – supinf Nov 30 '20 at 09:47
-2

By assumption, for every $\epsilon >0$, there is an $n_0 \in \Bbb N$ such that for every $x \in \Bbb R$

$$n \geq n_0 \implies \left| f(x) - f \left(x + \frac{1}{n} \right) \right| < \epsilon$$Now if you repeatedly substitute $x = \pm \frac{1}{n}$ in the above inequality, we can conclude that for any two rationals $a,b$ of the form(say $*$-type) $\frac{m}{n}$, where $m,n \in \Bbb Z, n \geq n_0$, we have

$$|f(a)-f(b)| < \epsilon$$

Now observe that the rationals of the form $m,n \in \Bbb Z, 0<n < n_0$ are nowhere dense in $\Bbb R$. Therefore rationals of $*$-type are dense in $\Bbb R$(we are using the fact that the rationals are dense in $\Bbb R$). Since $f$ is continuous, we obtain that for any two real numbers $x,y$

$$|f(x)-f(y)| \leq \epsilon$$

But since $\epsilon$ was arbitrary, we can conclude that $f$ must be a constant function which is trivially uniformly continuous.

  • 3
    If $|f(0)-f(1/n)| < \epsilon$ and $f|(1/n)-f(2/n)| < \epsilon$, then you can only conclude $|f(0)-f(2/n)| < 2\epsilon$ not $|f(0)-f(2/n)| < \epsilon$. Similarly, for any two rationals $a = m/n$ and $b = m'/n$ with $n \ge n_0$, you'll get $|f(a)-f(b)| < |m-m'|\epsilon$.

    Also, note that $f$ does not need to be a constant function. For example, $f(x) = x$ satisfies the condition that $f_n(x) = x+1/n$ converge uniformly to $f(x) = x$.

    – JimmyK4542 Nov 23 '20 at 18:50
  • JimmyK4542 is correct, a simple example $f(x)=x$ must satisfy all conditions in our question, but it is obviously not a constant function. This implies there must be some flaws in your proof. – William Nov 24 '20 at 00:21