Let
- $d\in\mathbb N$
- $\Omega\subseteq\mathbb R^d$ be open
- $\mathcal D:=C_c^\infty(\Omega,\mathbb R^d)$ and $$\mathfrak D:=\left\{u\in\mathcal D:\nabla\cdot u=0\right\}$$
- $H:=H_0^1(\Omega,\mathbb R^d)$, $\mathcal H:=\overline{\mathfrak D}^{\left\|\;\cdot\;\right\|_{L^2(\Omega)}}$ and $$\mathcal V:=H\cap\mathcal H$$
How can we show that $\mathcal V=\overline{\mathfrak D}^{\left\|\;\cdot\;\right\|_H}$?
Let $\tilde V$ denote the closure of $\mathfrak D$ with respect to the $H^1$-norm. We want to show $\mathcal V = \tilde V$. Clearly, $\tilde V$ is a closed subspace of $\mathcal V$.
Now let $f\in \mathcal V$ be given such that $f(v)=0$ for all $v\in \tilde V$. This holds in particular for all $v\in \mathfrak D$. Hence it follows that $f$ is a gradient, i.e., there exists $p\in L^2(\Omega)$ such that $f=\nabla p$. See for instance the book by Temam on Navier-Stokes equations, Ch 1, Propositions 1.1 and 1.2. This is actually the hard part in the proof.
Since $f=\nabla p$, it follows $f(v)=0$ for all $v\in \mathcal V$. Hence $f=0$ and $\tilde V$ is dense in $\mathcal V$. Both spaces are closed, this proves $\tilde V=\mathcal V$.