I have a simple question. Often times in optimization, the following function is used:
Let $H$ be a real Hilbert space and $C$ a nonempty closed convex subset of $H$, then the metric projection is defined as the function,
$$P_C(x) = \text{argmin}_{y \in C} ||x - y||$$
Sometimes (not always), this function will have a closed form. For example, if $C$ is the interval $[-1,1]$ in $\mathbb{R}$, then $P_C(x) = \min(\max(x,-1),1)$.
Is there a pattern to when $P_C$ has a closed form versus when you have to solve it numerically?