# Is $C_c^\infty$ dense in $W^{1,p}\cap C_0$?

Let $$\Omega\subset\mathbb{R}^N$$ be a bounded open set. I was wondering if $$C_c^\infty(\Omega)$$ is dense in $$W^{1,p}(\Omega)\cap C_0(\Omega)$$ with $$1\leq p<\infty$$.

Here $$C_0(\Omega)$$ is the space of functions of $$C(\overline{\Omega})$$ which are zero on $$\partial\Omega$$, and the space $$W^{1,p}(\Omega)\cap C_0(\Omega)$$ is endowed with the norm $$\|\cdot\|_{W^{1,p}}+\|\cdot\|_{L^\infty}$$.

Take a function $$f$$ and convolve with a Mollifier $$\phi_{\epsilon}$$ and convert it into compactly supported smooth function $$(1_{B_r(0)} \times f) * \phi_{\epsilon}$$ where $$1_{B_r(0)}$$ is an indicator function of compact set $$Closure(B_r(0))$$. It is known that $$\lim_{\epsilon \rightarrow 0} \lim_{r \rightarrow \infty} (1_{B_r(0)} \times f) * \phi_{\epsilon} \rightarrow f.$$ Since $$\Omega$$ is a bounded set, we dont have to worry about compactness since $$f|_{\partial \Omega} = 0$$. We now prove that closure of $$C^{\infty}(\Omega + B_{\epsilon}(0))$$ (when functions are restricted to $$\Omega$$) contains $$W^{1,p}(\Omega) \cap C_0(\Omega)$$. Hence enough to prove: $$f * \phi_{\epsilon} \rightarrow f$$ Let $$f \in C_0(\Omega)$$, $$f_{\epsilon}(x)-f(x) = \int (f(x-y)-f(x)) \phi_{\epsilon}(y) dy$$ $$|f_{\epsilon}(x)-f(x)| \leq \int |f(x-y)-f(x)| \phi_{\epsilon}(y) dy$$ Since $$f$$ is uniformly continuous as $$\Omega$$ is a bounded set and $$f|_{\partial \Omega} = 0$$ and since $$\phi_{\epsilon}$$ is supported in the set $$B_{\epsilon}(0)$$, we have by choosing $$\epsilon$$ sufficiently small: $$|f_{\epsilon}(x)-f(x)| \leq \epsilon_f \int \phi_{\epsilon}(y) dy$$ $$|f_{\epsilon}(x)-f(x)| \leq \epsilon_f$$ Hence $$f_{\epsilon} \rightarrow f$$ uniformly.

By uniform convergence, we also have that, $$\int |f_{\epsilon}(x)-f(x)|^p dx \leq \epsilon_f^p \times \mu(\Omega)$$ Hence $$f_{\epsilon} \rightarrow f$$ in $$L_p$$.

Now observe that: $$f'_{\epsilon}(x) = \int f'(x-y) \phi_{\epsilon}(y) dy$$ and we repeat the same proof as above to conclude that $$f_{\epsilon} \rightarrow f$$ in $$||.||_{W^{1,p}} + ||.||_{L_{\infty}}$$. To repeat the proof, we might need the condition $$f'$$ is continuous and $$f'|_{\partial \Omega} = 0$$ OR $$f'$$ is uniformly continuous. Try this out and let me know.

Hence any $$f_{\epsilon} \rightarrow f$$ for any $$f \in W^{1,p}(\Omega) \cap C_0(\Omega)$$

You can also find some materials in: http://wwwarchive.math.psu.edu/anovikov/acm105/mollifiers.pdf

EDIT: The idea is to work with $$\Omega'$$ where $$\Omega'$$ is slightly larger than $$\Omega$$ such that $$Closure(\Omega) \subset M \subset \Omega'$$ where $$M$$ is a compact set. Extend the $$L_p$$ function $$f'$$ to $$\Omega'$$. we need to set $$f'(x) = 0$$, $$\forall x \in \Omega' \setminus \Omega$$. Using density of $$C(\Omega')$$ in $$L^p(\Omega')$$, one can approximate $$f'$$ by a continuous function $$g$$ on $$\Omega'$$ and approximate the continuous function $$g$$ by smooth function $$g_{\epsilon}$$ on $$Closure(\Omega)$$ by using uniform continuity of $$g$$ on $$M$$ and use the inequality $$|f'_{\epsilon}-g_{\epsilon}|_{L_p(\Omega)} \leq |f'-g|_{L_p(M)}$$ and show that $$f'_{\epsilon} \rightarrow f'$$ on $$\Omega$$ by triangle inequality. Thus completing the proof by observing $$|f'-g|_{L_p(\Omega)} \leq |f'-g|_{L_p(M)} \leq |f'-g|_{L_p(\Omega')}$$.
The following link has some of the above details. See Theorem 1.28,Page 18,19, in https://www.math.ucdavis.edu/~hunter/m218a_09/Lp_and_Sobolev_notes.pdf

EDIT: In the above we have proved that closure of $$C^{\infty}( \Omega + B_{\epsilon}(0))$$ (when functions are restricted to $$\Omega$$) contains $$W^{1,p} \cap C_0(\Omega)$$. Please see below for the argument that $$C_{c}^{\infty}(\Omega)$$ (smooth function on compact set) is dense.

Its enough to prove $$(f 1_K) * \phi_{\epsilon} \rightarrow f * \phi_{\epsilon}$$ i.e., $$(f 1_{\Omega \setminus K}) * \phi_{\epsilon} \rightarrow 0$$. Now $$|(f 1_{\Omega \setminus K}) * \phi_{\epsilon}| = |\int (f 1_{\Omega \setminus K})(x-y) * \phi_{\epsilon}(y) dy| \leq \int |(f 1_{\Omega \setminus K})(x-y)| * \phi_{\epsilon}(y) dy.$$ Since $$f|_{\partial \Omega} = 0$$ and $$\Omega$$ is a bounded set, by uniform continuity of $$f$$, there exists $$K = K_{\gamma, \epsilon} \subset \Omega$$, $$K_{\gamma, \epsilon}$$ compact such that $$|f(x)| \leq \gamma \epsilon^{n+1}$$, $$\forall x \in \Omega \setminus K_{\gamma, \epsilon}$$. Note that $$|\phi_{\epsilon}(y)| \leq 1/\epsilon^n$$ (see pdf in the link above). Using this, we get: $$|(f 1_{\Omega \setminus K}) * \phi_{\epsilon} (x)|\leq \int |(f 1_{\Omega \setminus K})(x-y)| * \phi_{\epsilon}(y) dy \leq \gamma \epsilon \mu(\Omega).$$ To prove derivative, converges use exactly same argument with $$\phi'_{\epsilon}$$ in place of $$\phi_{\epsilon}$$ and use $$|\phi'_{\epsilon}(y)| \leq 1/\epsilon^{n+1}$$.

EDIT: As @rubik pointed out in the comments the proof is correct/complete when we have $$\mu(\Omega \setminus K_{\frac{3}{2} \times d_{\gamma}})^{1/p} \leq constant \times d_{\gamma}.$$ as $$d_{\gamma} \rightarrow 0$$, where we can define: $$K_{d} = \{x: x \in \Omega, dist(x,\partial \Omega) \geq d\}$$ and set $$K_{\gamma,\epsilon} = K_{d_{\gamma}}$$ for $$d_{\gamma}$$ which depends on continuity of $$f$$ at the boundary. This is true atleast for open balls/rectangles of any radius $$r$$ in any $$N$$ dimensional space when $$p=1$$.

• Thanks for your ideas and materials. It is true that the function $f_\epsilon=f*\phi_\epsilon$ with $\phi_\epsilon$ the standard mollifier satisfies $f_\epsilon\to f$ in $W^{1,p}(\Omega)\cap C_0(\Omega)$. However, $f_\epsilon\in C^\infty(\mathbb{R}^N)$, not in $C_c^\infty(\Omega)$. In this way, it seems that one needs to think about how to approximate $C^\infty$ by $C_c^\infty$ in the $W^{1.p}$ sense (the problem mainly lies in the approximation of the gradient). Nov 28, 2022 at 11:05
• This seems true for open balls/rectangles of radius< 1, for any $N$, for $p=1$ as $d \rightarrow 0$. So i think what you want is true for $p=1$ for these specific domains (Balls/rectangles of radius <1). Dec 1, 2022 at 4:40
• Thanks for your update. Indeed, it seems to be "yes" for balls or rectangles. Focusing on the ratio $|\Omega-K|^{1/p}/d$ appeared in our derivation, it seems to be possibly bounded only if $p=1$. Actually, take $K=\{x\in\Omega:d(x)>\epsilon\}$ where $d(x)=dist(x,\partial\Omega)$. By the coarea formula, $|\Omega-K|=\int_0^\epsilon\mathcal{H}^{N-1}(d^{-1}(t))$. By the isoperimetric ineq, $\mathcal{H}^{N-1}(d^{-1}(t))\ge C(n)|\{x\in\Omega:d(x)>t\}|^{(N-1)/N}\ge C(|K|,n)$ for a.e. t; So $|\Omega-K|^{1/p}/\epsilon\ge C(n,|K|)\epsilon^{1/p-1}$, which is possibly bounded only if $p=1$. Dec 4, 2022 at 6:37
• By the way, I'd like to mention that the mollification process $f*\phi_\epsilon\to f$ in $W^{1,p}$ seems not necessarily valid for any $\Omega$. Since during the process, we regarded $f$ as 0 outside $\Omega$. This extension can't guarantee $Df$ is still in $L^p$. So, generally, that approximation of the gradient works locally. You can check a relevant book to see how to construct a global approximation (partition of unity would be used, see the result that "$C^\infty$ is dense in $W^{1,p}$"). Dec 4, 2022 at 9:04
• Anyway, the above process works if we know the trivial extension is valid for $Df$, like when $f\in W_0^{1,p}$. This can be guaranteed by assuming $\Omega$ to be Lipschitz, for which the trace characterization tells that $W^{1,p}\cap C_0\subset W_0^{1,p}$. In addition, if $p>N$ then it holds the Sobolev embedding $W_0^{1,p}\hookrightarrow C^{0,\alpha}(\overline{\Omega})$. Clearly, this fact could affirmatively answer the question. As for arbitrary $\Omega$, the corresponding conclusions remain to explore. Let's expect to see that soon. Dec 4, 2022 at 9:26