Solution (source code)

= Solution

Work in the <mean-zero Sobolev space>
$$
H=\left\{v\in H^1(U):\int_Uv=0\right\},\qquad a(u,v)=\int_U\nabla u\cdot\nabla v.
$$
The integral is a continuous functional on $H^1(U)$, so $H$ is closed. The <Neumann-Poincare inequality> shows that $\|v\|_a=\|\nabla v\|_2$ is equivalent to the usual $H^1$ <norm> on $H$, making $a$ a complete <inner product> there.

For $f\in L^2(U)$ the functional $L(v)=\int_Ufv$ satisfies
$$
|L(v)|\leq\|f\|_2\|v\|_2\leq\sqrt{C_P}\|f\|_2\|v\|_a.
$$
The <Riesz representation theorem>, or the <Lax-Milgram theorem>, gives a unique $u\in H$ with $a(u,v)=L(v)$ for all $v\in H$. To recover every $H^1(U)$ test, write $v=(v-v_U)+v_U$. The constant contributes zero to $a$ and contributes $v_U\int_Uf=0$ to $L$. Thus the same equality holds for all $v\in H^1(U)$.

\b[A <weak solution> exists whenever $\int_Uf=0$; fixing its average to zero makes it unique.] Moreover $\|\nabla u\|_2\leq\sqrt{C_P}\|f\|_2$ and the <Neumann-Poincare inequality> also controls $\|u\|_2$.