Triangle inequality for the distance between two sets
I am looking for a reference for the proof of this fact :
Let $A$ and $B$ two nonempty closed subsets of a metric space $X$ and let $x\in X$. Then:
dist$(A,B)\leq$ dist$_A(x)$+ dist$_B(x)$
I am sure that it has already been proved, but I don't find any book or old article where it is.
Note: I know how to prove it. I am just looking for a reference about it.
Solution 1:
I'm $\DeclareMathOperator{\dist}{dist}$assuming $(X,\dist)$ is a metric space and $\dist(A,B) = \inf \{\dist(a,b) : a \in A, b \in B\}$ and $\dist(x,A) = \inf\{\dist(x,a):a \in A\}$.
Let $\varepsilon > 0$. By definition of infimum, there exists $a \in A$ be such that $\dist(a,x) < \dist(x,A) + \frac{\varepsilon}2$ and $b \in B$ such that $\dist(b,x) < \dist(x,B) + \frac{\varepsilon}2$. $\DeclareMathOperator{\dist}{dist}$
We have:
$$\dist(A,B) \le \dist(a,b) \le \dist(a, x) + \dist(x,b) < \dist(x,A) + \dist(x,B) + \varepsilon$$
Letting $\varepsilon \to 0$, we obtain $\dist(A,B) \le\dist(x,A) + \dist(x,B)$.
Solution 2:
We have
\begin{align} d(A,B)&=\inf\{d(a,b)\,|\,a\in A, b\in B\}\\ d(x,A)&=\inf\{d(x,a)\,|\,a\in A\}\\ d(x,B)&=\inf\{d(x,b)\,|\,b\in B\} \end{align}
Let $(a_n)$ be a minimizing sequence for $d(x,A)$ with $d(x,a_n)<d(x,A)+\frac1n$, and similarly for $(b_n)$. The existence of such sequences is guaranteed by the infimum property. Then:
$$d(x,A)+d(x,B)+\frac2n>d(x,a_n)+d(x,b_n)\geq d(a_n,b_n)\geq d(A,B)$$
Here, we've used respectively the minimizing property in the definition of $a_n$ and $b_n$, the triangle inequality for the metric $d$ on $X$, and the infimum definition of $d(A,B)$.
Letting $n\to\infty$, we get $d(A,B)\leq d(x,A)+d(x,B)$, which completes the proof.