Solution (source code)

= Solution

Choose $a_0\in A$ and put $R=\|a_0-y\|$. The intersection $K=A\cap\overline B(y,R)$ is nonempty, closed and bounded in $\mathbb R^n$, hence <compact>. The <continuous> distance <function> $a\mapsto\|a-y\|$ attains a minimum at some $x\in K$. For $a\in A\setminus K$ its value is strictly greater than $R$, while the value at $x$ is at most that at $a_0$, namely $R$. Thus this minimum on $K$ is a minimum on all of $A$:
$$
\boxed{x\in A,\qquad\|x-y\|\leq\|a-y\|\quad\text{for every }a\in A.}
$$
The set $A$ itself need not be bounded; only the <compact> portion needed to find the nearest point is bounded.