# Pointwise convergence of uniformly continuous functions to zero, but not uniformly

What would be an example of a sequence of uniformly continuous functions on a compact domain which converges pointwise to $$0$$, but not uniformly?

• The functions $f_n(x)=x^n$ defined on $[0,1)$ form an example. – Suzet Jul 28 '19 at 14:27
• @Suzet I forgot, I want the domain to be compact. – Jannik Pitt Jul 28 '19 at 14:30

Consider $$f_n(x)=1-\min(1,n|x-1/n|)=\begin{cases} nx&\text{ if }x<\frac{1}{n}\\2-nx&\text{ if }\frac1{n}\leq x\leq\frac{2}{n}\\0&\text{ otherwise.}\end{cases}$$ Each $$f_n$$ is continuous on the compact set $$[0,1]$$ and therefore it is also uniformly continuous. Moreover, $$f_n(x)\to 0$$ for any $$x\in [0,1]$$, but the convergence is not uniform on $$[0,1]$$ because $$\max_{x\in[0,1]}|f_n(x)|=f(1/n))=1$$.
The another standard one is the growing steeple on $$[0,1]$$:
$$f_n(x)=\begin{cases}n^2 x &\text{if}\;0 \leq x \leq \frac{1}{n}\\ 2n-n^2 x &\text{if}\;\frac{1}{n} \leq x \leq \frac{2}{n}\\ 0 &\text{if}\;\frac{2}{n} \leq x \leq 1 \end{cases}$$
Then each $$f_n$$ is uniformly continuous and also the limit is zero, but the convergence is not uniform.
Added: It is easy to visualize the graph of $$f_n$$. Actually each $$f_n$$ is a triangle with height $$n$$ attained at $$1/n$$
Take$$\begin{array}{rccc}f_n\colon&[0,1]&\longrightarrow&\mathbb R\\&x&\mapsto&nx^n(1-x).\end{array}$$The sequence $$(f_n)_{n\in\mathbb N}$$ converges pointwise to the null function, but not uniformly, since$$(\forall n\in\mathbb N):f_n\left(\frac n{n+1}\right)=\left(\frac n{n+1}\right)^{n+1}$$and $$\lim_{n\to\infty}\left(\frac n{n+1}\right)^{n+1}=e^{-1}$$.