Solution (source code)

= Solution

For fixed $x\in X$, the function $a\mapsto d(x,a)$ on $A$ is continuous, indeed $1$-<Lipschitz continuous> by the <reverse triangle inequality>. A continuous real-valued function on a nonempty <compact space> attains its minimum by the <extreme value theorem>. Hence some $a_0\in A$ satisfies
$$
\boxed{d(x,a_0)=\min_{a\in A}d(x,a)=D_A(x).}
$$
The metric is symmetric, so this is also $d(a_0,x)$. Compactness supplies attainment of the infimum.