[proofplan]
The class $u_0+C_c^\infty(U)$ is contained in $u_0+W^{1,p}_0(U)$, so one inequality between the two infima is immediate. For the reverse inequality, we take an arbitrary admissible function $u=u_0+v$ and approximate the zero-boundary perturbation $v$ strongly in $W^{1,p}_0(U)$ by compactly supported smooth functions. The main analytic point is that the integral functional is continuous along strong $W^{1,p}$ convergence under the stated continuity and $p$-growth hypotheses. Applying this continuity to the smooth perturbation approximations gives competitors in the smooth comparison class whose energies converge to $I[u]$, and then taking infima proves equality.
[/proofplan]
[step:Record the inclusion that gives the easy inequality]
By the definition of $W^{1,p}_0(U)$ as the closure of $C_c^\infty(U)$ in $W^{1,p}(U)$, we have $C_c^\infty(U)\subset W^{1,p}_0(U)$. Hence every function of the form $u_0+\varphi$ with $\varphi\in C_c^\infty(U)$ belongs to $u_0+W^{1,p}_0(U)$. Therefore the infimum over the larger class is no greater than the infimum over the smaller class:
\begin{align*}
\inf_{u\in u_0+W^{1,p}_0(U)} I[u] \le \inf_{\varphi\in C_c^\infty(U)} I[u_0+\varphi].
\end{align*}
[/step]
[step:Establish strong continuity of the integral functional under $W^{1,p}$ convergence]
We use the following standard continuity fact for Nemytskii integral functionals with $p$-growth.
[claim:Strong continuity of the $p$-growth integral]
Let $(w_j)_{j=1}^{\infty}$ be a sequence in $W^{1,p}(U)$ and let $w\in W^{1,p}(U)$. If
\begin{align*}
w_j\to w \quad\text{in } W^{1,p}(U),
\end{align*}
then
\begin{align*}
\int_U F(x,w_j(x),\nabla w_j(x))\,d\mathcal L^n(x) \to \int_U F(x,w(x),\nabla w(x))\,d\mathcal L^n(x).
\end{align*}
[/claim]
[proof]
Define the functions $G_j:U\to[0,\infty)$ and $G:U\to[0,\infty)$ by
\begin{align*}
G_j(x)=F(x,w_j(x),\nabla w_j(x)), \qquad G(x)=F(x,w(x),\nabla w(x)).
\end{align*}
The compositions are measurable by [citetheorem:8735], because the restriction of $F$ to $U\times\mathbb R\times\mathbb R^n$ is continuous, hence a Caratheodory integrand, and $w_j,w,\nabla w_j,\nabla w$ are measurable.
Since $w_j\to w$ in $W^{1,p}(U)$, we have $w_j\to w$ in $L^p(U)$ and $\nabla w_j\to \nabla w$ in $L^p(U;\mathbb R^n)$. After passing to an arbitrary subsequence and then to a further subsequence, we may assume $w_j(x)\to w(x)$ and $\nabla w_j(x)\to \nabla w(x)$ for $\mathcal L^n$-a.e. $x\in U$. By continuity of $F$ in all variables, this gives $G_j(x)\to G(x)$ for $\mathcal L^n$-a.e. $x\in U$.
The upper $p$-growth hypothesis gives, for $\mathcal L^n$-a.e. $x\in U$,
\begin{align*}
0\le G_j(x)\le C(1+|w_j(x)|^p+|\nabla w_j(x)|^p).
\end{align*}
Because $w_j\to w$ in $L^p(U)$, the [reverse triangle inequality](/theorems/2300) gives $|w_j|\to |w|$ in $L^p(U)$. The map $f\mapsto |f|^p$ is continuous from $L^p(U)$ to $L^1(U)$: for $p=1$ this is immediate, and for $p>1$ it follows from Hölder's inequality with conjugate exponents $q$ and $p$, where
\begin{align*}
q=\frac{p}{p-1},
\end{align*}
applied to the pointwise estimate
\begin{align*}
||a|^p-|b|^p|\le p(|a|^{p-1}+|b|^{p-1})|a-b|.
\end{align*}
Hence $|w_j|^p\to |w|^p$ in $L^1(U)$. Similarly, $|\nabla w_j|\to |\nabla w|$ in $L^p(U)$ and hence $|\nabla w_j|^p\to |\nabla w|^p$ in $L^1(U)$. The same growth bound applied to $w$ gives $0\le G(x)\le C(1+|w(x)|^p+|\nabla w(x)|^p)$ for $\mathcal L^n$-a.e. $x\in U$, so $G\in L^1(U)$. Strong $L^1(U)$ convergence of $|w_j|^p$ and $|\nabla w_j|^p$ implies uniform integrability of those two sequences; since $U$ is bounded, the constant function $1$ is integrable on $U$. Finite sums of uniformly integrable families are uniformly integrable, so $1+|w_j|^p+|\nabla w_j|^p$ is uniformly integrable on $U$. The pointwise bound $0\le G_j\le C(1+|w_j|^p+|\nabla w_j|^p)$ then implies that $(G_j)_{j=1}^{\infty}$ is uniformly integrable as well. By the [Vitali convergence theorem](/theorems/950) for uniformly integrable functions, applied to the a.e. convergence $G_j\to G$, we obtain
\begin{align*}
\int_U |G_j(x)-G(x)|\,d\mathcal L^n(x)\to 0.
\end{align*}
In particular,
\begin{align*}
\int_U G_j(x)\,d\mathcal L^n(x)\to \int_U G(x)\,d\mathcal L^n(x).
\end{align*}
Since every subsequence admits a further subsequence along which the displayed convergence holds, the original sequence of integrals converges. This proves the claim.
[guided]
We need a convergence theorem for the nonlinear integrands $F(x,w_j(x),\nabla w_j(x))$. Plain dominated convergence is not directly available, because the natural upper bound contains $|w_j|^p+|\nabla w_j|^p$, which depends on $j$. The right replacement is the [Vitali convergence theorem](/theorems/2111): pointwise convergence plus uniform integrability implies convergence in $L^1$.
Define $G_j:U\to[0,\infty)$ by $G_j(x)=F(x,w_j(x),\nabla w_j(x))$, and define $G:U\to[0,\infty)$ by $G(x)=F(x,w(x),\nabla w(x))$. These functions are measurable by [citetheorem:8735], because the restriction of $F$ to $U\times\mathbb R\times\mathbb R^n$ is continuous, hence a Caratheodory integrand, and the Sobolev functions $w_j,w$ and their weak gradients are measurable representatives.
The strong convergence $w_j\to w$ in $W^{1,p}(U)$ means exactly that $\|w_j-w\|_{L^p(U)}\to 0$ and $\|\nabla w_j-\nabla w\|_{L^p(U;\mathbb R^n)}\to 0$. From strong $L^p$ convergence, every subsequence has a further subsequence converging pointwise almost everywhere. Thus, after passing to such a further subsequence, $w_j(x)\to w(x)$ and $\nabla w_j(x)\to \nabla w(x)$ for $\mathcal L^n$-a.e. $x\in U$. Since $F$ is continuous as a function of $(x,z,\xi)$, this pointwise convergence gives $G_j(x)\to G(x)$ for $\mathcal L^n$-a.e. $x\in U$.
It remains to justify integrability uniformly in $j$. The upper growth assumption gives $0\le G_j(x)\le C(1+|w_j(x)|^p+|\nabla w_j(x)|^p)$ for $\mathcal L^n$-a.e. $x\in U$. Since $w_j\to w$ in $L^p(U)$, the reverse triangle inequality gives $|w_j|\to |w|$ in $L^p(U)$. We now pass from convergence of functions to convergence of their $p$th powers. If $p=1$, this is the same convergence. If $p>1$, we use the pointwise inequality
\begin{align*}
||a|^p-|b|^p|\le p(|a|^{p-1}+|b|^{p-1})|a-b|.
\end{align*}
Applying it with $a=w_j(x)$ and $b=w(x)$, and then integrating using Hölder's inequality with conjugate exponents $q$ and $p$, where
\begin{align*}
q=\frac{p}{p-1},
\end{align*}
shows that $|w_j|^p\to |w|^p$ in $L^1(U)$. Strong $L^1$ convergence implies uniform integrability, so the sequence $|w_j|^p$ is uniformly integrable on $U$. Since $\nabla w_j\to\nabla w$ in $L^p(U;\mathbb R^n)$, the same argument gives $|\nabla w_j|^p\to |\nabla w|^p$ in $L^1(U)$, so the sequence $|\nabla w_j|^p$ is uniformly integrable on $U$. The same growth bound applied to $w$ gives $0\le G(x)\le C(1+|w(x)|^p+|\nabla w(x)|^p)$ for $\mathcal L^n$-a.e. $x\in U$, and the right-hand side is integrable because $w\in W^{1,p}(U)$. Hence $G\in L^1(U)$. Also $U$ has finite [Lebesgue measure](/page/Lebesgue%20Measure) because it is bounded, so the constant function $1$ is integrable on $U$. Therefore $1+|w_j|^p+|\nabla w_j|^p$ is uniformly integrable, and the displayed growth bound implies that $(G_j)_{j=1}^{\infty}$ is uniformly integrable.
Now the Vitali convergence theorem gives $\int_U |G_j(x)-G(x)|\,d\mathcal L^n(x)\to 0$. Consequently, $\int_U F(x,w_j(x),\nabla w_j(x))\,d\mathcal L^n(x)\to \int_U F(x,w(x),\nabla w(x))\,d\mathcal L^n(x)$. The argument was made after passing to an arbitrary subsequence and then to a further subsequence. This subsequence principle implies convergence of the original sequence of integrals.
[/guided]
[/proof]
[/step]
[step:Approximate an arbitrary admissible function by smooth zero-boundary perturbations]
Let $u\in u_0+W^{1,p}_0(U)$ be arbitrary with $I[u]<\infty$. Choose $v\in W^{1,p}_0(U)$ such that
\begin{align*}
u=u_0+v.
\end{align*}
By the density of compactly supported smooth functions in $W^{1,p}_0(U)$, there exists a sequence $(\varphi_j)_{j=1}^{\infty}$ in $C_c^\infty(U)$ such that
\begin{align*}
\varphi_j\to v \quad\text{in } W^{1,p}_0(U).
\end{align*}
For each positive integer $j$, define $u_j:U\to\mathbb R$ by
\begin{align*}
u_j(x)=u_0(x)+\varphi_j(x).
\end{align*}
Then $u_j\in u_0+C_c^\infty(U)$ and
\begin{align*}
u_j\to u \quad\text{in } W^{1,p}(U).
\end{align*}
Applying the strong continuity claim with $w_j=u_j$ and $w=u$, we obtain
\begin{align*}
I[u_j]\to I[u].
\end{align*}
[/step]
[step:Compare the two infima by approximating finite-energy competitors]
Set
\begin{align*}
\alpha=\inf_{w\in u_0+W^{1,p}_0(U)} I[w]
\end{align*}
and
\begin{align*}
\beta=\inf_{\varphi\in C_c^\infty(U)} I[u_0+\varphi].
\end{align*}
The first step proved $\alpha\le\beta$.
To prove the reverse inequality, let $u\in u_0+W^{1,p}_0(U)$ satisfy $I[u]<\infty$. The approximation step gives a sequence $(u_j)_{j=1}^{\infty}$ in $u_0+C_c^\infty(U)$ such that
\begin{align*}
I[u_j]\to I[u].
\end{align*}
Since $\beta$ is the infimum over all such smooth-perturbation competitors, we have
\begin{align*}
\beta\le I[u_j]
\end{align*}
for every positive integer $j$. Passing to the limit gives
\begin{align*}
\beta\le I[u].
\end{align*}
Taking the infimum over all finite-energy $u\in u_0+W^{1,p}_0(U)$ yields
\begin{align*}
\beta\le\alpha.
\end{align*}
Together with $\alpha\le\beta$, this proves
\begin{align*}
\inf_{u\in u_0+W^{1,p}_0(U)} I[u] = \inf_{\varphi\in C_c^\infty(U)} I[u_0+\varphi].
\end{align*}
[/step]