TITLE: Analytic approximations of smooth vector fields
QUESTION [5 upvotes]: Let $M$ be the set of smooth divergence-free vector fields $u$ on $\mathbb{R}^3$ with
$$|\partial_x^{\alpha} u(x)| \leq C_{\alpha K}(1+|x|)^{-K}$$
on $\mathbb{R}^3$ for any $\alpha,K$.
Further, we consider the subset of analytic functions $M_0 \subset M$. The question is now, whether for each $u \in M$ and $\varepsilon >0$, there is an $v \in M_0$, such that
$$|u(x)-v(x)| < \varepsilon$$ for each $x \in \mathbb{R}^3$.
As a second question consider $M$ to be the set of smooth divergence-free vector fields $u$ on $\mathbb{R}^3$ with
$$u(x+e_j) = u(x)$$
for all $x \in \mathbb{R}^3$ and $1 \leq j \leq 3$.
Again, consider the subset of analytic functions $M_0 \subset M$. The question here is now again, whether for each $u \in M$ and $\varepsilon >0$, there is an $v \in M_0$, such that
$$|u(x)-v(x)| < \varepsilon$$ for each $x \in \mathbb{R}^3$.
These questions are fairly similar to the Stone-Weierstrass theorem, but it seems it is not possible to derive it directly from it.

REPLY [4 votes]: I believe the most natural approach to this particular question is via Fourier analysis. In the periodic case we have the series
$$u(x)=\sum_{k\in\mathbb{Z}^3}u_k e^{2\pi i (k,x)},$$
and the condition $\nabla\cdot u=0$ simply means $(u_k,k)=0$.
Taking
$$v(x)=\sum_{|k|<K}u_k e^{2\pi i (k,x)}$$
for sufficiently large $K>0$ we can approximate $u$ as close as we want because the Fourier series of a smooth function converges uniformly and very quickly. Obviously, a polynomial $v(x)$ is analytic.
The same trick works in the first case too  except the Fourier series has to be replaced  by the Fourier integral, and the fact that $v$ is  analytic may be a little less obvious (but still true).