# Possible density of Schwartz Functions in the space of continuous functions vanishing at infinity

While reading about Function Spaces here ; from the chain of inclusions I had some questions that: whether $\mathcal{S}(\mathbb R^{n})$ (the Schwartz class of functions) is included in $C_{0} (\mathbb R^{n})$ (Space of all continuous functions vanishing at infinity) AND if affirmative, is the inclusion is dense?? i.e. Can we approximate a function in $C_{0} (\mathbb R^{n})$ by a sequence of functions in $\mathcal{S}(\mathbb R^{n})$ uniformly???

I found an article here .

So my question is: Can we approximate a function in $C_{0} (\mathbb R^{n})$ by a sequence of functions in $\mathcal{S}(\mathbb R^{n})$ uniformly???

Yes, $\mathcal{S}(\mathbb{R}^n)$ is dense in $C_0(\mathbb{R}^n)$.

Let $f$ be in $C_0(\mathbb{R}^n)$. Recall that this implies that $f$ is uniformly continuous.

Your claim is easy using mollifiers. Let me show you how this works.

Pick a smooth positive function $\psi$ with support contained in the open unit ball $B_1(0)$ such that $\int_{\mathbb{R}^n} \psi = 1$. Notice that $\psi$ is clearly a Schwartz function. For $\delta>0$ we define $\psi_\delta(x)=\frac1{\delta^n} \psi(\frac x{\delta})$.

Then $\psi_{\delta}$ is supported inside $B_\delta(0)$ and $\int_{\mathbb{R}^n} \psi_\delta=1$ (this is why we multiplied by $\delta^{-n}$). So as $\delta$ tends to zero, $\psi_\delta$ becomes more concentrated around the origin. Define

$$f_\delta := f*\psi_\delta.$$

Then $f_\delta\in\mathcal{S}(\mathbb{R}^n)$, because $\psi_\delta$ is Schwartz. We claim that $f_\delta\to f$ in $C_0(\mathbb{R}^n)$ as $\delta\to 0$.

Let $\varepsilon>0$. Since $f$ is uniformly continuous, there exists $\delta_0>0$ such that $|f(x)-f(y)|<\varepsilon$ for all $|x-y|<\delta_0$. Thus, if $\delta<\delta_0$ we have for $x\in\mathbb{R}^n$ arbitrary:

$$|f*\psi_\delta(x)-f(x)| \le \int_{\mathbb{R}^n} |\psi_\delta(y)(f(x-y)-f(x))| dy< \varepsilon\int_{\mathbb{R}^n} \psi_\delta(y) dy=\varepsilon.$$

In the first inequality we used the triangle inequality and used that $\int_{\mathbb{R}^n} \psi_\delta = 1$. In the second inequality we used that $\psi_\delta$ is supported in $B_\delta(0)$.

This proves the claim.

• So, a function in $C_{0}(\mathbb R^{n})$ can be approximated by a sequence of functions in $\mathcal S(\mathbb R^{n})$ uniformly; So,$\mathcal S(\mathbb R^{n})$ is dense in $C_{0}(\mathbb R^{n})$. Isn't it?? – user92360 Nov 23 '15 at 9:51
• Yes, that is correct. – J.R. Nov 23 '15 at 9:55
• So, with due respect may I suggest you to edit the first line of your answer..?? – user92360 Nov 23 '15 at 10:03
• Oh, now I see, horrible typo. Sorry. – J.R. Nov 23 '15 at 10:05

There is something I don't understand in J.R.'s answer. I don't see why $f_\delta$ must be Schwartz. Take, in one dimension, $f(x)=1/(1+x^2)$. It's easy to see that for $\delta$ small one has $f_\delta(x) \ge f(x)/2$, hence $f_\delta$ is not Schwartz. Alternatively, the Fourier transform of $f_\delta$ is $$\widehat{f_\delta} = \widehat f \; \widehat{\psi_\delta} = c e^{-|x|} \; \widehat{\psi_\delta}$$ which is not Schwartz, since it is not $C^\infty$. Thus $f_\delta$ cannot be Schwartz. Probably one must truncate $f$ before applying the mollifier.

• Rather comment on his answer than answering yourself. – user370967 Apr 3 '17 at 8:37
• I know, I tried that, but my reputation apparently is not good enough for posting a comment to somebody's answer. – brian0 Apr 3 '17 at 9:03