Solution (source code)

= Solution

Suppose the claimed <Poincare-Wirtinger inequality> were false. There would be $u_k\in H^1(U)$ such that, after setting
$$
v_k=\frac{u_k-(u_k)_U}{\|u_k-(u_k)_U\|_{L^2(U)}},
$$
we have $(v_k)_U=0$, $\|v_k\|_2=1$, and $\|Dv_k\|_2\to0$. The sequence is bounded in $H^1(U)$, so part 1(b)(ii) supplies a subsequence converging strongly in $L^2(U)$ and weakly in $H^1(U)$ to some $v$.

The weak <gradient> of $v$ is zero. Because $U$ is <connected>, $v$ is a <constant function>; its mean is zero, so $v=0$. Strong convergence would then give $\|v_k\|_2\to0$, contradicting $\|v_k\|_2=1$. Therefore
$$
\boxed{\|u-u_U\|_{L^2(U)}\leq C_1\|Du\|_{L^2(U)}.}
$$