0

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.

  • You just need to prove that absolute value obeys triangle inequality. This has been done: http://math.stackexchange.com/questions/307348/proof-of-triangle-inequality – Piotr Benedysiuk Aug 11 '16 at 11:40

2 Answers2

1

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}.$$

Robert Z
  • 145,942
  • How does one identify the three separate cases? – Mathematicing Aug 11 '16 at 11:47
  • 1
    @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. – Robert Z Aug 11 '16 at 11:54
  • 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. – Mathematicing Aug 11 '16 at 11:55
  • @Mathematicing Is it better now? Of course by symmetry $d(z,y)=d(y,z)$. – Robert Z Aug 11 '16 at 11:58
  • Why is z not allowed to be less than or equal to y? – Mathematicing Aug 11 '16 at 12:08
  • @Mathematicing 2 Yes, see i) for $z<y$ and ii) for $z=y$. In step i) and iii) you can take also the equal sign. – Robert Z Aug 11 '16 at 12:13
0

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

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

Roman83
  • 17,884
  • 3
  • 26
  • 70