Tensor products of functions generate dense subspace? Let $X$ and $Y$ be two spaces in certain category, $F(\cdot)$ a functor associating each space with a function space (with certain topology). Assume that for any $f\in F(X)$ and $g\in F(Y)$, $f\otimes g := f(x)g(y)\in F(X\times Y)$. Denote by $F(X)\otimes F(Y)$ the closed subspace of $F(X\times Y)$ generated by functions of the form $f\otimes g$.

General Question:  When do we have $F(X\times Y)=F(X)\otimes F(Y)$?

Applying Stone-Weierstrass theorem, we obtain an example:

Theorem: Let $X$ and $Y$ be compact Hausdorff spaces, $C(X)$ and $C(Y)$ the space of continuous functions on X and Y respectively, then we have $C(X\times Y)=C(X)\otimes C(Y)$.

As one can imagine, this type of results could be very useful in reducing multi-dimensional problems into one-dimensional problems. The following are two concrete questions asking for validity of the identity (and they are the true purpose of this post).

Question I: $C^{\infty}_c(\mathbb{R}\times \mathbb{R})=C^{\infty}_c(\mathbb{R})\otimes C^{\infty}_c(\mathbb{R})$?

and

Question II: $\mathscr{S}(\mathbb{R}\times \mathbb{R})=\mathscr{S}(\mathbb{R})\otimes \mathscr{S}(\mathbb{R})$?

Here $C^{\infty}_c(\mathbb{R})$ denotes the space of smooth functions with compact support, $\mathscr{S}(\mathbb{R})$ denotes the Schwartz space.
 A: Question I: Let $\varphi\in C^{\infty}_c(\mathbb R\times \mathbb R)$. The support of $\varphi$
 is contained in $A\times B$ where $A$ and $B$ are two compact subsets of 
 $\mathbb R$. Let $b_1$ and $b_2$ bump function with $b_1=1$ on $A$ and $b_2=1$
 on $B$. Let $K_1$ the support of $b_1$ and $K_2$ the support of $b_2$. Thanks to Stone-Weierstrass theorem, we can find a sequence of polynomials 
 $\{P_n\}$ such that $\partial^{\alpha}P_n$ converges uniformly on $K_1\times K_2$ to 
 $\partial^{\alpha}\varphi$ for each $\alpha\in\mathbb N^2$. Now put $\varphi_n(x,y):=b_1(x)b_2(y)P_n(x,y)$. Then $\varphi_n\in C_c^{\infty}(\mathbb R)
 \otimes C_c^{\infty}(\mathbb R)$ since we can write $$ P_n(x,y) 
 =\sum_{\alpha_1+ \alpha_2\leq d_n}a_{\alpha_1,\alpha_2}b_1(x)x^{\alpha_1}b_2(y)y^{\alpha_2},$$ where $d_n\in\mathbb N$ and 
 $a_{\alpha_1,\alpha_2}\in\mathbb C$. We can check that $\{\varphi_n\}$ converges 
 to $\varphi$ in $C_c^{\infty}(\mathbb R\times \mathbb R)$: $\operatorname{supp}
 \varphi_n\subset K_1\times K_2$ and the Leibniz rule shows that for each $\alpha 
 \in\mathbb N^2$, the sequence $\{\partial^{\alpha}\varphi_n\}$ converges uniformly 
 on $K_1\times K_2$ to $\partial^{\alpha}\varphi$.  
Question II: We show that $C_c^{\infty}(\mathbb R^2)$ is a dense subspace of $\mathcal S(\mathbb R^2)$. Let $\chi\in C_c^{\infty}(\mathbb R^2)$ such that $\chi(u)=1$ 
 if $\lVert u\rVert \leq 1$, and put $\chi_R(x,y):=\chi\left(\frac xR,\frac yR\right)$. 
 Now let $\varphi\in \mathcal S(\mathbb R^2)$. We put $\varphi_R(x,y)=
 \chi_R(x,y)\varphi(x,y)$, and we can see thanks to the Leibniz rule that 
 $\sup_{(x,y)\in\mathbb R^2}|x^{\alpha_1}y^{\alpha_2}\partial ^{\beta}
 (\varphi(x,y)-\varphi_R(x,y))|\leq C_{\alpha,\beta}R^{-1}+\sup_{x^2+y^2\geq R}|
 x^{\alpha_1}y^{\alpha_2}\partial^{\beta}\varphi(x,y)|$, hence that the 
 sequence $\{\varphi_n\}$ converge to $\varphi$ in $\mathcal S(\mathbb R^2)$. 
Now, we can, for each $n$, find a sequence $\{\varphi_{n,k}\}_k\subset 
 C_c^{\infty}(\mathbb R)\otimes C_c^{\infty}(\mathbb R)\subset 
 \mathcal S(\mathbb R)\otimes \mathcal S(\mathbb R)$ which converges to 
 $\varphi_n$ in $C_c^{\infty}(\mathbb R^2)$. We fix $\varphi\in
 \mathcal S(\mathbb R^2)$, $\varepsilon>0$ and $\alpha,\beta\in\mathbb N^2$. 
 We can find a $n$ such that $\sup_{(x,y)\in\mathbb R^2}|x^{\alpha_1}y^{\alpha_1}\partial^{\beta}(\varphi(x,y)-\varphi_n(x,y))|
 \leq \frac{\varepsilon}2$, and since $\{\varphi_{n,k}\}$ converges to $\varphi_n$
 in $C_c^{\infty}(\mathbb R^2)$, we can find a compact subset $K$ of $\mathbb R^2$ such that the sequence $\{\partial^{\beta}\varphi_{n,k}\}$ converges uniformly on $K$ to $\partial^{\beta}\varphi_n$, and since $K$ is compact 
 $$\sup_{(x,y)\in\mathbb R^2}|x^{\alpha_1}y^{\alpha_1}\partial^{\beta}(\varphi_n(x,y)-\varphi_{n,k}(x,y))|
 \leq \sup_{(x,y)\in K}\lVert (x,y)\rVert
 \sup_{(x,y)\in\mathbb R^2}|\partial^{\beta}(\varphi(x,y)-\varphi_n(x,y))|.$$
 We pick $k$ such that $$\sup_{(x,y)\in\mathbb R^2}|\partial^{\beta}(\varphi(x,y)-\varphi_n(x,y))|\leq \dfrac{\varepsilon}{2\sup_{(x,y)\in K}\lVert (x,y)\rVert},$$ therefore 
 $$\sup_{(x,y)\in\mathbb R^2}|x^{\alpha_1}y^{\alpha_1}\partial^{\beta}(\varphi(x,y)-\varphi_{n,k}(x,y))|\leq\varepsilon.$$
