Let $A$ and $B$ be two subsets of a metric space $X \subset \mathbb{R}$, where the metric is the usual notion of distance. Clearly if $A \cap B \neq \varnothing$, then $\mathrm{dist}(A, B) = \inf\{d(a, b)\mid a \in A, b \in B\} = 0$. So suppose that $A \cap B = \varnothing$ and $\forall b \in B, \forall a \in A: b > a$. If we are talking only about metric spaces like $X$, it feels intuitive that the distance between $A$ and $B$ should equal the distance between their respective supremum and infimum. That is, $\mathrm{dist}(A, B) = d(\sup(A), \inf(B))$. (I think this could be proven by showing a contradiction with respect to the triangle inequality property of a metric.)

So my question is that how is this intuitive feeling of distance between two sets generalized, if at all, and what properties does the surrounding space $X$ need to satisfy? Is it necessary and sufficient for $X$ to obey the order axioms and density of real numbers, or whatever their general variants are called?

  • $\begingroup$ What is a real metric space? Is it a subspace of $\Bbb R$, endowed with its usual distance? $\endgroup$ Jan 30, 2021 at 16:43
  • 3
    $\begingroup$ In a general metric space, what does $b>a$ mean? $\endgroup$
    – coffeemath
    Jan 30, 2021 at 16:44
  • 2
    $\begingroup$ At least, it's better than “real metric space”. $\endgroup$ Jan 30, 2021 at 16:47
  • 2
    $\begingroup$ Quaster: "I suppose we are not dealing..." But it is your question! So you should know (and say) exactly what we are dealing with. $\endgroup$
    – coffeemath
    Jan 30, 2021 at 16:52
  • 1
    $\begingroup$ X would have to at least be partially ordered for you to be able to talk about supremum and infimums. $\endgroup$
    – C Squared
    Jan 30, 2021 at 16:53

1 Answer 1


Your assumption that, if $A,B\subset\Bbb R$, then$$\operatorname{dist}(A,B)=|\sup(A)-\inf(B)|\tag1$$is wrong. Note that if you exchange $A$ and $B$, then the number $\operatorname{dist}(A,B)$ reamins the same, whereas $|\sup(A)-\inf(B)|$ changes (in general). Anyway, if$$A=\left\{\frac1n\,\middle|\,n\in\Bbb N\right\}\quad\text{and}\quad B=\left\{\frac{\sqrt2}n\,\middle|\,n\in\Bbb N\right\}$$then $\operatorname{dist}(A,B)=0$, but $\inf(A)=\inf(B)=0$, $\sup(A)=1$ and $\sup(B)=\sqrt2$. So you neither have $(1)$ nor $\operatorname{dist}(A,B)=|\sup(B)-\inf(A)|$.

  • 2
    $\begingroup$ Very good counter-examples. It always amazes me how fast some posters are on this site! I will add a note to the OP. OP you may want to look at intervals in the real line when developing your intuition and keep in mind that those intervals are connected sets in the real line. So if you want to fix your hypothesis you should add that the sets are connected sets of R. Also you should fix the distance so that $d(a,b)=d(b,a)$. Then when you try to generalize to $R^{2}$ condsider an Annulus and its interior, what distance should these have, notice that the sup and inf of the coordinates wont work. $\endgroup$ Jan 30, 2021 at 17:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .