\newcommand\sgn{\mathop{\mathrm{sgn}}\nolimits} \DeclareMathOperator\sgn{sgn} \newcommand{\sgn}{\operatorname{sgn}}