On page 66 of "Sobolev Spaces (Adams ed2)" in the proof of Lemma 3.16 (Mollification in $W^{m,p}(\Omega)$), it is mentioned that $\varepsilon < {\rm dist}(\Omega', \partial\Omega)$. However, I cannot see where this condition is used in the proof. Could you please help explain this, thank you! The proof given by the book is given as follows:
Lemma (Mollification in $W^{m,p}(\Omega)$): let $J_{\varepsilon}$ be defined as $J_{\varepsilon}(x) = \varepsilon^{-n} J(\frac{x}{\varepsilon})$ and let $1 \leq p < \infty$ and $u \in W^{m,p}(\Omega)$. If $\Omega'$ is a subdomain with compact closure in $\Omega$, then $\lim_{\varepsilon \rightarrow 0^{+}} J_{\varepsilon}*u = u$ in $W^{m,p}(\Omega')$.
Proof: Let $\varepsilon < {\rm dist}(\Omega', \partial\Omega)$ and $\tilde{u}$ be the zero extension of $u$ outside $\Omega$. If $\phi \in \mathscr{D}(\Omega')$, \begin{align*} \int_{\Omega'} J_{\varepsilon}*u(x)D^{\alpha}\phi(x){\rm d}x &= \int_{\mathbb{R}^n}\int_{\Omega'} \tilde{u}(x-y) J_{\varepsilon}(y) D^{\alpha}\phi(x){\rm d}x {\rm d}y \\ &= (-1)^{\lvert \alpha \rvert} \int_{\mathbb{R}^n}\int_{\Omega'} D^{\alpha}_x u(x-y) J_{\varepsilon}(y) \phi(x) {\rm d}x {\rm d}y \\ &= (-1)^{\lvert \alpha \rvert} \int_{\Omega'} J_{\varepsilon}*D^{\alpha}u(x)\phi(x){\rm d}x \end{align*} Then $D^{\alpha} J_{\varepsilon}*u = J_{\varepsilon}*D^{\alpha}u$ in the distributional sense in $\Omega'$. Because $D^{\alpha}u \in L^p(\Omega)\; \forall 0 \leq \lvert \alpha \rvert \leq m$, we have $$ \lim_{\varepsilon \rightarrow 0^{+}} \lVert D^{\alpha}J_{\varepsilon}*u - D^{\alpha}u \rVert_{p,\Omega'} = \lim_{\varepsilon \rightarrow 0^{+}} \lVert J_{\varepsilon}*D^{\alpha}u - D^{\alpha}u \rVert_{p,\Omega'} = 0 $$ Thus $\lim_{\varepsilon \rightarrow 0^{+}} \lVert J_{\varepsilon}u - u \rVert_{m,p,\Omega'} = 0$.
The assumption is implicitely used here: \begin{align*} \int_{\mathbb{R}^n}\int_{\Omega'} \tilde{u}(x-y) J_{\varepsilon}(y) D^{\alpha}\phi(x){\rm d}x {\rm d}y &= \int_{B_\varepsilon(0)}\int_{\Omega'} \tilde{u}(x-y) J_{\varepsilon}(y) D^{\alpha}\phi(x){\rm d}x {\rm d}y \\ &= (-1)^{\lvert \alpha \rvert} \int_{B_\varepsilon(0)}\int_{\Omega'} D^{\alpha}_x u(x-y) J_{\varepsilon}(y) \phi(x) {\rm d}x {\rm d}y \\ &= (-1)^{\lvert \alpha \rvert} \int_{\mathbb{R}^n}\int_{\Omega'} D^{\alpha}_x u(x-y) J_{\varepsilon}(y) \phi(x) {\rm d}x {\rm d}y \end{align*} If $\varepsilon$ would be to large, $x-y$ might not belong to $\Omega$ and you cannot use integration by parts.