TITLE: Dini's Theorem - Proof.
QUESTION [16 upvotes]: I'd like to prove the following:
If $f_j$ are continuous functions on a compact set $K$, and $f_{1}(x) \leq f_{2}(x) \leq \dots$ for all $x \in K$, and the $f_j$ converge pointwise to a continuous function $f$ on $K$ then in fact the $f_j$ converge uniformly to $f$ on $K$.
Attempt:
Let $g_{j}(x) = f(x) - f_{j}(x)$ for all $j$. Then, since $f_j \rightarrow f$ pointwise, we see $g_j \rightarrow 0$ pointwise.
Now, let $\varepsilon > 0$ . And examine { $x \in K : g_{j}(x) < \varepsilon$ }.
I've been told that the next step should be to  show that { $x \in K : g_{j}(x) < \varepsilon$ } is equal to the intersection of $K$ with some open set $U_j$. But I'm not certain why this is true? 
Advice? Insight?

REPLY [5 votes]: Adding a slighly different proof (same idea though), mainly for the sake of documenting it for myself and so I won't forget the theorem:
First let $t \in K$ be fixed. Note that monotonicity of the sequence $f_j(t)$ and its convergence to $f(t)$ implies that $f_j(t) \leq f(t)$.  
For $\delta >0$, we define $U_\delta(t) = \left\{\tilde{t} \in K: |\tilde{t}-t|< \delta\right\}$.
Now pick $\varepsilon > 0$, and pick $N_t$ and $\delta_t > 0$ such that:

$$\left|f_n(t) - f(t)\right| \leq \frac{\varepsilon}{3} \; \forall \; n\geq N_t$$
$$\left|f_{N_t}(\tilde{t}) - f_{N_t}(t)\right| \leq  \frac{\varepsilon}{3} \; \forall \; \tilde{t} \in U_{\delta_t}(t)$$
$$\left|f(\tilde{t}) - f(t)\right| \leq  \frac{\varepsilon}{3} \; \forall \; \tilde{t} \in U_{\delta_t}(t)$$

These exist by the pointwise convergence and the continuity of $f_{N_t}$ and $f$.
It now holds for every $n \geq N_t$:
$$
\sup_{\tilde{t} \in U_{\delta_t}(t)} | f(\tilde{t}) - f_n(\tilde{t})|=\sup_{\tilde{t} \in U_{\delta_t}(t)} f(\tilde{t})-f_n(\tilde{t}) 
\leq  \sup_{\tilde{t} \in U_{\delta_t}(t)} f(\tilde{t}) - f_{N_t}(\tilde{t}) 
\leq  f(t) - f_{N_t}(t) + 2\frac{\varepsilon}{3} 
\leq \varepsilon
$$
Finally, notice that $\displaystyle\bigcup_{t \in K} U_{\delta_t}(t) \supset K$ is an open cover of $K$. Compactness yields $t_1, \dotsc, t_r \in K$ such that $$\displaystyle\bigcup_{i \in \{1,\dotsc,r\}} U_{\delta_{t_i}}(t_i) \supset K$$
Now just take $N:= \max\{N_{t_1},\dotsc, N_{t_r}\}$ to finish the proof.