Let $D$ be a bounded domain of $\mathbb{R}^n$ with smooth boundary $\partial D$. Is the following subspace dense in space $L^2(D)\times L^2(\partial D)$: $$\{(f,f\rvert_{\partial D}) : f\in C^\infty(\overline{D}), (\Delta f)\rvert_{\partial D}=0\}.$$ I tried to use density of $C_c^\infty(D)$ in $L^2(D)$, but I didn't get a final answer. This question was motivated by the density of the subspace $$\{(f,f\rvert_{\partial D}) : f\in C^\infty(\overline{D})\}.$$ Thank you for any hint.

1$\begingroup$ @Fan Zheng do you mean that the space is dense? Sorry, I don't get your hint. $\endgroup$– user135093Sep 14 '19 at 11:09

1$\begingroup$ Yes, and your attempt showed how to approximate when the boundary value is 0. Then you only need to approximate the boundary value in $L^2$, while keeping the Laplacian 0 at the boundary, which can be done using the hint. $\endgroup$– Fan ZhengSep 14 '19 at 12:07

1$\begingroup$ Thank you, this is what I understood: let $(f_n)\subset C^\infty(\overline{D})$ approximating $(f,f\rvert_{\partial D})$. Consider the solution of: $\Delta h_n=0$ on $\overline{D}$ and $h_n\rvert_{\partial D}=f_n\rvert_{\partial D}$. Then $h_n \in C^\infty(\overline{D})$ and $h_n\rvert_{\partial D} \to f\rvert_{\partial D}$. But why $h_n \to f$? $\endgroup$– user135093Sep 14 '19 at 12:51

1$\begingroup$ Sorry, it's "approximating $(f,g)$" in my previous comment. $\endgroup$– user135093Sep 14 '19 at 19:47

1$\begingroup$ $(h_n)$ doesn't converge necessary to $f$, right? $\endgroup$– user135093Sep 15 '19 at 13:09
I believe that Daniele Tampieri's idea of using completeness Fichera's Theorem is the right one. However I think there is a simpler proof. In view of the HahnBanach Theorem, proving the density of the space \begin{equation} \left\{(f,f_{\partial D})\ \ f\in S \right\}, \quad \text{where } S=\left\{ f\in C^{\infty}(\overline{D})\ \ \Delta f_{\partial D} =0 \right\}, \end{equation} in $L^{2}(D)\times L^{2}(\partial D)$ is equivalent to show that, if $(F,G)\in L^{2}(D)\times L^{2}(\partial D)$ is such that \begin{equation} \int_{D}F\, f\, dx + \int_{\partial D}G\, f\, d\sigma = 0 \end{equation} for any $f\in S$, then $F=0$ a.e. in $D$ and $G=0$ a.e. on $\partial D$. So suppose that these orthogonality conditions hold. In particular we have $$ \int_{D}F\, f\, dx = 0 $$ for any $f\in C^{\infty}_{c}(D)$. It is well known that this implies $F=0$ a.e. in $D$. Therefore $$ \int_{\partial D}G\, f\, d\sigma = 0 $$ for any $f\in S$. Harmonic polynomials obviously belong to $S$ and then $$ \int_{\partial D}G\, \omega\, d\sigma = 0 $$ for any harmonic polynomial $\omega$. Fichera's theorem implies $G=0$ a.e. on $\partial D$.

$\begingroup$ @Cialdea Thank you! I tried this method first but I missed Fichera's theorem. Do we need really this theorem? I ask this question because I don't want to add the assumption $\mathbb{R}^n\setminus \overline{D}$ is connected and I didn't see this assumption needed in Fan Zheng's method. Maybe this is not a necessary assumption in this context. $\endgroup$– user135093Sep 18 '19 at 22:25

$\begingroup$ @Dolii you've been mislead by the references I've given in my answer. In the original paper of Fichera, nor $D$ nor $\Bbb R^n\setminus\overline{D}$ need to be connected. Fichera (loc. cit. p. 2) considers explicitly $D$ as a "domain with $p\,(\in \Bbb N)$ holes": however his paper is written in Italian and, to my knowledge, this material has not been translated in English. However, Alberto Cialdea could say something more on this: on my side, I'll add a note to my answer. $\endgroup$ Sep 19 '19 at 5:59

1$\begingroup$ @Dolli You are right, in my proof I was considering domain $D$ such that $\mathbb{R}^n \setminus D$ is connected. If this condition is not satisfied the harmonic polynomials are not dense. However in Fichera's paper also mutiple connected domains are considered. In this case, in order to have the completeness of the system on the boundary, you have to add to harmonic polynomials certain harmonic rational functions whose poles are in the "holes". So my proof works also in this case. You have just to take $\omega$ in this more complicated system. $\endgroup$ Sep 19 '19 at 8:17

1$\begingroup$ @Daniele and Cialdea thank you for the clarification. I meant for my case I think I don't really need the density of harmonic polynomials, maybe a large class is sufficient to conclude without assuming that $\mathbb{R}^n\setminus \overline{D}$ is connected, and I think also that Fichera's theorem is more stronger here. $\endgroup$– user135093Sep 20 '19 at 13:55
This is not an answer, but an elaboration of my comments above.
Let $(f,g)\in L^2(D)\times L^2(\partial D)$. Find $g_n\in C^\infty(\partial D)$ such that $g_n\to g$ in $L^2(\partial D)$. Let $h_n\in C^\infty(\bar D)$ be the harmonic extension of $g_n$ to $\bar D$, i.e., the solution of the Dirichlet problem $\Delta h_n=0$ on $D$ and $h_n=g_n$ on $\partial D$. By classical results such an $h_n$ exists and is unique. I will next assume that
(1) Harmonic extension is a bounded map from $L^2(\partial D)$ to $L^2(D)$.
I believe this is true, at least when $\partial D$ is smooth enough, and I think the book The Dirichlet Problem with L2Boundary Data for Elliptic Linear Equations will be of help, but being far from an expert in elliptic equations with nonsmooth boundary values, I have yet to assemble a proof from a brief glimpse of the book so far. Maybe someone else can help?
Now let's just assume (1), and continue our proof. Using $g_n\to g$ in $L^2(\partial D)$ and (1), we know that $h_n$ converges to some $h\in L^2(D)$. Then $fh\in L^2(D)$, and we can find $F_n \in C_c^\infty(D)$ such that $F_n\to fh$ in $L^2(D)$. Now let $f_n=h_n+F_n$. Then $f_n\in C^\infty(\bar D)$, $f_n\to f$ in $L^2(D)$, $f_n_{\partial D}=h_n_{\partial D}=g_n\to g$ in $L^2(\partial D)$, and $\Delta f_n_{\partial D}=\Delta F_n_{\partial D}=0$.
P.S. It is likely that there is a simpler proof than consulting the Springer book.
The answer is affirmative and as a consequence of the following old result proved by Gaetano Fichera in [4] (see also the survey [2] pp. 5459).
Theorem (Fichera [4]). Let $D$ be a bounded domain in $\Bbb R^n$, $n\ge 2$, with $C^2$ boundary $\partial D$ and such that $\Bbb R^n\setminus\overline{D}$ is connected. Denoting with $\{\omega_k\}_{k\in\Bbb N}$ the sequence of homogeneous harmonic polynomials, the following three properties hold
 $\{\omega_k\}_{k\in\Bbb N}$ is complete in $L^2(\partial D)$
 $\{\partial_\nu\omega_k\}_{k\in\Bbb N}$ is complete in the space $$ \left\{v\in L^2(\partial D)\,\,\Bigg\, \int\limits_{\partial D}v\mathrm{d}\sigma=0\right\} $$
 Given a partition $\Sigma_1, \Sigma_2$ of $\partial D$ (i.e. couple of subsets of $\partial D$ such that $\Sigma_1\cap\Sigma_2=\emptyset$ and $\Sigma_1\cup\Sigma_2=\partial D$), the sequence $\big\{(\omega_k,\partial_\nu \omega_k)\big\}_{k\in\Bbb N}$ is complete in $L^2(\Sigma_1)\times L^2(\Sigma_2)$.
Note. The theorem is stated and proved for domains with $C^2$ boundaries, but Fichera's proof is easily adapted to domains with Lyapunov boundaries, i.e. $C^{1,\alpha}$ boundaries, and by using the methods described by Cialdea ([1], [2]), it can be finally extended to domains with $C^1$ boundaries.
Now, defining $$ \begin{align} \mathscr{C_H^\infty}(\overline{D})&=\big\{ f\in C^\infty(\overline{D}): (\Delta f)\rvert_{\partial D}=0\big\}\\ \operatorname{diag}\mathscr{C_H^\infty}(\overline{D})\times&\mathscr{C_H^\infty}(\overline{D})= \big\{(f,f_{\partial{D}}): f\in\mathscr{C_H^\infty}(\overline{D})\big\} \end{align} $$ as the space of infinitely smooth function with harmonic trace on a domain $D$, by using Fichera's theorem result, for each $(h,g)\in L^2(D)\times L^2(\partial D)$ it is possible to construct a sequence $$ \big\{(f_n,f_n_{\partial D})\big\}_{n\in\Bbb N}\Subset \operatorname{diag}\mathscr{C_H^\infty}(\overline{D})\times\mathscr{C_H^\infty}(\overline{D}),$$ converging to it.
Step 1. Construct an open cover of the domain $D$ such that the open cover $\{U_n\}_{n\in\Bbb N}$ satisfies the following conditions $$ \begin{cases} D_n\Subset D&\\ \operatorname{dist}(D_n,D) \ge \dfrac{\epsilon}{2^n}&\text{for a properly chosen and fixed }\epsilon >0 \\ \end{cases} $$ where $\operatorname{dist}(A,B)$ is the euclidean distance between the two sets $A, B\in\Bbb R^n$.
Step 2. Define $v_n=\sum_{k=0}^n a_k\omega_k$, where $a_k\in\Bbb R$, $k\in\Bbb N$ are the Fourier coefficients of the expansion of $g$ respect to the complete system of homogeneous harmonic polynomials $\{\omega_k\}_{k\in\Bbb N}$ and, as such, $$ \lim_{n\to\infty}\Vert v_n g\Vert_{L^2(\partial D)} = 0 $$ Now put $$ f_n(x)=v_n(x)+\int\limits_{D_n}\psi_{\small\frac{\epsilon}{2^{n+1}}}\big(xy\big)\big[h(y)v_n(y)\big]\mathrm{d}y\quad\forall n\in\Bbb N $$ where $\psi_\cdot$ is the standard mollifier in $\Bbb R^n$: the sequence $\{f_n\}_{n\in\Bbb N}$ defines the sequence $\big\{(f_n,f_n_{\partial D})\big\}_{n\in\Bbb N}$ which clearly satisfies the following limit requirement $$ \lim_{n\to\infty}\big\Vert(f_n,f_n_{\partial D})(h,g)\big\Vert_{L^2(D)\times L^2(\partial D)}=0\quad \forall (h,g)\in L^2(D)\times L^2(\partial D). $$
Notes
 The intuition of Fang Zheng was the spark that triggered my proof: while difficult to apply as it was stated, his correct suggestion made me remember of the completeness in the sense of Picone for polynomial solutions of PDEs, and the circle of ideas that was developed by his school, notably Gaetano Fichera and his pupil Alberto Cialdea. In particular, the papers [1], [2] and [3] give state of the art results as well as an historical survey and relevant references. Apart from this, this kind of procedure is common when using the variational approch for the solution of PDE problems, since it avoids the PrymHadamard phenomenon.
 Edit: Fichera's theorem does not require $D$ nor $\Bbb R^n\setminus\overline{D}$ to be connected: Fichera himself ([4] p. 2) precises this by describing $D$ as a domain with $p$ holes, $p\in\Bbb N$.
 Statement 1 and 2 of Fichera's theorem are easily extendible to the space $L^p(\partial D)$, $1\le p\le+\infty$. For statement 3, things are different: while holding true for any $1\le p\le 2$ as implied by the $p=2$ proof, its validity for $p>2$ is still an open problem. However, this implies that $$ \operatorname{diag}\mathscr{C_H^\infty}(\overline{D})\times\mathscr{C_H^\infty}(\overline{D})\text{ is dense in }L^p(D)\times L^p(\partial D) $$
 Note that $\Delta f_n\neq 0$ for all $(h,g)\in L^2(D)\times L^2(\partial D)$ (or $L^p(D)\times L^p(\partial D)$, $1\le p\le\infty$) for all $x\in\overline{D}$ but only in a neighborhood of $\partial D$. Requiring $f_n$ to be harmonic on the whole $D$ implies the failure of the density property as simple counterexamples can show.
[1] Cialdea, Alberto, Completeness theorems for elliptic equations of higher order with constant coefficients, Georgian Mathematical Journal 14, No. 1, 8197 (2007). MR2323374, Zbl 1135.42333.
[2] Cialdea, Alberto, Completeness theorems in the uniform norm connected to elliptic equations of higher order with constant coefficients, Analysis and Applications (Singapore) 10, No. 1, 120 (2012). MR2876933, Zbl 1243.42043.
[3] Cialdea, Alberto, Completeness Theorems: an example of the legacy of Gaetano Fichera, in: C. Sbordone (Ed.) Equazioni a derivate parziali nell'opera di Gaetano Fichera, Quaderno n. 60 Accademia Pontaniana, Giannini Editore Napoli, 4968 (2014).
[4] Fichera, Gaetano, Teoremi di completezza sulla frontiera di un dominio per taluni sistemi di funzioni, Annali di Matematica Pura ed Applicata, IV. Serie 27, 128 (1948). MR0029014, Zbl 0035.34801.

1$\begingroup$ Thank you so much for the complete and valuable answer. I need more time to understand some details. I think it's somehow equivalent to what is proposed by Fan Zheng and maybe the missed part in his answer is as in my last comment. What do you think. $\endgroup$– user135093Sep 17 '19 at 17:33

1$\begingroup$ Thank you very much. The comments, if not the answer, of @FanZheng have inspired mine, mostly because I've tried (and perhaps succeeded) to provide a simple explicit construction of the approximating functions on $\partial D$. Notably, the possibility of approximating any $g\in L^p(\partial D)$ by harmonic polynomials shows that the $(\Delta f)_{\partial D}=0$ condition can be satisfied in a classical sense on a neighborhood ranging from a distance of $\epsilon/2^{n+1}$ from the boundary inside $D$ to the whole $\Bbb R^n\setminus D$: I think this is my main contribution. $\endgroup$ Sep 18 '19 at 8:50