Let $\Omega$ denote a open subset of $\mathbb{R}^n$, and $W^{1,p}(\Omega)$ the Sobolev space of weakly differentiable functions $u\in L^p(\Omega)$ (that is, for which $D_iu$ exists and belongs to $L^p(\Omega)$ as well, for every $i\in\left\{1,\ldots,n\right\}$).
I'm studying boundary regularity of a solution of the Dirichlet problem for the circle $D\subseteq\mathbb{R}^2$, and the weak maximum principle is needed. For that, we need to give a proper meaning for $u\leq v$ in $\partial\Omega$ (the boundary of $\Omega$), where $u,v\in W^{1,2}(\Omega)$. The definition is: $u\leq v$ in $\partial\Omega$ iff $(u-v)^+\in W_0^{1,2}(\Omega)$, where:
- $w^+=\max(w,0)$ denotes the positive part of $w$; and
- $W_0^{1,2}(\Omega)$ is the closure (in Sobolev norm) of $C_0^\infty(\Omega)=\left\{w\in C^\infty(\Omega):\text{supp}(w)\text{ is compact}\right\}$
Now, a lot of statements relating to that concept need the following lemma (or something similar), which I'm unable to prove:
Lemma: Let $u\in W_0^{1,2}(\Omega)$, $v\in W^{1,2}(\Omega)$ such that $v\geq 0$ pointwise. Show that $(u-v)^+\in W_0^{1,2}(\Omega)$.
Intuitively, that should be true. If we think of continuous functions $u$ and $v$ such that $u\in C_0(\Omega)$, then $(u-v)^+\in C_0(\Omega)$, since $|(u-v)^+|\leq|u|$ (where $C_0(\Omega)$ denotes the set o compactly supported continuous functions from $\Omega$ to $\mathbb{R}$). Using mollifiers, it's easy to see that $C_0(\Omega)\subseteq W_0^{1,2}(\Omega)$, and the lemma is true in that case. I tried to give the following proof:
The case $u\in C_0^\infty(\Omega)$ is easy enough. Now, let $\left\{u_n\right\}_{n\in\mathbb{N}}\subseteq C_0^\infty(\Omega)$ be a sequence converging in $W^{1,2}(\Omega)$ to $u$. Taking subsequences if necessary, I tried making pointwise convergence (almost everywhere in $\Omega$) of $(u_n-v)^+$ and $D_i(u_n-v)^+$ to $(u-v)^+$ and $D_i(u-v)^+$, respectively, so I'd apply Lebesgue's Dominated Convergence Theorem, and conclude convergence in $W^{1,2}(\Omega)$, hence proving the lemma. The problem is exactly with the derivatives: Since $Dw^+(x)=0$ if $w(x)\leq 0$ and $Dw^+(x)=Dw(x)$ if $w(x)>0$ ($\forall w\in W^{1,2}(\Omega)$: this follows from the weak chain rule), we cannot garantee pointwise convergence if $u(x)=v(x)$.
Any idea would be of great value. Even if one must assume $\Omega$ bounded and/or $v\in C^\infty(\Omega)\cap C^0(\overline{\Omega})$, it would suffice for what I need.
Thank you in advance.
I found a nice elementary proof for this: All the equalities are meant to hold a.e..
Proof: Let $u^+=\max(u,0)$ and $u^-=\min(u,0)$. By the chain rule, $u^+,u^-\in W^{1,p}(\Omega)$ and $D_iu^+(x)=D_iu(x)$ if $u(x)>0$ and $D_i u^+(x)=0$ otherwise, and $D_i u^-(x)=D_iu(x)$ if $u(x)<0$ and $D_iu^-(x)=0$ otherwise. Since $D_iu(x)=D_i(u^++u^-)(x)=D_iu^+(x)=D_iu^-(x)$, the lemma holds.$\square$
Proof of the statement in the question: First suppose $u\in C_0^\infty(\Omega)$. Then $\text{supp}(u-v)^+\subseteq\text{supp}(u)$, and a sequence of mollificationsof $(u-v)^+$, converging to it in $W^{1,p}(\Omega)$ will eventually be in $C^\infty_0(\Omega)$, and the statement holds.
Now suppose $u\in W_0^{1,p}(\Omega)$. Let $\left\{u_n\right\}_{n\in\mathbb{N}}$ be a sequence of $C_0^\infty(\Omega)$ functions converging to $u$. Taking subsequences if needed, we can assume $u_n\rightarrow u$ and $D_iu_n\rightarrow D_iu$ a.e. in $\Omega$. Then $(u_n-v)^+\rightarrow (u-v)^+$ a.e. pointwise (for $x\in\Omega$, consider the cases $u(x)>v(x)$, $u(x)<v(x)$ and $u(x)=v(x)$), and the dominated convergence theorem implies that $(u_n-v)^+$ converges to $(u-v)^+$ in $L^p(\Omega)$.
Now, let $x\in\Omega$ (such that $D_iu_n(x)\rightarrow D_iu(x)$). If $u(x)>v(x)$ or $u(x)<v(x)$, use the chain rule to see that $D_i(u_n-v)^+(x)\rightarrow D_i(u-v)^+(x)$. If $u(x)=v(x)$, by the lemma we can assume that $D_iu(x)=D_iv(x)$, and it's easily verified that $D_i(u_n-v)^+(x)\rightarrow D_i(u-v)^+(x)$. Again by dominated convergence, $D_i(u_n-v)^+\rightarrow D_i(u-v)^+$ in $L^p(\Omega)$. That means that $(u_n-v)^+\rightarrow(u-v)^+$ in $W^{1,p}(\Omega)$. Since $(u_n-v)^+\in W_0^{1,p}(\Omega)$, which is closed, the result follows.$\square$