Solution (source code)

= Solution

Write $h(A,B)=\sup_{a\in A}\operatorname{dist}(a,B)$, so that $\rho(A,B)=\max\{h(A,B),h(B,A)\}$ is the <Hausdorff distance>. Since $X$ is a <bounded set>, there is a finite $M$ with $d(x,y)\leq M$. Nonemptiness of $A,B$ therefore gives $0\leq h(A,B)\leq M$, so $\rho$ is finite. Its symmetry and nonnegativity are immediate, as is $\rho(A,A)=0$.

If $\rho(A,B)=0$, then every $a\in A$ has zero <distance to a set> $B$. Since $B$ is a <closed set>, part (a)(iii) gives $A\subseteq B$. Interchanging the sets gives $B\subseteq A$. Thus $\rho(A,B)=0$ implies $A=B$. Closedness is essential here: without it a set and its <closure> have <Hausdorff distance> zero.

For the <triangle inequality>, fix $a\in A$ and $\epsilon>0$. The <approximation property of an infimum> supplies $b\in B$ with $d(a,b)<\operatorname{dist}(a,B)+\epsilon$, and then $c\in C$ with $d(b,c)<\operatorname{dist}(b,C)+\epsilon$. Consequently,
$$
\operatorname{dist}(a,C)\leq d(a,c)<\operatorname{dist}(a,B)+h(B,C)+2\epsilon.
$$
Let $\epsilon\downarrow0$ and take the <supremum> over $a$ to obtain $h(A,C)\leq h(A,B)+h(B,C)$. Applying this inequality in the reverse direction as well yields
$$
\boxed{\rho(A,C)\leq\rho(A,B)+\rho(B,C)}.
$$
All <metric> axioms follow. Boundedness was used to ensure finiteness, and closedness to distinguish different sets; neither was needed for the <triangle inequality>.