Kernel of the operator $\int_{\Omega} \operatorname{div} vq$ Let $B:H^{\operatorname{div}}_0(\Omega) \rightarrow L^2_0(\Omega)$ the operator defined by $$\langle Bv,q\rangle = \int_{\Omega} \operatorname{div}(v) q$$
where $H^{\operatorname{div}v}(\Omega) = \{v \in (L^2)^d: \operatorname{div}v\in L^2 \}$ and $H^{\operatorname{div}}_0(\Omega)=\{v \in H^{\operatorname{div}}(\Omega): \int_{\partial \Omega} v \cdot n = 0\}$
and $L^2_0(\Omega)$ is the set of $L^2$ functions with $0$ mean value. $\Omega$ is a smooth domain.
My Professor wrote that

$\ker(B)=\{ v \in H^{\operatorname{div}}: \operatorname{div}
(v)=0\}$

and I cannot understand why. All I know is that I need to look at the definition of kernel, i.e. $$\int_{\Omega} \operatorname{div}(v) q = 0 \text{ for every }q \in L^2_0$$
but I don't see why this implies that the divergence must be equal to $0$. Could someone enlight me? Any help is highly appreciated :-)
 A: In general, if for some $u\in L^1_{loc}(\Omega)$ you have
$$
\int_\Omega u g\, dx =0,
$$
for every $g\in C_c^\infty(\Omega)$ with mean value zero, then $u$ is (locally) constant. (This is a variant of the fundamental lemma of calculus of variations)
On the other hand, when working with $L^2$ spaces there's typically an easier way to do things. For instance, suppose $u\in L^2(\Omega)$ is such that
$$
\int_\Omega u g\, dx =0,
$$
for all $g\in L^2_0(\Omega)$. This means $u\in [L^2_0(\Omega)]^\perp$, but it's easy to characterize this orthogonal complement since we can always write
$$
g= (g-\text{avg}_\Omega(g))+ \text{avg}_\Omega(g)\in L^2_0(\Omega) \oplus [L^2_0(\Omega)]^\perp.
$$
In other words, said orthogonal complement consists of constant functions.
Therefore, by either of these results, we have that $v\in \ker(B)$ implies $\text{div}(v)=c$ is (locally) constant in $\Omega$. On the other hand, we have
$$
c|\Omega|= \int_\Omega \text{div}(v)\, dx  = \int_{\partial\Omega} v\cdot n\, dS  =0,
$$
which implies $c=0$ as we wanted.
