# Distance between two sets in a metric space in different conditions

let $(X,d)$ be a metric space and let $A,B\subseteq X$. we define the distance between $A$ and $B$ as:

$$\operatorname{dist}(A,B)=\inf\{d(a,b):a \in A,b \in B\}$$

# 1

show that for any $x \in X$, we have $\operatorname{dist}(A,B)\le \operatorname{dist}(x,A)+\operatorname{dist}(x,B)$. (Hint please)

# 2

if $A \subseteq B$ and $x \in X$, prove that $\operatorname{dist}(x,A)\le\operatorname{dist}(x,B)+\operatorname{diam}(B)$?

where: $\operatorname{diam}(B)=\sup\{d(y,z):y,z \in B\}$.

-
Hint (1):triangle inequality.(2) Did you try drawing a picture? It can help with the intuition. –  Ludolila Feb 17 '13 at 12:32

1. For any $a\in A,\ b\in B$ we have $d(A,B)\le d(a,b)\le d(a,x)+d(x,b)$. Since this holds for any $a\in A$, taking $\inf_{a\in A}$, we have that $$d(A,x)\ge d(A,B)-d(x,b).$$ Then do the same for infing on $b\in B$.
2. Similarly, for any $a\in A,\ b\in B$, we have $d(x,A)\le d(x,a)\le d(x,b)+d(b,a)$.
(1) If $\operatorname{dist}(A,B)>\operatorname{dist}(x,A)+\operatorname{dist}(x,B)$, it follows from the definition of supremum that there are $a\in A$ and $b\in B$ such that $d(a,b)>\operatorname{dist}(x,A)+\operatorname{dist}(x,B)$. Now apply the triangle inequality.
(2) Let $b\in B$; then $d(x,a)\le d(x,b)+d(b,a)$.