When does pointwise convergence imply uniform convergence?

On an exam question (Question 21H), it is claimed that if $K$ is compact and $f_n : K \to \mathbb{R}$ are continuous functions increasing pointwise to a continuous function $f : K \to \mathbb{R}$, then $f_n$ converges to $f$ uniformly. I have tried proving this claim for the better part of an hour but I keep coming short. I suspect a hypothesis on equicontinuity has been omitted — partly because the first half of the question is about the Arzelà–Ascoli theorem — but I don't have access to the errata for the exam so I can't be sure.

Here is my attempted proof: let $g_n = f - f_n$, so that $(g_n)$ is a sequence of continuous functions decreasing pointwise to $0$. Clearly, $0 \le \cdots \le \| g_n \| \le \| g_{n-1} \| \le \cdots \le \| g_1 \|$, so we must have $\| g_n \| \longrightarrow L$ for some constant $L$. $K$ is compact, so for each $g_n$, there is an $x_n \in K$ such that $g_n(x_n) = \| g_n \|$, and there is a convergent subsequence with $x_{n_k} \longrightarrow x$ for some $x \in K$. By hypothesis, $g_n(x) \longrightarrow 0$, and by construction $g_{n_k} (x_{n_k}) \longrightarrow L$. I'd like to conclude that $L = 0$, but to do this I would need to know that the two sequences have the same limit. This is true if, say, $\{ g_n \}$ is an equicontinuous family, but this isn't one of the hypotheses, so I'm stuck.


The result is true as stated and is called Dini's Theorem. A proof can be found in Chapter III, Section 1.4 of these notes or indeed in this wikipedia article. (My notes are for a sophomore-junior level undergraduate class, so it is stated in the case in which $K$ is a closed interval. But it is clear that the argument works for any compact topological space.)

(For some reason this is one of those named theorems that tends to be assigned as an exercise or come up on exams...)


$\textbf{Dini's Theorem (with some extra conditions):}$ Let $K$ be a compact subset of $\mathbb{R}$ and suppose $f:K \to \mathbb{R}$ is continuous. Let $\{f_n\}$ be a monotonically decreasing sequence of continuous functions such that $f_n(x) \to f(x)$ pointwise. Prove that $f_n(x) \to f(x)$ uniformly.

$\textbf{Proof:}$ We want to show that $\forall \epsilon >0$ $\exists N$ such that $\forall n \ge N$ and $\forall x \in K$, $$|f_n(x) - f(x) | < \epsilon$$

Let $g_n(x) = f_n(x) - f(x)$. Then since $f_n(x) \searrow f(x)$ point wise we have that $g_n(x)$ is a monotonically decreasing sequence of continuous function. Now let $\epsilon > 0$ be fixed but arbitrary. We want to show the existence $N$ to satisfy the conditions of uniform convergence. Let, $$ E_n := \{ x \in K : g_n(x) = f_n(x) - f(x) < \epsilon \}$$ Then $E_n$ is open because it is the pre image of the continuous functions $g_n(x)$. Notice that $g_n(x)$ is continuous as it is the difference of continuous functions. We claim that $E_n$ is an ascending sequence of open sets. That is, $$ E_0 \subset E_1 \subset \dots \subset E_n \subset \dots$$ The sequence is ascending because $g_n(x)$ is decreasing. That is if $x \in E_n$, then $g_n(x) < \epsilon$, but this implies that $g_{n+1} (x) < \epsilon$, and so $x \in E_n$ implies that $x \in E_{n+1}$. Now as $n \to \infty$, we have that $g_n(x) \to 0$. Since $g_n(x) = 0 < \epsilon$, we have that the sets of $x \in K$ such that $g_n(x) < \epsilon$ will eventually be all of $K$. Thus, $$ \bigcup_{n=1}^{\infty} E_n \supset K$$ and so the above union is an open cover of $K$. Since $K$ is compact, there exists a finite subcover, such that, $$ \bigcup_{n=1}^N E_n \supset K$$ At this point, we should be happy as we have an appearance of $N$. Remember we are looking for $N$. $$K \subset \bigcup_{n=1}^N E_n$$ implies that $\forall x \in K$, we have that $|g_n(x)|= | f_n(x) - f(x)| < \epsilon$ Since $g_n(x)$ is decreasing, this immediately gives us that $\forall x \in K$, $\forall n > N$, $|f_n(x) - f(x)| < \epsilon$. Thus we have show $f_n(x)$ converge to $f(x)$ for arbitrary $\epsilon$ and so we are finished.