[proofplan]
We subtract the fixed boundary datum $g$ and reduce the claim to weak closedness of $W^{1,p}_0(U)$ inside $W^{1,p}(U)$. The space $W^{1,p}_0(U)$ is a norm-closed linear subspace by definition as the norm closure of $C_c^\infty(U)$. A norm-closed linear subspace of a [Banach space](/page/Banach%20Space) is weakly closed, which follows from Hahn-Banach separation for a point outside a closed subspace. Applying this to $u_k-g\rightharpoonup u-g$ gives $u-g\in W^{1,p}_0(U)$, hence $u\in\mathcal A_g$.
[/proofplan]
custom_env
admin
[step:Subtract the fixed boundary datum and identify the reduced sequence]
Let
\begin{align*}
X:=W^{1,p}(U)
\end{align*}
with its usual Sobolev norm, and let
\begin{align*}
Y:=W^{1,p}_0(U)\subset X.
\end{align*}
For each $k\in\mathbb N$, define
\begin{align*}
v_k:=u_k-g\in X.
\end{align*}
Since $u_k\in\mathcal A_g$, the definition of $\mathcal A_g$ gives $v_k\in Y$ for every $k\in\mathbb N$.
We claim that
\begin{align*}
v_k\rightharpoonup u-g
\end{align*}
in $X$. Let $\Phi\in X^*$ be an arbitrary continuous linear functional. Since $u_k\rightharpoonup u$ in $X$, we have $\Phi(u_k)\to \Phi(u)$. By linearity of $\Phi$,
\begin{align*}
\Phi(v_k)=\Phi(u_k-g)=\Phi(u_k)-\Phi(g).
\end{align*}
Passing to the limit gives
\begin{align*}
\lim_{k\to\infty}\Phi(v_k)=\Phi(u)-\Phi(g)=\Phi(u-g).
\end{align*}
Since this holds for every $\Phi\in X^*$, the sequence $(v_k)_{k=1}^{\infty}$ converges weakly to $u-g$ in $X$.
[/step]
custom_env
admin
[step:Use Hahn-Banach separation to show that $W^{1,p}_0(U)$ is weakly closed]By the definition of $W^{1,p}_0(U)$ in the theorem statement, $Y=W^{1,p}_0(U)$ is the closure of $C_c^\infty(U)$ in the norm of $X=W^{1,p}(U)$. Hence $Y$ is norm-closed in $X$. Since $C_c^\infty(U)$ is a linear subspace of $X$, its norm closure $Y$ is also a linear subspace of $X$.
We now use the standard consequence of the [Hahn-Banach theorem](/theorems/879) that a norm-closed linear subspace of a [normed vector space](/page/Normed%20Vector%20Space) is weakly closed. Explicitly, if $z\in X\setminus Y$, then Hahn-Banach separation for closed subspaces gives a functional $\Psi\in X^*$ such that $\Psi(y)=0$ for every $y\in Y$ and $\Psi(z)\ne 0$.
Apply this with $z$ equal to a weak limit of a sequence in $Y$. If $(y_k)_{k=1}^{\infty}$ is any sequence in $Y$ and $y_k\rightharpoonup y$ in $X$, then assuming $y\notin Y$ gives a functional $\Psi\in X^*$ with $\Psi|_Y=0$ and $\Psi(y)\ne 0$. Since $y_k\in Y$, one has $\Psi(y_k)=0$ for every $k\in\mathbb N$. [Weak convergence](/page/Weak%20Convergence) gives
\begin{align*}
\Psi(y)=\lim_{k\to\infty}\Psi(y_k)=0,
\end{align*}
contradicting $\Psi(y)\ne 0$. Therefore $y\in Y$, and $Y$ is sequentially weakly closed in $X$.[/step]
custom_env
admin
[guided]The key point is that weak convergence is tested by continuous linear functionals, so to prove that a closed subspace cannot lose limits under weak convergence, we need a functional that detects any point outside the subspace.
First, $Y=W^{1,p}_0(U)$ is norm-closed in $X=W^{1,p}(U)$ because, by the definition in the theorem statement, $W^{1,p}_0(U)$ is the closure of $C_c^\infty(U)$ in the $W^{1,p}(U)$ norm. Also, $Y$ is a linear subspace: if $a,b\in\mathbb R$ and $y_1,y_2\in Y$, then $ay_1+by_2$ lies in the norm closure of $C_c^\infty(U)$ because $C_c^\infty(U)$ is linear and norm limits are preserved under continuous vector-space operations.
We use the following Hahn-Banach separation consequence: if $Y$ is a norm-closed linear subspace of a normed [vector space](/page/Vector%20Space) $X$ and $z\in X\setminus Y$, then there exists a continuous linear functional $\Psi\in X^*$ such that $\Psi(y)=0$ for every $y\in Y$ but $\Psi(z)\ne 0$. This is the precise tool that turns norm-closedness into weak closedness.
Now let $(y_k)_{k=1}^{\infty}$ be a sequence in $Y$ and suppose $y_k\rightharpoonup y$ in $X$. We prove $y\in Y$. If not, then $y\in X\setminus Y$, so the separation statement gives a functional $\Psi\in X^*$ satisfying $\Psi|_Y=0$ and $\Psi(y)\ne 0$. Since every $y_k$ belongs to $Y$, we have
\begin{align*}
\Psi(y_k)=0
\end{align*}
for every $k\in\mathbb N$. But weak convergence means exactly that every continuous linear functional converges on the sequence, so
\begin{align*}
\Psi(y)=\lim_{k\to\infty}\Psi(y_k)=0.
\end{align*}
This contradicts $\Psi(y)\ne 0$. Hence the assumption $y\notin Y$ is impossible, and therefore $y\in Y$. Thus $W^{1,p}_0(U)$ is sequentially weakly closed in $W^{1,p}(U)$.[/guided]
custom_env
admin
[step:Apply weak closedness to the translated sequence and return to the affine class]
From the first step,
\begin{align*}
v_k=u_k-g\in Y
\end{align*}
for every $k\in\mathbb N$, and
\begin{align*}
v_k\rightharpoonup u-g
\end{align*}
in $X$. From the weak closedness of $Y$ proved in the previous step, it follows that
\begin{align*}
u-g\in Y=W^{1,p}_0(U).
\end{align*}
By the definition of the affine Dirichlet class,
\begin{align*}
u\in g+W^{1,p}_0(U)=\mathcal A_g.
\end{align*}
This proves the claim.
[/step]