aproximation in Sobolev Spaces consider $r>0 , p>1$ and $K \subset B(x_0 , 2r) \subset R^n$ . $K$ compact. Define the sets :
$$A = \{ u \in C^{\infty}_{0} (B(x_0 , 2r)); \textit{ such  that }  \  u=1 \textit{ in a open  neighborhood of K} \}$$
$$ B =  \{  u \in  H^{1,p}_{0} (B(x_0 , 2r)) \cap  C (B(x_0 , 2r))  : u=1 \  on \  K  ,  \  0 \leq u \leq 1\}$$
I want to show that 
$$ \displaystyle\inf_{u \in A} \displaystyle\int_{B(x_0 , 2r)} |\nabla u|^p  \ dx= \displaystyle\inf_{u \in B} \displaystyle\int_{B(x_0 , 2r)} |\nabla u|^p   \ dx$$
For this i am trying to aproximate (in the sense of the  norm of $H^{1,p}$) the function of B , by function of $A$.
Somenone can give me a hint ?
thanks in advance
 A: Let me define
$$\tilde B = B =  \{  u \in  H^{1,p}_{0} (B(x_0 , 2r)) \cap  C (B(x_0 , 2r))  : u=1 \  on \  K\}.$$
Then by Stampacchia's lemma,
it is easy to see that the $\inf$ over $\tilde B$ equals the $\inf$ over $B$. Since $A \subset \tilde B$, it remains to show $\inf_A \le \inf_{\tilde B}$.
Therefore, the idea is to take $f \in \tilde B$ and approximate it with $g_\varepsilon \in A$, such that
$$\int |\nabla f|^p dx +\varepsilon \ge \int |\nabla g_\varepsilon|^p dx.$$
This shows
$$\inf_{\tilde B}(\ldots) + \varepsilon \ge \inf_{A}(\ldots).$$
Since this holds for all $\varepsilon > 0$, we have
$$\inf_{\tilde B}(\ldots) \ge \inf_{A}(\ldots).$$
It remains to give an idea for the approximation of $f \in \tilde B$ with $g_\varepsilon \in A$. Since your functional is continuous w.r.t. the norm in $H^{1,p}$, we just need to ensure that we can construct a $g_\varepsilon$ with
$$\| f - g_\varepsilon\|_{1,p} \le \varepsilon$$
for all $\varepsilon > 0$. 
Therefore, take $\delta > 1$ and observe that $\delta \, f \ge \delta$ on $K$. Hence, the set $X = \{x : \delta \, f(x) \ge 1\}$ is a neighbourhood of $K$. Now, convolve $\delta\,f$ with a smooth kernel $\varphi$ (which is close to the dirac delta). This yields a smooth function $g = \varphi \star \delta \, f$. Since $\delta\,f \ge 1$ on $X$ and since $\varphi$ has small support and $\int \varphi = 1$, we get $g \ge 1$ on a neighbourhood of $K$. Finally, you get
$$\|f - g\|_{1,p} \to 0$$
as $\delta \to 1$ and $\varphi$ approaches the dirac delta.
