# An inequality for metric spaces: $|d(x, z) − d(y, z)| \le d(x,y)$

Question : Prove $|d(x, z) − d(y, z)|$ is less than or equal to $d(x, y)$.

I know I have to use the triangle inequality but I'm just not sure how to apply it with a negative $d(y,x)$.

-
$d(x,z) \leq d(x,y) + d(y,z)$ gives $d(x,z) - d(y,z) \leq d(x,y)$. Similarly, $d(y,z) \leq d(y,x) + d(x,z)$ gives $d(y,z) - d(x,z) \leq d(y,x) = d(x,y)$, so $\pm(d(x,z) - d(x,y)) \leq d(x,y)$. Now think about what the value of $|d(x,z)-d(y,z)|$ is by definition. –  t.b. Apr 10 '12 at 9:23
Answered this not long ago. Probably a multiplicate. –  Did Apr 10 '12 at 15:24
–  Did Apr 10 '12 at 15:32
I have edited the question to make the question inline. Please post questions in the body and a big hint about the question in the title. Regards, –  user21436 Apr 11 '12 at 0:43

The claim is invariant under exchange of $x$ and $y$. Thus without loss of generality we can assume $d(x,z)\ge d(y,z)$. Then $|d(x,z)-d(y,z)|=d(x,z)-d(y,z)$, which is $\le d(x,y)$ by the triangle inequality.

-

First note that $|a-b|\leq |a|+|b|$\ Now, $|d(x,z)-d(y,z)|\leq |d(x,z)|+|d(y,z)|=d(x,z)+d(y,z)\leq d(x,y) (\because \text{triangle inequality}).$

-
This doesn't work this way. The triangle inequality reads $d(x,y) \leq d(x,z) + d(y,z)$, not the other way around. –  t.b. Apr 10 '12 at 17:33