Is it possible to describe the distance between a point and a nonconvex set by the pointwise maximum of affine functions if my nonconvex set $\mathcal{O}$ is the union of halfspaces defined below: \begin{equation} \mathcal{O}_j=\{y\mid a_j^\top y\geq b_j\},\; j=1,\dots,m, \end{equation}
\begin{equation} \mathcal{O}=\bigcup_{j=1}^{m} \mathcal{O}_j \end{equation} I was able to derive only the following equation, which is not what I want to have. \begin{equation} \mathrm{dist}(y,\mathcal{O})=\min_j\bigg\{\frac{(a_j^\top y-b_j)^{+}}{\|a_j\|}\bigg\} \end{equation}