Approximating a subclass of $L^2(\mathbb{R})$ by Schwartz functions within similar subclass

It is well-known that real valued Schwartz functions on $$\mathbb{R}_+$$ $$\mathcal{S}(\mathbb{R}_+)$$ are dense in the set of square integrable functions on $$\mathbb{R}_+$$ $$L^2(\mathbb{R}_+)$$. We can further restrict this result to nonnegative functions: any nonnegative $$L^2$$ function on $$\mathbb{R}_+$$ can be approximated by a nonnegative Schwartz function on $$\mathbb{R}_+$$.

Now $$L^2(\mathbb{R}_+)$$ functions can be expanded on the orthonormal basis of Laguerre functions $$\{\mathscr{L}_n\}_{n \in \mathbb{N}}$$ where $$\mathscr{L}_n : x \in \mathbb{R}_+ \mapsto L_n(x) e^{\frac{-x}2}$$ with $$L_n$$ is the n$$^{\text{th}}$$ Laguerre polynomial. So for $$f \in L^2(\mathbb{R}_+)$$ there exists a square integrable sequence $$\{ f_n \} \in \ell^2$$ such that: $$f = \sum_n f_n \mathscr{L}_n.$$ And likewise we can expand a Schwartz function with a rapidly decreasing sequence.

My question is the following: can I approximate a nonnegative $$L^2$$ function on $$\mathbb{R}_+$$ with nonnegative coefficients $$\{ f_n \}$$ by a nonnegative Schwartz function on $$\mathbb{R}_+$$ with again nonnegative coefficients?

My fear is that if one of the coefficient $$f_k$$ is zero then the corresponding sequence of Schwartz functions converging to $$f$$ may have the k$$^{\text{th}}$$ converging to $$f_k$$ from below and thus being negative. So the additional constraint asking for non negative coefficients may be too much (though it would be true if I were asking for positive coefficients).

• What does it mean "positive" in this question: $>0$ or $\geq 0$? Jun 17, 2021 at 13:43
• @AlexandreEremenko considering the OP used both the phrases "positive" and "non-negative" in the post, I am inclined to guess the former. Jun 17, 2021 at 13:47
• @AlexandreEremenko Good catch. As a French person I always use positive to mean $\geq 0$ though I try to use nonnegative to be less confusing and then I end up writing very confusing sentences... I am editing the post. Thanks a lot Jun 17, 2021 at 19:04

With your understanding of "positive", the answer is negative. Take a closed bounded totally disconnected set $$E\subset R$$ of positive measure. Let $$f$$ be the characteristic function of this set. I claim that it is not a sum of positive functions of the Schwartz space. Indeed, suppose that $$f=\sum\phi_n$$ is such a sum (the series is convergent in $$L^2$$. Then evidently we must have $$\phi_n(x)=0$$ for all $$n$$ and for all $$x$$ in the complement of $$E$$. But then $$\phi_n=0$$ since $$\phi_n$$ are continuous and $$E$$ is nowhere dense.
• I am not following. Why taking a sum of positive Schwartz functions? I am wondering about a density result. Take $f \in L^2(\mathbb{R}_+)$ a positive function such that $f = \sum_n f_n \mathscr{L}_n$ with $f_n \geq 0$. Does there exists $\{\phi_n\}$ positive Schwartz functions on $\mathbb{R}_+$ such that $\phi_n \longrightarrow_n f$ and $\phi_n = \sum_k a^n_k \mathscr{L}_k$ wiht $a^n_k \geq 0$ from a certain rank. Jun 18, 2021 at 7:21
Let us follow the way that density is proven: obviously simple non-negative functions are dense (simple means finite linear combination of indicatrix functions of sets with finite measure) in non-negative $$L^2$$ functions. Then the matter is reduced to the approximation of $$\mathbf 1_E$$ for a Borel set $$E$$ with finite measure. Then you can use that for any positive $$\varepsilon$$, there exists $$K$$ compact and $$\Omega$$ open with $$K\subset E\subset \Omega, \quad \mu(E\backslash K)<\varepsilon.$$ Then you can indeed construct a function in $$C^\infty_c(\Omega;[0,1])$$ which is 1 on $$K$$: the latter construction goes explicitly by convolution of $$\mathbf 1_{K+\delta}$$ by a standard mollifier which can be chosen as non-negative.