Prove that there exists a $y_0$ in $ S$ such that $d(x,S)=\Vert x-y_0 \Vert $ Suppose that $S$ is a closed subset of $\Bbb R^n $ and that $x$ is a point of $S^c$.
Prove that there exists a $y_0$ in $ S$ such that $d(x,S)=\Vert x-y_0 \Vert $.
This is how I tried and I want some feedback on my proof.
(My proof)
Case1: Suppose $S$ is a finite set, say $S=\{ y_1, y_2, \cdots , y_n\}$ and let x be given.
Let $T=\{\Vert  x-y_1 \Vert ,\Vert  x-y_2\Vert , \cdots ,\Vert  x-yn\Vert \}$
Since T is a finite set, T has the minimum m of T.
Denote $y_i$ such that $ m=\Vert x-y_i\Vert$ by $y_0$.
Then $d(x,S)=inf\{\Vert x-y_i\Vert\ : y_i \in S\} = \Vert x-y_0 \Vert $.
Case2: Suppose S is an infinite set and let $x$ be given.
Suppose to the contrary that there is no $y_0 \in S$ sucht that $d(x,S)=\Vert x-y_0 \Vert $.
Since $d(x,S)=inf\{\Vert x-y_i\Vert\ : y_i \in S\}$, we can choose $y_k \in S$ such that $d(x,S)\lt\Vert x-y_k \Vert\lt d(x,S)+\epsilon_k$.
Let $\epsilon_k=\frac1 k$ be given. Then $d(x,S)\lt\Vert x-y_k \Vert\lt d(x,S)+\frac1 k \le d(x,S)+1$
Since $\Vert x-y_k \Vert$ is bounded, $\Vert x-y_{k_j} \Vert$ is also bounded.
Then by the Bolzano Weierstrass Theorem, $\Vert x-y_{k_j} \Vert$ has a subsequence $\Vert x-y_{k_{j_l}} \Vert$ converging to $\Vert x-y' \Vert$.
Since $\Vert x-y_{k_{j_l}} \Vert$ is a subsequence of $\Vert x-y_k \Vert$, it follows that $\Vert x-y' \Vert$ is a cluster point of $\Vert x-y_k \Vert$, thus $\Vert x-y' \Vert$ $\neq$ $\Vert x-y_0 \Vert$.
I was about to derive contradiction in case 2, but now I finally realized that there is no guarantee that there is only one cluster point so I cannot proceed further. Please give some feedback on my proof! 
 A: By definition of $d(x,S)$, there exists an infinite sequence $\{y_{i}:i\in\mathbb{Z}\}$ such that $d(x,y_{i})$ converges to $d(x,S)$. 
Denote the set $C=\{y_{i}:i\in\mathbb{Z}\}\subset S$. It is easy to see that $C$ is a bounded set in $R^{n}$. Use Bolzano-Weierstrass Theorem, there exists a subsequence $\{z_{j}:j\in\mathbb{Z}\}$ of $\{y_{i}:i\in\mathbb{Z}\}$ such that $z_{j}$ converges to some $z\in R^{n}$. Since each $z_{j}\in S$ and $S$ is a closed set, $z\in S$. It leaves to show that $d(x,S)=d(x,z)$:
$$d(x,S)-d(x,z)=[\lim_{j\rightarrow\infty}d(x,z_{j})]-d(x,z)$$
$$=\lim_{j\rightarrow\infty}(d(x,z_{j})-d(x,z))$$
Triangle inequality says $d(z_{j},z)+d(z,x)\geq d(z_{j},x)$ hence $d(x,z_{j})-d(x,z)\leq d(z_{j},z)$.
Triangle inequality also says $d(x,z_{j})+d(z_{j},z)\geq d(x,z)$ hence $d(x,z_{j})-d(x,z)\geq -d(z_{j},z)$.
We have
$$0=\lim_{j\rightarrow\infty}(-d(z_{j},z))\leq\lim_{j\rightarrow\infty}(d(x,z_{j})-d(x,z))\leq\lim_{j\rightarrow\infty}(d(z_{j},z))=0$$
It follows that $d(x,S)-d(x,z)=0,~z\in S$ as desired.
A: You're almost there. Rather than think about the sequence of norms, think about the sequence of the $y_k$'s. It is a bounded sequence (why?) in a closed set; can you think of how compacity is of help here?
