Let $M$ be a metric space with the metric $d$, $X$ a subset of $M$, and $r>0$. Also, $B(x;r)$ is the open ball centered at $x$ with radius $r$.
Defining $\begin{equation*}\begin{aligned} B(X;r)=\bigcup_{x \in X}B(x;r), d(a,X)= \underset{x \in X}{\operatorname{inf}}d(a,x)\end{aligned}\end{equation*}$,
prove $\begin{equation*}d(a,X)=\operatorname{inf}\text{{$r>0; a \in B(X;r)$}}.\end{equation*}$