As pointed out in comments, the infimal distance between sets $d(A,B) = \inf\{d(a,b) : a \in A, b \in B\}$, is not a metric. It fails to satisfy even weaker requirements such as
- pseudo-metric (allowed to be zero between different elements)
- quasi-metric (triangle inequality relaxed to $f(A,C)\le K(d(A,B)+d(B,C))$
It's simply unusable as a metric. In contrast, the Hausdorff distance $d_H$ is a metric on the set of nonempty bounded closed subsets, works better. (If one drops "closed", $d_H$ is still a pseudo-metric. If one drops "bounded", it still satisfies the axioms of pseudo-metric but may be infinite sometimes.)
Let $f(0,y)=0$ for all $y\ne 0$, and let $f(1,y)=0$ for all $y\ne 1$. Let $f(x,y)=1$ in all other cases. This includes $x=0,y=0$ and $x=1$, $y=1$.
Look at the left-hand side. For any fixed $y$, we have $\inf_{x\in X} f(x,y)=0$. For if $y=0$ we can take $x=1$, and if $y\ne 0$ we can take $x=0$.
Taking the sup of all these $0$'s leaves us at $0$.
Now look at the right-hand side. For any $x$, we have $\sup_{y\in Y} f(x,y)=1$, since for any $x$ there is an $y$ such that $f(x,y)=1$. Taking the inf over all $x$ leaves us at $1$.
Thus the inequality can be strict.
We used the names $0$ and $1$ for certain elements of $X$ and $Y$. They could equally well have been called $x_0,x_1,y_0,y_1$.
Remark: We consider the meaning of an expression such as such as $\sup_{y\in Y}f(x,y)$. The function $f$ is bounded. Fix $x$, and look at $f(x,y)$ as $y$ varies over $Y$. The supremum over all $y$ of $f(x,y)$ is sort of the greatest possible value of $f(x,y)$ for that fixed value of $x$. Not really greatest, it is least upper bound, but for visualization we can think of it as the greatest. So $\sup_{y\in Y} f(x,y)$ is a function of $x$, say $g(x)$. Then, in the expression on the right, we sort of take the smallest possible value of $g(x)$.
Best Answer
$D(A,B)$ is the maximum of the upper bound on the lower bound on the distance between two elements in the sets either way. Which is to say (very informally) the "largest" of the "shortest" distance measures between the sets.
Take, for example $A=\{0, 2\}, B=\{1,2,4\}$ and $d(x,y)=\lvert x-y\rvert$
$$\begin{align} {\sup}_{a\in A}{\inf}_{{b\in B}}~d(a,b) = ~ & \sup \big\{\inf \{d(a,b): b\in B\}: a\in A\big\} \\ =~ & \sup\big\{\inf\{d(a,1), d(a, 2), d(a,4)\}: a\in A\big\} \\ = ~ & \sup\big\{\inf \{d(0,1), d(0,2), d(0,4)\},\inf\{d(2,1), d(2,2), d(2,4)\}\big\} \\ = ~ & \sup\big\{\inf\{ 1,2,4\}, \inf\{1,0,2\}\big\} \\=~ & \sup\big\{ 1,0\big\} \\=~ & 1\\[2ex] {\sup}_{b\in B}{\inf}_{{a\in A}}~d(a,b) = ~ & \sup\big\{\inf \{d(a,b): a\in A\}: b\in B\big\} \\ = ~ & \sup\big\{\inf\{d(0,b), d(2,b)\}: b\in B\big\} \\ = ~ & \sup\big\{\inf \{d(0,1), d(2,1)\},\inf\{d(0,2), d(2,2)\},\inf\{d(0,4),d(2,4)\}\big\} \\ = ~ & \sup\big\{\inf\{ 1,1\}, \inf\{2,0\}, \inf\{4,2\}\big\} \\=~ & \sup\big\{ 1,0,2\big\} \\=~ & 2\\[2ex]D(A,B)~=~&\max\{1,2\}\\ =~& 2\end{align}$$
$D(A,B)$ will be zero if $\forall a\in A~\exists b\in B: d(a,b)=0$ and $\forall b\in B~\exists a\in A: d(a,b)=0$. Every point in either set is zero distance from some point in the other set. (Notice: This is not claiming they are identical.)