Orthogonal Projection onto the $ {L}_{\infty} $ Unit Ball What is the Orthogonal Projection onto the $ {\ell}_{\infty} $ Unit Ball?
Namely, given $ x \in {\mathbb{R}}^{n} $ what would be:
$$ {\mathcal{P}}_{ { \left\| \cdot \right\| }_{\infty} \leq 1 } \left( x \right) = \arg \min_{{ \left\| y \right\| }_{\infty} \leq 1} \left\{ {\left\| y - x \right\|}_{2}^{2} \right\} $$
I managed to get an answer using the Moreau Decomposition.
Yet I would be happy to see if someone can derive the answer directly.
Thank You.

Just an addition which is helpful to program this projector efficiently for example with Numpy:
The awnser
$$
({\mathcal{P}}_{ { \left\| \cdot \right\| }_{\infty} \leq 1 } \left( x \right))_i = \begin{cases}
    1, & \text{if} & {x}_{i} \geq 1 \\
    {x}_{i}, & \text{if} & \left | {x}_{i} \right | < 1 \\
    -1, & \text{if} & {x}_{i} \leq -1
  \end{cases}
$$
can also be formulated as
$$
({\mathcal{P}}_{ { \left\| \cdot \right\| }_{\infty} \leq 1 } \left( x \right))_i = \operatorname{sign}(x_i)\min(1,|x_i|).
$$
Therefore in vector formulation (which can be directly implemented in Numpy) we can write this simply as
$$
{\mathcal{P}}_{ { \left\| \cdot \right\| }_{\infty} \leq 1 } \left( x \right) = \operatorname{sign}(x)\min(1, |x|) = \operatorname{np.sign}(x)*\operatorname{np.minimum}(1,\operatorname{np.abs}(x))
$$
having imported Numpy as np and using its functions $\operatorname{np.sign},\ \operatorname{np.minimum},\ \operatorname{np.abs}$.
