TITLE: If $\varphi_n$ converges pointwise to $f$, then does $\varphi'_n=\max_{1\leq j \leq n}\varphi_j$ converge pointwise to $f$?
QUESTION [0 upvotes]: Let $f:X\to [0,\infty]$ be a function, and let $\{\varphi_n\}_{n=1}^\infty$ converge pointwise to $f$, i.e., $\forall x\in X \ ; \ \displaystyle\lim_{n\to \infty}\varphi_n(x)=f(x)$.
If we define a sequence of functions $\{\varphi'_n\}_{n=1}^\infty$ by $\displaystyle\varphi_n'(x)=\max_{1\leqq j \leqq n}\varphi_j (x)$, then does $\{\varphi'_n\}_{n=1}^\infty$ converge pointwise to $f$ ?

This fact is used in between formula $(3)$ to formula $(4)$ in http://mathonline.wikidot.com/the-simple-function-approximation-theorem, but I cannot see this is correct.
What I have to show is ; $$\forall x\in X \ ; \ \lim_{n\to \infty} \varphi'_n(x)=f(x).$$
Let $x\in X.$
Since $\{\varphi_n\}_{n=1}^\infty$ converges pointwise to $f$, $\displaystyle\lim_{n\to\infty}\varphi_n(x)=f(x)$.
For each $n$, let $j_n$ be a natural number s.t. $\displaystyle \max_{1\leqq j \leqq n} \varphi_j(x)=\varphi_{j_n}(x)$.
Then, $\displaystyle 
\lim_{n\to \infty}\varphi'_n(x)
=\lim_{n\to \infty}\ \max_{1\leqq j \leqq n} \varphi_j(x)
=\lim_{n\to \infty}\varphi_{j_n}(x).$
So, if I can see $\lim_{n\to \infty}\varphi_{j_n}(x)=f(x)$, this proof will finish, but I can see it.
Thanks for any idea.

REPLY [2 votes]: This is not in general true.
For example, consider $\varphi_n(x) = 1/n$ so that $\varphi_n' = \varphi_1 \equiv 1$ even though $\varphi_n \rightarrow 0$ pointwise.
The crucial point in the linked page is that $\varphi_n \leq f_n \leq f$.
In this was, for any $x$, we can see that $\varphi_n(x) \leq \varphi_n'(x) \leq f(x)$, where $\varphi_n(x) \rightarrow f(x)$.
It then follows from the sandwich theorem that $\varphi_n'(x) \rightarrow f(x)$.
{"set_name": "stack_exchange", "score": 0, "question_id": 4561798}