Derivative of the absolute value Let $f \in W^{1,p}(U)$, then how to prove that  $|f| \in W^{1,p}(U)$, where $W$ means the sobolev space over some open subset $U \in \mathbb{R}^n$.
In Lieb's Analysis he prove that Let $f$ be in $W^{1, p}(\Omega)$. Then the absolute value of $f$, denoted by $|f|$ and defined by $|f|(x)=|f(x)|$, is in $W^{1, p}(\Omega)$ with $\nabla|f|$ being the function
$$
(\nabla|f|)(x)= \begin{cases}\frac{1}{|f|(x)}(R(x) \nabla R(x)+I(x) \nabla I(x)) & \text { if } f(x) \neq 0 \\ 0 & \text { if } f(x)=0\end{cases}
$$
here $R(x),I(X)$ denote the real part and imaginary part of $f(x)$.
In the proof he uses the inequality $|\frac{1}{|f|(x)}(R(x) \nabla R(x)+I(x) \nabla I(x))|^2 \leq |\nabla R(x)|^2+|\nabla I(x)|^2$ and chain rule to show that $\nabla|f| \in L^p$, but how it implies $\partial |f| \in  L^p(U)$, do we have $|\frac{1}{|f|(x)}(R(x) \partial R(x)+I(x) \partial I(x))|^2 \leq |\partial R(x)|^2+|\partial I(x)|^2$ ?
In all, I have three question:

*

*How to prove that $|\frac{1}{|f|(x)}(R(x) \nabla R(x)+I(x) \nabla I(x))|^2 \leq |\nabla R(x)|^2+|\nabla I(x)|^2$


*How to prove that $\partial |f| \in  L^p(U)$.


*I wonder whether or not $|f| \in W_0^{1,p}(U)$ when $f \in W_0^{1,p}(U)$. I can't find a counterexample
 A: Part 1 follows from the Cauchy-Schwartz inequality, applied to the two vectors $(R(x), I(x))$, $(\nabla R(x), \nabla I(x))$.
Part 2 follows from the simple inequality $|\partial_j R(x)| \leq \sqrt {\sum_i (\partial_i R(x))^2 } = |\nabla R(x)|$ for all $j$ (and similarly for $I$).
I am not sure about part 3 myself.
A: Here is a result that proves part 3. It is copied from the paper:
P. Hajłasz, J. Maly, Approximation in Sobolev spaces of nonlinear expressions involving the gradient Ark. Mat. 40 (2002), 245--274.

Let me explain the ``easy to see'' statement: $\min\{\varphi_k,u\}\to\min\{v,u\}$ in $W^{1,p}$.
Since $\min\{f,g\}=f-(f-g)^+$ ($+$ stands for the positive part), it suffices to prove that
$$
f_k\to f
\quad
\Rightarrow
\quad
f_k^+\to f^+
\quad
\text{in } W^{1,p}.
$$
Inequality $|f_k^+-f^+|\leq |f_k-f|$ yields convergence in $L^p$ and convergence of the gradients follows from the fact that
$$
\nabla f^+=
\begin{cases}
\nabla f & \text{if} f\geq 0,\\
0 & \text{if } f<0.
\end{cases}
$$
This equality follows from the characterization of Sobolev functions though absolute continuity on lines, see Corollary 2.31 in
P. Hajlasz, Lecture Notes
