A doubt on the Sobolev space $W_0^{1,p}(\Omega)$ Let $\Omega \subset \Bbb R^d$ be open and $1\leq p<\infty$. Recall that $W_0^{1,p}(\Omega)$ is the closure of $C_c^\infty(\Omega)$(smooth function with compact support in $\Omega$) in $W^{1,p}(\Omega)$ where $$W^{1,p}(\Omega)= \{u\in L^p(\Omega): \nabla u \in L^p(\Omega) \}$$
is equiped with the norm $$\|u\|^p_{W^{1,p}(\Omega)}= \|u\|^p_{L^p(\Omega)} + \|\nabla u\|^p_{L^p(\Omega)}$$
Define
$$W_\Omega= \{u\in W^{1,p}(\Bbb R^d): u =0 ~~a.e.~~ on~~ \Bbb R^d\setminus \Omega \}$$
Clearly $W_\Omega$ is closed subspace of $W^{1,p}(\Bbb R^d)$ and we have $W_0^{1,p}(\Omega)\subset W_\Omega$
Question: Do we have $W_0^{1,p}(\Omega)= W_\Omega$?
Or is there  a counter example?

Another situation in which equality fails is $\Omega = (-1,1)^d \setminus (\{0\}\times (-1,1)^{d-1})$. Then,
$$W_\Omega = W_0^{1,p}( (-1,1)^d )$$
since the a.e.-equality does not see the hyperplane $\{x | x_1 = 0\}$.
However, you have (without any further assumptions on $\Omega$)
$$W_0^{1,p}(\Omega) = \{ v \in W^{1,p}(\mathbb R^d) \;|\; v = 0 \text{ q.e. on } \mathbb R^d \setminus \Omega \}.$$
Here, "q.e." means quasi-everywhere (i.e., up to subsets of capacity zero) and we use the quasi-continuous representative of $v \in W^{1,p}(\mathbb R^d)$.
This can be found in Theorem 4.5 in the book
"Nonlinear potential theory of degenerate elliptic equations"
(1993)
by
Heinonen, Kilpeläinen, Martio.
