Distance between point and set For a non-empty subset $A$ of $\mathbb{R}^n$, and any $x\in \mathbb{R}^n$, define $d(x,A)=\inf\{ |x-a|\colon a\in A\}$. The problem is to show that if $A$ is closed and for any $r>0$, the set $\mathcal{O}=\{ y\in\mathbb{R}^n\colon d(y,A)<r \}$ is open.
I tried it to verify geometrically: consider any $x\in\mathcal{O}$. Let $d(x,A)=l$. Clearly, $0\leq l<r$. I considered the ball $B(x,r-l)$, but failed to prove that it is in $\mathcal{O}$. I don't know whether this is correct to prove, but as per my intuition, I thought it is true.
Please, give suggestion.

Adding a small question to initially posted: to prove that $\mathcal{O}$ is open, is it necessary to assume $A$ is closed? Or can we consider $A$ as any non-empty subset of $\mathbb{R}^n$.
 A: Suppose $A$ is closed, and consider a point $y_0\in{\cal O}_r$.
When $y_0\in A$ then $y\in{\cal O}_r$ for all $y$ in the open ball $B_r(y_0)$.
When $y_0\notin A$ then the continuous function $x\mapsto d(y_0,x)$ assumes a positive minimum on $A$, since $A$ is closed. This means that there is a point $x_0\in A$ with
$$d(y_0,x_0)=d(y_0,A)<r\ .$$
It follows that $d(y_0,x_0)=r-\epsilon$ for some $\epsilon>0$.  Then for all points $y$ in the open ball  $B_\epsilon(y_0)$ one has
$$d(y,A)\leq d(y,x_0)\leq d(y,y_0)+d(y_0,x_0)<\epsilon+( r-\epsilon)\ ,$$
which proves $y\in{\cal O}_r$ for these points.
A: Sorry for all the edits. In my previous attempt, I forced my proof to use the fact that $A$ is closed, but this made the proof more complicated without apparent necessity.
So I'm scrapping the hypothesis that $A$ is closed. I don't think it's necessary. But if I'm wrong, I'm sure someone will be quick to point it out. :-)
As you said, let $x \in \mathcal{O}$ and $l = d(x,A)$. Then $l < r$. Let $0 < R < (r - l)$. We wish to show that $B(x,R) \subseteq \mathcal{O}$.
Let $y \in B(x,R)$. We need to show that $y \in \mathcal{O}$. Let $\delta > 0$. Since $d(x,A) = l$, there is some $a \in A$ such that $d(x,a) < l + \delta$. Then
$$d(y,a) \leq d(y,x) + d(x,a) < R + l + \delta$$
We can find such an $a \in A$ for any $\delta > 0$, so
$$d(y,A) \leq R + l$$
But $R + l < r$, so we're done.
