# Prove that $\lim f_n(x_n) = f(x), x_n\rightarrow x,$ then $f_n\rightarrow f$ uniformly on compact

From an exercise list:

Prove that if a sequence of continuous functions $f_n:X\rightarrow \mathbb{R}$ is such that $x_n\in X$, $\lim x_n = x \in X \Rightarrow \lim f_n(x_n) = f(x)$, then $f_n\rightarrow f$ uniformly on every compact subset of $X$.

This question is very similar to this and also this one. But in this case, it is not in the hypothesis that $f$ is continuous.

Is it possible to prove that $f$ is continuous only using the hypothesis of my problem? Or this result is not valid and there is actually a conterexample for this exercise. For me, the result does not seem valid if $f$ is not continuous.

The following is selfcontained; it does not refer to earlier questions and answers on MSE.

Lemma. Let $X$ be a compact metric space, and let $(g_n)_{n\geq1}$ be a sequence of functions $g_n:\>X\to{\mathbb R}$ satisfying $\lim_{n\to \infty}g_n(x_n)=0$ whenever the sequence $(x_n)_{n\geq1}$ is convergent to some $x\in X$. Then the $g_n$ converge to $0$ uniformly in $X$.

Proof. If not, there is an $\epsilon_0>0$, such that for each $n\geq1$ you can find a point $x_n\in X$ with $|g(x_n)|\geq\epsilon_0$. Since $X$ is compact there is a point $\xi\in X$ and a subsequence $y_k:=x_{n_k}$ $(k\geq1)$ such that $\lim_{k\to\infty} y_k=\xi$. As $|f(y_k)|\geq \epsilon_0$ for all $k$ this violates the central assumption of the Lemma.

Assume now that we are given a sequence of continuous functions $f_n:\>X\to{\mathbb R}$ and a function $f:\>X\to{\mathbb R}$, such that $\lim_{n\to \infty}f_n(x_n)=f(x)$ whenever the sequence $(x_n)_{n\geq1}$ is convergent to some $x\in X$. The auxiliary functions $g_n:=f_n-f$ then satisfy the assumptions of the Lemma. We therefore can conclude that the $f_n$ converge uniformly to $f$, which then in turn implies that $f$ is continuous.

• The function f is not supposed to be bounded how do you define $sup_{x\in X} |f_n(x)-f(x)|$ Oct 14, 2022 at 15:03
• In the proof of your lemma what is this g ? Oct 14, 2022 at 15:30

Let us suppose there is a compact set $K$ on which $f_n$ does not converge to $f$ uniformly. If $f$ is continuous on $K$, then the linked questions show that there is a convergent sequence $x_n\to x$ such that $f_n(x_n)$ does not converge to $f(x)$. Now suppose $f$ is not continuous on $K$. That means there is some $x\in K$, some $\epsilon>0$ and a sequence of points $y_k\in K$ converging $x$ such that $|f(y_k)-f(x)|>\epsilon$ for all $k$. For each $k$, let $N(k)$ be such that $|f_n(y_k)-f(y_k)|<\epsilon/2$ for all $n>N(k)$.

Now define $k(n)$ to be the largest integer $k$ such that $N(k)<n$, if such a largest $k$ exists. If no largest such $k$ exists because there are infinitely many such $k$, just define $k(n)=k$ for some such $k$ with $k\geq n$. If no largest such $k$ exists because no such $k$ exists, let $k(n)=1$. Note that this last case can only happen for finitely many $n$ (since as soon as $n>N(1)$, there exists at least one such $k$). Note furthermore that $k(n)\to\infty$ as $n\to\infty$, since for any $m$, $k(n)\geq m$ for any $n$ such that $n>N(m)$ and $n\geq m$.

Now define $x_n=y_{k(n)}$. By construction, we have $|f_n(x_n)-f(x_n)|<\epsilon/2$ for all but finitely many $n$. Since $|f(y_k)-f(x)|>\epsilon$ for all $k$, it follows that $|f_n(x_n)-f(x)|>\epsilon/2$ for all but finitely many $n$. Since $k(n)\to\infty$ as $n\to\infty$ and $y_k\to x$ as $k\to\infty$, we have $x_n\to x$ as $n\to\infty$. It follows that $(x_n)$ is a sequence converging to $x$ such that $f_n(x_n)$ does not converge to $f(x)$.