Solution (source code)

= Solution

The <distance to a set> is finite and nonnegative because $A$ is nonempty. For $x,x'\in X$ and every $a\in A$, the <triangle inequality> gives
$$
d(x,a)\leq d(x,x')+d(x',a).
$$
Taking the infimum over $a$ yields $D_A(x)\leq d(x,x')+D_A(x')$. Interchanging $x$ and $x'$ gives the opposite inequality. Together these imply
$$
\boxed{|D_A(x)-D_A(x')|\leq d(x,x').}
$$
Thus the <distance to a set> is $1$-<Lipschitz continuous>. No closedness, compactness or attainment of the infimum was used.