Squared distance to a convex set
= Squared distance to a convex set
{title2=$d_C(x)=\frac12\operatorname{dist}(x,C)^2$}
For a nonempty closed convex set $C$, the squared-distance function is the <Moreau envelope> of its <indicator functional of a constraint set>. It is convex and differentiable with
$$
\nabla d_C(x)=x-P_Cx,
$$
and this gradient is one-Lipschitz.