# Dense subspace of the space of functions vanishing at infinity

How can I show that the space of smooth functions with compact support, $C^{\infty}_K$, is dense in the space of continuous functions vanishing at infinity equipped with the supremum norm, $(C_0,|| \cdot ||_{\infty})$ ?

I already know that the space of continuous functions with compact support, $C^0_K$, is dense in $C_0$, so it suffices to show that $C^{\infty}_K$ is dense in $C^0_K$.

I'll assume we are talking about functions on the real line. Fix $f\in C_0(\mathbb R)$. The fact that $f$ is $C_0$ allows us to write it as a uniform limit of continuous functions with compact support. So now we can assume without loss of generality that $f$ is continuous with compact support.

Start with $h(x)=\begin{cases}e^{-1/x^2},&\ x>0\\0,&\ x\leq0\end{cases}$.

Next you notice that $h(x)h(1-x)\in C^\infty_K$, with support in $[0,1]$. We can normalize it so that $\int_{\mathbb R} h=1$. Then, for each $\varepsilon>0$, you take $$h_\varepsilon(x)=\frac1\varepsilon\,h\left(\frac x\varepsilon\right)$$ and you note that $\int_{\mathbb R}h_\varepsilon=\int_{\mathbb R}h=1$.

Now form the convolutions $$f_\varepsilon(x)=\int_{\mathbb R}f(t)\,h_\varepsilon(x-t)\,dt.$$ It is not hard to show that because $h_\varepsilon\in C^\infty$ we have $f_\varepsilon\in C^\infty$; and because $f$ and $h_\varepsilon$ have compact support, so does $f_\varepsilon$.

Finally, given $\varepsilon>0$, as $f$ is continuous with compact support, it is uniformly continuous. So given $c>0$ there exists $\delta>0$ such that $|f(x)-f(y)|<c$ if $|x-y|<\delta$. Then \begin{align*} |f_\varepsilon(x)-f(x)|&=\left|\int_{\mathbb R} [f(x-t)-f(x)]\,h_\varepsilon(t)\,dt\right| \leq\int_{\mathbb R} |f(x-t)-f(x)|\,h_\varepsilon(t)\,dt\\ &\leq c\,\int_{|t|<\delta} h_\varepsilon(t)\,dt +2\|f\|_\infty\,\int_{|t|\geq\delta}h_\varepsilon(t)\,dt\\ &=c +2\|f\|_\infty\,\int_{|t|\geq\delta}h_\varepsilon(t)\,dt. \end{align*} with $\delta$ fixed, the last integral goes to zero as $\varepsilon\to0$ (because the support of $h_\varepsilon$ is contained in $[0,\varepsilon]$). Thus $$\limsup_{\varepsilon\to0}|f_\varepsilon(x)-f(x)|\leq c$$ for all $x$ and all $c>0$. So $\|f_\varepsilon-f\|_\infty\to0$.

Hint: use the theorem of stone-weirstrass

• Thanks, didn't think of that ! But, how can we make sure that polynomials remain infinitely differentiable on the boundary of the compact set ? – Nocturne Oct 25 '15 at 23:38
• mathworld.wolfram.com/Stone-WeierstrassTheorem.html – Tsemo Aristide Oct 25 '15 at 23:58
• Exactly: if $X$ is any compact space... How are you going to "glue" the endpoints of your polynomial from your compact set to extend it as zero to the rest of the line? As I said, polynomials do not have compact support. – Martin Argerami Oct 26 '15 at 0:01
• Who is talking about polynomials here, if f vanishes at infinity, consider $f_n$ a function which coincides with the restriction of f to B(0,n) obtained by multiplying f with a cut off function $L_n$ the smooth functions with compact support in B(0,n) is dense in B(0,n) by stone weirstrass since it contains the constants and separate the points. so you have $g_n$ in $L_n$ such that $\| f_n-g_n\|<\epsilon/2$, you also have $\|f-g_n\|\leq \|f-f_n\|+\| f_n-g_n\|$ you can take n enough big such that $\| f-f_n\|<\epsilon/2$ since f vanishes at infinity – Tsemo Aristide Oct 26 '15 at 0:18
• My bad about polynomials. I still don't see how you extend your $g_n$ to a $C^\infty$ function in all of $\mathbb R$. – Martin Argerami Oct 26 '15 at 0:24