Subgradient of the absolute value (source code)

= Subgradient of the absolute value

The <absolute value function> has
$$
\partial|x|=
\begin{cases}
\{\operatorname{sgn}x\},&x\ne0,\\
[-1,1],&x=0.
\end{cases}
$$