# Triangle Inequality help

Wondering where my logic is going wrong in this assignment:

Show that $$||x|-|y|| \leq |x-y|$$

Using the fact $$||x|-|y||, |x-y| \geq 0$$

It follows $$(|x|-|y|)^2 \leq (x-y)^2$$

Using the fact $$|x|^2 = x^2$$

$$x^2 -2|x||y| +y^2 \leq x^2 -2xy +y^2$$

Cancelling down:

$$|xy| \leq xy$$

Which I know is not true. Thanks for any input.

• You are dividing at the last step by $-2$. This changes the $\le$ into a $\ge$, giving you a correct statement. – Crostul Dec 17 '18 at 20:32
• You divided by $-2$ but didn't change the inequality direction. – user515599 Dec 17 '18 at 20:33

## 3 Answers

Since $$xy\le|x||y|$$ then you have $$-2|x||y|\le -2xy.$$

• Thankyou so much! – PolynomialC Dec 17 '18 at 20:33

You divided by $$-2$$ but did not change the sign. Another approach.

Observe $$|x|=|x-y+y|\leq|x-y|+|y|\implies |x|-|y|\leq|x-y|$$

Simillarly we have $$|y|-|x|\leq|x-y|$$.

Hence $$-|x-y|\leq|x|-|y|\leq|x-y|\implies \big||x|-|y|\big|\leq|x-y|$$

First, in line 3 you are already using the fact that $$||x|-|y||\leq|x-y|$$.

However, assuming this from the start (as I am guessing you want to move into something you already proved and then work your way back) and following each of the steps you took, notice that between lines 6 and 8 you would have and intermediate step as follows: $$-2|x||y|\leq-2xy$$ or equivalently $$-|x||y|\leq -xy$$.

There, you multiply both sides of the inequality by $$-1$$, inverting the inequality $$\bigl((a\leq b)\rightarrow (-b\leq -a)\bigr)$$ ending up with $$xy\leq |x||y|$$.