is the absolute value of function $H^s$ also in $H^s$? If $f$ and $g$ are (complex-valued) functions in the Sobolev space $H^s(\mathbb{R}^d)$ then any linear combination $f+\alpha g$ with $\alpha\in\mathbb{C}$ is also in $H^s(\mathbb{R}^d)$ since it is a vector space and, if $s>d/2$, it can be shown that the product $fg$ is in $H^s(\mathbb{R}^d)$ with
$$
\|fg\|_{H^s(\mathbb{R}^d)}\lesssim \|f\|_{H^s(\mathbb{R}^d)}\|g\|_{H^s(\mathbb{R}^d)}
$$
I was wondering, however, what can be said about the absolute value of a function in $H^s(\mathbb{R}^d)$. Is it true that if $f\in H^s(\mathbb{R}^d)$ then also $|f|\in H^s(\mathbb{R}^d)$? Here $|\cdot|$ denotes the absolute value in $\mathbb{C}$ since $f$ is possibly complex-valued.
I've found two similar questions already (see 1 or 2) but none solved in full generality. If someone could help me by giving a hint or providing a reference I'd very much appreciate it, thank you :)
 A: This works for $s\in (0,1)$. Let $f \in H^s(\mathbb R^d)$. Then
$$
[|f|]_{H^s}^2 = \int\int \frac{ \big| |f(x)|-|f(y)| \big|^2}{|x-y|^{n+2s}} dxdy
\le \int\int \frac{ \big| f(x)-f(y) \big|^2}{|x-y|^{n+2s}} = [f]_{H^s}^2 ,
$$
and $|f|\in H^s$.
A: The answer is no. The simplest way of constructing a counterexample imo is to consider a function $f$ that belongs to the Schwartz space $\mathscr S(\mathbb R^d)$ of rapidly decreasing smooth functions and vanishes somewhere, so the absolute value $|f|$ fails to be smooth. Then $|f|$ does not belong to $H^s(\mathbb R^n)$ for large $s$, since $|f|$ is not smooth, while $f \in H^s(\mathbb R^n)$ for all $s$. To be more concrete let $d = 1$ and $f(x) = \sin(x) e^{-x^2/2}$. It is clear that $f \in H^s(\mathbb R)$ for all real $s$. As for the absolute value $|f|$, observe, that this function is absolutely continuous and has derivative in $L_2(\mathbb R)$, but the derivative itself fails to be absolutely continuous. Thus, $|f| \in H^1(\mathbb R)$ but $|f| \notin H^2(\mathbb R)$.
