# Approximation of continuous functions by functions continuous with Compact support

Can we approximate a function $f\in\mathcal C_0 (\mathbb R^q)$ (continuous function with limit equal $0$ in infinity) get equipped with the supremum norm by a function $g\in\mathcal C_c(\mathbb R^q)$ (function continuous with a compact support) also get equipped with the supremum norm ?

In other word : $\forall f\in\mathcal C_0 (\mathbb R^q),\ \ \forall\epsilon>0, \ \ \exists?g\in\mathcal C_c (\mathbb R^q), \parallel f-g \parallel_\infty <\epsilon$

If it is possible what is the argument for doing that ? Stone-Weierstrass ? References are welcomed.

• What norm are you using? The supremum norm? – Ian Aug 24 '16 at 14:57
• Yes I've just corrected – Al Bundy Aug 24 '16 at 15:00

You can prove this in a simple way:

For each $R>0$ pick a continuous function $f_R$ such that $0 \leq f \leq1; f=1$ on $B_R(0)$ and $f=0$ outside $B_{R+1}(0)$.

Now, show that for each $g \in C_0(\mathbb R^d)$ you have $$\lim_{R \to \infty} f_R \cdot g =g$$ and $f_R \cdot g \in C_C(\mathbb R^d)$.

• Just about notation : $B_R(0)$ is the closed ball centered in $0$ with radius $R$ ? – Al Bundy Aug 24 '16 at 15:20
• @the-owner Yes. Or the open ball, it makes no difference for the proof. – N. S. Aug 24 '16 at 15:21
• Another question : On $B_{R+1}(0)\cap B_{R}(0)$ is it important/crucial for $f_R$ to be in $[0,1]$ as you have written ? and why ? – Al Bundy Aug 24 '16 at 16:16
• @the-owner It is important for these functions to be (equi-) bounded. Otherwise, $f_R\cdot g -g$ could be very large in this region, and this would make $\| f_R\cdot g -g \|_\infty$ large. But as long as there exists some constant $C$ such that $|f_R| \leq C$ everything works. – N. S. Aug 24 '16 at 16:19
• The $f_R$ here should be continuous. This is one way to mollify a function, but it is less powerful than mollification by convolution (which can give you derivatives). But you don't need derivatives here, so this is fine. – Ian Aug 24 '16 at 19:15

Assuming you mean the supremum norm, that's not that complicated. Given $f$ and $\epsilon>0$, choose $M$ such that if $|x|>M$ then $|f(x)|<\epsilon/2$. Introduce $g_0=f 1_{|x| \leq M}$. $g_0$ is compactly supported but not continuous. Now use a standard mollifier to find a function $g$ which is uniformly within $\epsilon/2$ of $g_0$ but which is continuous. $g$ will have a slightly larger support than $g_0$ but still a compact support.

• "Now use a standard mollifier to find a function $g$ which is uniformly" you mean find a sequence $g_n$ that tend uniformly to $g$ ? – Al Bundy Aug 24 '16 at 17:16
• @the-owner You don't really need the full sequence; the function you're looking for is an element of such a sequence, however. (What I'm describing here is not really any different than the other answer, by the way.) – Ian Aug 24 '16 at 17:42
• But don't we need $g_0$ to be continuous on the $M$-borders if we want $g_0$ compactly supported ? – Al Bundy Aug 24 '16 at 18:24
• ... because on $\mathbb R^n$ every compact are bounded & closed ? – Al Bundy Aug 24 '16 at 18:49
• $f$ is the given function in $C_0$. Its support is closed but typically not compact. But the intersection of a closed set with a compact set is compact. Thus the support of $g_0$ is compact. – Ian Aug 24 '16 at 19:14