# Show the existence of a sequence of polynomials that converges to $f$ on any compact subset of $\mathbb{R}$.

If $f$ is continuous function ($f:\mathbb{R}\rightarrow\mathbb{R}$), then there exists a sequence of polynomials which converges to $f$ on any compact subset of $\mathbb{R}$.

Proof: (Weierstrass) If $f$ is a continuous complex function on $[a,b]$, then there exists a sequence of polynomials $P_n$ such that $$\lim_{n\rightarrow\infty}P_n(x)=f(x)$$ uniformly on $[a,b]$.

Assume $K\subset\mathbb{R}$, compact, then it is certainly $K$ is bounded and closed. Since $K$ is bounded, $K$ (in real) contained in some interval. Let $A_n$ be the colosed interval $[-n,n]$, and let $\epsilon_n=1/n$. Then $\forall\epsilon_n>0$, by Weierstrass, there exists some sequence of polynomials $P_n(x)$ such that $\forall x\in A_n$, $|f(x)-P_n(x)|<\epsilon_n$. Using the fact that $$\lim_{n\rightarrow\infty}\epsilon_n=0$$ therefore, this constructed sequence of polynomials $P_n$, converges to $f$ on $K$.

Question: By such a construction, expanding intervals, are we taking subsequence of the previous sequence of polynomials?

• Yes, in general we have a new sequence for every new interval, you can see that by the fact that $f$ may behave irregularly (say, increase or decrease in myriad number of ways in some interval) while polynomials will after some point either increase always or decrease always, so, yes, we must use new polynomials somewhere in the process of expansion of the sequence of intervals, you cannot keep all the time the old ones, maybe some of the old ones will work on some new intervals but only for a limited number of intervals. – user480281 Sep 26 '17 at 15:05
• @AntoinedePaladin Since the "newer" sequence works for this bigger interval, it will certainly, work for the previous interval. I wonder if this "new" sequence would be contained (subsequence) of the previous. So are you saying that it may not be a subsequence? – 2ndaccount Sep 26 '17 at 16:08
• I understood his question in a way that he starts from smaller and then builds larger intervals while you suppose that we have already a sequence of polynomials at a larger intervat. Of course that in your interpretation the sequence will work for all smaller intervals if it works on some bigger interval that contains them. – user480281 Sep 26 '17 at 16:14
• @AntoinedePaladin So by such construction, expanding the intervals, are we taking the subsequence along the way? – 2ndaccount Sep 26 '17 at 16:16
• No, not in general, suppose that you have in interval $[-n,n]$ a sequence of polynomials that does the job. Then in $[-(n+1),(n+1))]$ it could be that none of the polynomials from $[-n,n]$ will work, because it can happen that in $[n,n+1]$ your polynomials wil be increasing while your function may decrease in $[n,n+1]$ as fast as you want to, do you understand? – user480281 Sep 26 '17 at 16:21

A small subtlety is that you should construct the sequence $\{P_n\}$ before you specify your compact set $K$. This will also have the added benefit that uniform convergence on $K$ is easier to see. Let's go through a little more slowly.
Since $[-n,n]$ is compact, there exists a sequence $\{Q_{n,k}\}$ of polynomials such that $Q_{n,k}\to f$ as $k\to\infty$ uniformly on $[-n,n]$. In particular, there exists $k_n$ such that $|Q_{n,k_n}(x)-f(x)|\le\frac1n$ for all $x\in[-n,n]$. Let $P_n:=Q_{n,k_n}$. This is our sequence of polynomials. So the short answer is yes: each interval $[-n,n]$ gives rise to a different sequence of polynomials, but we can choose a single sequence in a clever way which does not depend on the interval.
Now let $K\subset\mathbb R$ be an arbitrary compact set. Then $K\subseteq[-N,N]$ for some $N$. Thus, for every $n\ge N$, if $x\in K$ then $x\in[-n,n]$ and thus $|P_n(x)-f(x)|\le\frac1n$. Notice that $N$ was specified before $x\in K$, so $P_n\to f$ uniformly on $K$.
• Well, you're choosing one $P_n$ from each sequence $\{Q_{n,k}\}$. The idea isn't too different to taking the diagonal subsequence. – Jason Sep 26 '17 at 17:11