For a set $S \subseteq \mathbb{R}^n$ and a point $x \in \mathbb{R}^n$, let $c_S(x)$ be the point $s \in S$ that minimizes $\|x-s\|$ if such a point exists and is unique. It is known that $c(x) = s$ exists and is unique if $S$ is closed and convex. My question is: is this "if and only if"? More precisely: Are the following statements equivalent:
- $S$ is closed and convex.
- $c_S(x)$ is well-defined for all $x \in \mathbb{R}^n$.
If $S$ is not closed, then there are points that do not have a nearest neighbor in $S$. If $S$ is closed, then, for every $x \in \mathbb{R}^n$, there exist points that are nearest neighbors to $x$. Thus, the question boils down to the following: Let $S \subseteq \mathbb{R}^n$ be closed. Then the following two statements are equivalent:
- $S$ is convex.
- For every $x \in \mathbb{R}^n$, there is a unique element $s \in S$ that minimizes $\|x-s\|$.
Is this true?