Two different definitions of "energy space" I am wondering whether the following two constructions actually define the same space. 
Construction 1 (taken from Lieb-Loss Analysis, 2nd ed., section 8.2). Define $D^1(\mathbb{R}^n)$ to be the space of all functions $f\in L^1_{\mathrm{loc}}$ whose distributional gradient $\nabla f$ belongs to $L^2$ and that vanish at infinity, meaning that the level sets $\{\lvert f \rvert > a\}$ have finite measure for all $a>0$. Let 
$$\lVert f\rVert_{D^1}^2=\int_{\mathbb{R}^n} \lvert \nabla f(x)\rvert^2\, dx.$$
Construction 2 (taken from T.Tao Nonlinear dispersive equations, Appendix A). Define $\dot{H}^1(\mathbb{R}^n)$ to be the completion of the Schwartz class $\mathscr{S}(\mathbb{R}^n)$ with respect to the norm 
$$\lVert f \rVert_{\dot{H}^1}^2=\int_{\mathbb{R}^n} \lvert \nabla f(x)\rvert^2\, dx.$$
I guess that the answer is affirmative. The proof of this guess amounts to showing that the Schwartz class is dense in $D^1(\mathbb{R^n})$. This should use in some essential way the "vanish at infinity" condition.
 A: Recall the standard Gagliardo-Nirenberg-Sobolev inequality, valid for $1\leq p<n$, 
$$
\| u\|_{L^{p^*}(\mathbb{R}^n)} \leq C\| \nabla u\|_{L^p(\mathbb{R}^n)}, \qquad u\in W^{1,p}(\mathbb{R}^n).
$$
Here $p^*=np/(n-p)$ is the Sobolev exponent. 
This implies that $\dot{H}^1 (\mathbb{R}^n)=\{ u\in L^{2^*}(\mathbb{R}^n): \nabla u\in L^2(\mathbb{R}^n)\}$, so it suffices to show that if $u\in D^1(\mathbb{R}^n)$ then $u\in L^{2^*}(\mathbb{R}^n)$. Take such an $u$ and define
$$
u_n:= \min\{ \max\{ |u|-1/n,0\}, n-1/n\}.
$$
We have that $u_n\in W^{1,1}_{loc}(\mathbb{R}^n)$ and $|\nabla u_n|= |\nabla u|1_{1/n<|u|<n}$, so that clearly $\nabla u_n\in L^2(\mathbb{R}^n)$. Now to estimate $u_n$ we see that
$$
\int_{\mathbb{R}^n} |u_n|^{p} dx = \int_{|u|>1/n} |u_n|^{p}dx \leq (n-1/n)^{p}m(\{ |u|>1/n\}) <\infty.    
$$
We conclude that $u_n\in L^p(\mathbb{R}^n)$ for all $1<p<\infty$, in particular $u_n\in H^1(\mathbb{R}^n)$ so that the usual GNS inequality applies and we get
$$
\| u_n\|_{L^{2^*}(\mathbb{R}^n)} \leq C \| \nabla u_n\|_{L^2(\mathbb{R}^n)} \leq C\| \nabla u\|_{L^2(\mathbb{R}^n)}.
$$
Now just apply Fatou's lemma on the left hand side.
Note: What we prove is that GNS inequality continues to hold for functions in $D^1(\mathbb{R}^n)$.
