Uniform convergence for sequences of functions

Please help me out with this problem:

Let $f_n(x) : [0,1] \to \mathbb R$ be a sequence of continuous functions convergent at every $x \in [0,1]$ to a continuous function $f: [0,1] \to \mathbb R$ . Does $f_n$ converge uniformly to $f$?

My first solution: I read this example in a different question posted earlier and I think it works: Take a sequence $f_n:[0,1] \to \mathbb R$ such that $f_n$ increases linearly from $0$ to $1$ on the interval $\left[ 0,\frac{1}{n} \right]$, decreases linearly from $1$ to $0$ on the intreval $\left[ \frac{1}{n}, \frac{2}{n} \right]$, and is $0$ on $\left[ \frac{2}{n},1 \right]$. Then $f_{n} \to 0$ nonuniformly.

Is this answer true? Also, if anyone can give some examples of such function with detailed proof, I will very appreciative?


The answer is no; Dini's theorem says : if $f_n$ is a sequence defined on a set S, with limit f, where f is continuous, then there are four conditions none of which can be removed for convergence to be uniform (i.e., all four must be satisfied to guarantee that convergence is uniform): 1)${f_n}$ must be continuous, for all n. ii) f itself is continuous on S. iii) The convergence is strictly increasing or strictly-decreasing. iv)S is compact.

And all conditions are necessary (from "Counterexamples"). . Let i'), ii') iii') and iv') be counterexamples for when condition i) fails. Then:

If i) fails:

i') $f_n(x)=0$ if x=0 , or if $\frac{1}{n}<x<1$ , and ,$f_n(x)=1$ otherwise

ii')f(x)=$x^n$ on [0,1]

iii')$f_n(x)$=$2n^2 x$ in $[0,\frac{1}{2n}]$ ; $f_n(x)=n-2n^2(x-\frac{1}{2n})$ , in $[\frac{1}{2n},\frac {1}{n}]$ , and $f_n(x)=0$ otherwise

iv')The sequence ${x^n}$ on $[0,1)$


Conside the sequence of functions defined by $$f_n(x) = \left\{ \begin{array}{ll} n^2x & \mbox{if } 0 \leq x < \frac{1}{n} \\ -n^2\left(x-\frac{2}{n}\right) & \mbox{if } \frac{1}{n} \leq x < \frac{2}{n}\\ 0 & \mbox{if } \frac{2}{n} \leq x \leq 1\\ \end{array} \right.$$ This is a sequence of continuous functions that converge to the continuous function $0$ but not uniformly.