# example of a sequence of functions $f_n \rightarrow f$ pointwise but $\sup f_n \nrightarrow \sup f$

What would be an easy example of a sequence of functions defined on a compact interval so that $f_n$ goes to $f$ pointwise but $\sup f_n$ does not go to $sup f$.

I thought of the usual example we take to show that the limits in integration can't be interchanged when we only have pointwise convergence. Is this correct?

Does $f(x)=x^n$ work in this context? Any comments or hints?

-
$f_n(x)=x^n$ won't work on $[0,1]$ (as I assume you want); since the limit function has value $1$ at $x=1$. –  David Mitra Jan 11 '13 at 0:41

Consider the functions $f_n$ defined on $[0,1]$, where $f_n$ is the function whose graph consists of the following straight line segments: from $(0,0)$ to $(1/n,1)$, from $(1/n,1)$ to $(2/n,0)$, and from $(2/n,0)$ to $(1,0)$.

Note that $(f_n)$ converges pointwise to the zero function on $[0,1]$.

-
Thanks for your answer. I thought of the same example with one exception: $(0,0), (1/n,n), (2/n,0) and (1,0)$. Then $f_n$ still goes to zero pointwise and the max of $f_n$ is not finite. But then how does this not contradict the fact that a continuous function on compact intervals attains a finite max? (of course I mean my example, not yours). Yours is fine. :) –  Jack Dawkins Jan 11 '13 at 0:51
@user54755 That is true for your functions... (the supremum of the max's is not finite, which can certainly happen if the convergence isn't uniform) –  David Mitra Jan 11 '13 at 0:57
My example is still correct right?. Because $sup f_n$ goes to infinity and $sup f$ is zero? –  Jack Dawkins Jan 11 '13 at 0:59
@user54755 Yes, it's perfectly fine. –  David Mitra Jan 11 '13 at 1:00

Let $f_n(x)=0$ if $x<n$ and $1$ if $x\geq n$. Then $f_n\to 0$ pointwise, but $\sup f_n = 1$ for all $n$.

You can get continuous examples easily enough.

-
It seems the OP wants functions whose domain is of the form $[a,b]$. –  David Mitra Jan 11 '13 at 0:38

Let's $f:[0,1]\to \mathbb{R}$. Set $f_n(x)=x^n$ if $x<1-\frac{1}{n}$ and $f_n(x)=0$ if $x\geq 1-\frac{1}{n}$. Note that $\lim_{n\to\infty}f_n=f\equiv 0$ Then $$\sup_{x}f_n(x)=1-\frac{1}{n} \mbox{ and } \sup_{x}f(x)=0$$

-