Closed form expression for $\underset{(X,Y) \in \mathcal E}{\arg \min} \left(||X-A||_2^2 + ||Y-B||_2^2 \right)$? Let $\mathcal H$ be a Hilbert space, and $S \subset \mathcal H$ a convex subset of $\mathcal H$.
Let $\mathcal E = \{(X,Y) \in \mathcal H^2 ;  X+Y \in S\}$ and $(A,B) \in \mathcal H^2$.
Is it possible to find any closed form expression of :
$(\hat X, \hat Y) = \underset{(X,Y) \in \mathcal E}{\arg \min} \left(||X-A||_2^2 + ||Y-B||_2^2 \right)$
 A: Here is one criterium:

$s^*\in S$ is a minimiser of:
$$\|s-(A+B)\|^2\tag{$*$}$$
iff
$$X^*=\frac12 (A-B+s^*),\qquad Y^*=\frac12(B-A+s^*)$$
are minimisers of $\|X-A\|^2 + \|Y-B\|^2$ for $(X,Y)\in \mathcal E$.

To prove it note that if $(X,Y)\in \mathcal E$ then $Y=s-X$ for some $s\in S$. Then:
$$\|X-A\|^2+\|Y-B\|^2 = 2\|X\|^2+\|A\|^2+\|B\|^2+\|s\|^2-2\langle X,A-B+s\rangle-2\langle s,B\rangle $$
If we drop the constants we find that this is the same as minimizing
$$2\|X\|^2-2\langle X, A-B+s\rangle+\|s\|^2-2\langle s,B\rangle$$
where $X\in H$ and $s\in S$. We first minimize this for $X$, for any given $s$ and $\|X\|$ fixed this term is smallest $X=\lambda(A-B+s)$ for some $\lambda ≥0$. Finding the $\|X\|$ for which that gets minimized then leads to the question of when:
$$2\|X\|^2(\lambda^2-\lambda)$$
is minimal, which happens for $\lambda =\frac12$ and then the minimal $X,Y$ are always of the form
$$X=\frac12 (A-B+s),\qquad Y=\frac12 (B-A+s)$$
where $s\in S$. Whats left is to find the $s$ so that:
$$-\frac12\|A-B+s\|^2+\|s\|^2-2\langle B,s\rangle = \frac12 \|s\|^2 -\langle s, A+B\rangle-\frac12\|A-B\|^2$$
becomes minimal. But this optimisation problem is the same as $(*)$.
