The distance function is defined as

$d\left ( x,y \right )=\left | x-y \right |= \begin{cases} x-y, &\text{if }x\geq y \\ y-x,&\text{otherwise} \end{cases}$

For $d\left ( x,y \right )$ to be a metric, it must be non-negative, symmetric and satisfy the triangle inequality.

I'm unable to show that it satisfies the triangle inequality on R.

Help is appreciated.

Thanks in advance.


We will show the missing property i. e. the triangular inequality : $d(x,z)+d(z,y)\geq d(x,y)$.

By symmetry assume that $y\leq x$ and consider three separate cases $z<y$, $y\leq z\leq x$, and $x<z$.

i) if $z<y$ then $$d(x,z)+d(z,y)=x-z+y-z\geq d(x,y)=x-y \Leftrightarrow 2y\geq 2z \quad\mbox{which holds};$$

ii) if $y\leq z\leq x$ then $$d(x,z)+d(z,y)=x-z+z-y\geq d(x,y)=x-y \quad\mbox{which holds};$$

iii) if $x<z$ then $$d(x,z)+d(z,y)=z-x+z-y\geq d(x,y)=x-y \Leftrightarrow 2z\geq 2x \quad\mbox{which holds}.$$

  • $\begingroup$ How does one identify the three separate cases? $\endgroup$ – Mathematicing Aug 11 '16 at 11:47
  • 1
    $\begingroup$ @Mathematicing You are on the real line, so once you choose the points $x$ and $y$ with $x\geq y$, then the third point $z$ has three possible positions with respect to the interval $[y,x]$: to the left, inside and to the right. $\endgroup$ – Robert Z Aug 11 '16 at 11:54
  • $\begingroup$ I cannot understand why in i) you took |x-z|+|z-y|. What motivates you to make that choice? I've been doing Abstract Algebra for a large part and analysis comes across as very very different. $\endgroup$ – Mathematicing Aug 11 '16 at 11:55
  • $\begingroup$ @Mathematicing Is it better now? Of course by symmetry $d(z,y)=d(y,z)$. $\endgroup$ – Robert Z Aug 11 '16 at 11:58
  • $\begingroup$ Why is z not allowed to be less than or equal to y? $\endgroup$ – Mathematicing Aug 11 '16 at 12:08

Use $|a|+|b|\ge|a+b|$

Then $$|x-z|+|z-y|\ge |x-z+z-y|=|x-y|$$


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.