# compact convergence on a non-compact metric space implies continuity

$$\textbf{Proposition: }$$Let $$(X,d_X)$$ and $$(Y,d_Y)$$ be metric spaces. Let $$(f_n)_{n\in\mathbb{N}}$$ be a sequence of continuous functions from $$X$$ to $$Y$$ which is pointwise convergent to some $$f:X\to Y$$. If $$X$$ is not compact, but the convergence $$f_n \to f$$ is uniform on every compact subset of $$X$$, then $$f$$ is continuous.

$$\textbf{Proof:}$$ We know that if the convergence $$f_n\to f$$ is uniform on $$K\subset X$$, then $$f$$ is continuous on $$K$$.

Choose an $$a\in X$$. Let $$x_n\to a$$. We will show that $$f(x_n) \to f(a)$$.

Because $$A=\{x_n\}_{n\in\mathbb{N}} \cup \{a\}$$ is compact, $$f$$ will be continuous on $$A$$. Hence $$f(x_n)\to f(a)$$.

Is this proof correct?

• I added my question. Aug 22, 2019 at 18:39
• I see. You might want to add the proof-verification tag :) Yes, indeed, your proof is correct. Aug 22, 2019 at 18:41
• Oh, allright. Thank you :) I thought it was too simple to be correct and that I'd missed something. Aug 22, 2019 at 18:42
• Nicely done. ................. Aug 22, 2019 at 19:19