My intuition tells me that the following statement must be true:
Let $(X, d)$ be a metric space and let $(E_n)_{n=1}^\infty$ be a sequence of subsets of $X.$ Then, for any $x \in X,$ $$ d \left(x, \bigcup_{n=1}^\infty E_n \right) = \inf_{n \in \mathbb{N}} d(x, E_n). $$
However, I have only been able to prove one inequality (which is trivial): since $d(x, E) \leq d(x, E_n)$ for every $n,$ $d(x, E) \leq \inf_{n \in \mathbb{N}} d(x, E_n).$
It would help me a lot if someone could complete the proof or give a counterexample for my statement.
For any $\epsilon>0, \quad\inf_{n\in \mathbb{N}}d(x,E_n)< d(x,E)+\epsilon$.
Proof: The distance $d(x,E)$ from a point $x$ to a set $E$ is defined as $\inf_{y\in E}d(x,y)$. Choose a point $y\in E$ such that $d(x,y)<d(x,E)+\epsilon$. Since $y$ must be in at least one of the sets $E_n$, the result follows.