Let $K$ be a compact subset of a normed vector space $(X,\|\cdot\|)$, it's easy to see that, given any $x\in X$, there exists $y\in K$ such that $\|x-y\|=\inf\limits_{z\in K} \|x-z\|$. Now if in addition $y$ is unique for each $x\in X$, how to show that the mapping $P: X\to K, x\mapsto y$ is continuous?
I can only get this result now: $d_K(x)\triangleq \inf\limits_{z\in K} \|x-z\|$ is a continuous map from $X$ to $\mathbb{R}$. Because $$ d_K(x') \le \|x'-y\| \le \|x'-x\|+\|x-y\| = \|x'-x\|+d_K(x), $$ $$ d_K(x) \le \|x-y'\| \le \|x-x'\|+\|x'-y'\| = \|x'-x\|+d_K(x'), $$ so $|d_K(x')-d_K(x)|\le \|x'-x\|$.
But I cannot derive the continuity of $P$ by this result alone. The uniqueness of the best approximation may be necessary in the proof process, but I don't know how to use it.
Can someone give me a hint?
Suppose that $(x_n) \subset X$ is a convergent sequence with $x_n \to x$; we want to show that $P(x_n) \to x$.
Suppose for the purpose of contradiction that $P$ is discontinuous. That is, there exists a convergent sequence $(x_n) \subset X$ with $x_n \to x$ such that $P(x_n)$ does not converge to $P(x)$. There are two possibilities: either $P(x_n)$ converges to some $y \in K$ such that $P(y) \neq x$, or the sequence $P(x_n)$ fails to converge.
Suppose that $P(x_n)$ converges to $y \neq P(x)$. The continuity of $x \mapsto d_K(x)$ implies that $d(x_n,P(x_n))$ must converge to $d(x,P(x))$. On the other hand, the continuity of $d$ implies that because $x_n \to x$ and $P(x_n) \to y$, it must hold that $d(x_n,P(x_n)) \to d(x,y)$. Thus, we conclude that $d(x,P(x)) = d(x,y)$, which means that the closest element of $K$ to $x$ is non-unique.
Suppose now that $P(x_n)$ fails to converge. Note that by the continuity of $d_K$, we have $d(x_n,P(x_n)) \to d(x,P(x)) = d_K(x)$. I make the following claim.
With that claim, there must exist subsequences $(x^1_n), (x^2_n)$ of $(x_n)$ such that $P(x^1_n) \to y^1$ and $P(x^2_n) \to y^2$ with $y^1 \neq y^2$. For each $i = 1,2$: because $x^i_n \to x$ and $P(x_n^i) \to y^i$, we must have $d(x_n^i, P(x_n^i)) \to d(x,y^i)$. However, we already established that the sequence $d(x_n, P(x_n))$ converges to $d_K(x)$, and any subsequences of this sequence must have the same limit. Thus, we conclude that $$ d_K(x) = d(x,y^1) = d(x,y^2), $$ which means that the closest element of $K$ to $x$ is non-unique.