Prove that the infimum $i=\inf\{ d(a,y):y\in Y \}$ is always attained if $Y$ is closed. In Solomon's descriptive set theory notes, he asked the following exercise. 

Let $X$ be a separable, completely metrizable by a metric $d$ and contains a dense subset $D\subseteq X.$
  Let $Y\subseteq X$ be closed and let $a\in X \setminus Y.$
  Define 
  $$i = \inf \{ d(a,y):y\in Y \}.$$
  Question: Prove that there is an element $b\in Y$ such that $d(a,b)=i$.

My attempt: For any $n\in\mathbb{N},$ by the definition of infimum, 
$$i+\frac{1}{n} > d(a,b_n)$$
for some $b_n\in Y.$
Then the sequence $(b_n)_{n\geq 1}$ is Cauchy. 
By completeness of $X,$ there exists $b\in X$ such that $(b_n)_{n\geq 1}$ converges to $b.$
Since $Y$ is closed, we have $b\in Y.$
Clearly $d(a,b)\leq i.$
By definition of $b\in Y,$ we have $d(a,b)\geq i.$
Hence, $d(a,b)=i.$
Is my proof correct?
EDITED: As pointed out by @5xum, my proof has a flaw. If this is the case, then how should one prove the statement above? 

Your proof is not OK.

Then the sequence $(b_n)_{n\geq 1}$ is Cauchy.

First of all, you didn't prove this, and second of all, it's not even true. For example, take
$$X=\mathbb R^2\\
Y=\{(x,y)| x^2+y^2=1\}=S_1\\
a=(0,0)$$
Then, the sequence $b_n$ could be $b_n=(0,(-1)^n)$ which is not Cauchy.
