[proofplan]
Subtract the two weak formulations and study the difference $w := u_1 - u_2$. The difference satisfies a homogeneous variational identity, and testing that identity with $w$ gives vanishing Dirichlet energy. Since $w \in H_0^1(U)$, Poincare's inequality converts the vanishing gradient into vanishing $L^2$ norm, so the full $H_0^1$ norm of $w$ is zero.
[/proofplan]
[step:Subtract the two weak formulations to obtain a homogeneous identity]
Define $w \in H_0^1(U)$ by $w := u_1 - u_2$. This is valid because $H_0^1(U)$ is a [vector space](/page/Vector%20Space) and $u_1,u_2 \in H_0^1(U)$.
Let $v \in H_0^1(U)$ be arbitrary. Since both $u_1$ and $u_2$ solve the weak problem with the same datum $f$, we have
\begin{align*}
\int_U \nabla u_1 \cdot \nabla v \, d\mathcal{L}^n(x) = \int_U f v \, d\mathcal{L}^n(x)
\end{align*}
and
\begin{align*}
\int_U \nabla u_2 \cdot \nabla v \, d\mathcal{L}^n(x) = \int_U f v \, d\mathcal{L}^n(x).
\end{align*}
Subtracting the second identity from the first and using linearity of the weak gradient gives
\begin{align*}
\int_U \nabla w \cdot \nabla v \, d\mathcal{L}^n(x) = 0.
\end{align*}
Thus $w$ satisfies the homogeneous weak equation against every [test function](/page/Test%20Function) $v \in H_0^1(U)$.
[/step]
[step:Test the homogeneous identity with the difference]
Since $w \in H_0^1(U)$, we may choose $v := w$ in the homogeneous identity. This gives
\begin{align*}
\int_U |\nabla w|^2 \, d\mathcal{L}^n(x) = 0.
\end{align*}
The integrand $|\nabla w|^2$ is nonnegative and belongs to $L^1(U)$ because $w \in H_0^1(U)$. Hence $|\nabla w|^2 = 0$ $\mathcal{L}^n$-a.e. on $U$, and therefore
\begin{align*}
\|\nabla w\|_{L^2(U)} = 0.
\end{align*}
[guided]
The homogeneous variational identity says that the Dirichlet energy pairing of $w$ with every $H_0^1(U)$ test function vanishes:
\begin{align*}
\int_U \nabla w \cdot \nabla v \, d\mathcal{L}^n(x) = 0
\end{align*}
for every $v \in H_0^1(U)$. The most informative test function is the unknown itself. This is allowed because $w := u_1 - u_2$ lies in $H_0^1(U)$, since $H_0^1(U)$ is closed under subtraction.
Taking $v := w$ gives
\begin{align*}
\int_U \nabla w \cdot \nabla w \, d\mathcal{L}^n(x) = 0.
\end{align*}
By the Euclidean [inner product](/page/Inner%20Product) identity $\nabla w \cdot \nabla w = |\nabla w|^2$, this becomes
\begin{align*}
\int_U |\nabla w|^2 \, d\mathcal{L}^n(x) = 0.
\end{align*}
Because $w \in H_0^1(U)$, each weak partial derivative $\partial_{x_i} w$ belongs to $L^2(U)$, so $|\nabla w|^2$ belongs to $L^1(U)$. Since the integrand is nonnegative, the vanishing of its [Lebesgue integral](/page/Lebesgue%20Integral) implies $|\nabla w|^2 = 0$ $\mathcal{L}^n$-a.e. on $U$. Equivalently,
\begin{align*}
\|\nabla w\|_{L^2(U)} = 0.
\end{align*}
[/guided]
[/step]
[step:Use the zero boundary condition to force the difference to vanish]
By the Poincare inequality for $H_0^1$ functions on bounded open sets (citing a result not yet in the wiki: Poincare inequality for $H_0^1$ on bounded open sets), there exists a constant $C_U > 0$, depending only on $U$, such that every $\varphi \in H_0^1(U)$ satisfies
\begin{align*}
\|\varphi\|_{L^2(U)} \leq C_U \|\nabla \varphi\|_{L^2(U)}.
\end{align*}
Applying this to $\varphi := w$ gives
\begin{align*}
\|w\|_{L^2(U)} \leq C_U \|\nabla w\|_{L^2(U)} = 0.
\end{align*}
Hence $\|w\|_{L^2(U)} = 0$.
The $H_0^1(U)$ norm of $w$ is therefore zero:
\begin{align*}
\|w\|_{H_0^1(U)}^2 = \|w\|_{L^2(U)}^2 + \|\nabla w\|_{L^2(U)}^2 = 0.
\end{align*}
Thus $w = 0$ in $H_0^1(U)$. Since $w = u_1 - u_2$, we conclude that $u_1 = u_2$ in $H_0^1(U)$.
[/step]