# Mathematical Analysis Proof: |x-y|<= |x|+|y|

Bonnie

## Homework Statement

1. Show that for all real numbers x and y:
a) |x-y| ≤ |x| + |y|

## Homework Equations

Possibly -|x| ≤ x ≤ |x|,
and -|y| ≤ y ≤ |y|?

## The Attempt at a Solution

I tried using a direct proof here, but I keep getting stuck, especially since this is my first time ever coming across mathematical analysis, so I don't have much intuition for it. What I did think was possibly trying to use the triangle inequality somehow?
So far I have added the two above equations together to get
-|x| - |y| ≤ x + y ≤ |x| + |y|
But If that is right then I have no idea how to manipulate it to get the original statement to be proven. Any help would be much appreciated as I seem to keep going in circles.

Thanks :)

Mentor
2022 Award
Since ##|x-y|=|y-x|## you may assume that ##x\geq y## which reduces the cases you have to consider. And this is the triangle inequality, because ##|x-y|=|x+(-y)|\leq |x|+|-y|=|x|+|y|## so you cannot use what you want to prove.

Homework Helper
Dearly Missed

## Homework Statement

1. Show that for all real numbers x and y:
a) |x-y| ≤ |x| + |y|

## Homework Equations

Possibly -|x| ≤ x ≤ |x|,
and -|y| ≤ y ≤ |y|?

## The Attempt at a Solution

I tried using a direct proof here, but I keep getting stuck, especially since this is my first time ever coming across mathematical analysis, so I don't have much intuition for it. What I did think was possibly trying to use the triangle inequality somehow?
So far I have added the two above equations together to get
-|x| - |y| ≤ x + y ≤ |x| + |y|

Thanks :)

As fresh_42 points out, you may as well assume that ##x < y##; the case ##x = y## is trivial. Furthermore, the cases ##x=0## or ##y = 0## are trivial as well. Given all that, one way to go is by a (tedious?) consideration of cases:
(a) ##0 < x < y##; (b) ##x < 0 < y##; and (c) ##x < y < 0##.

Gold Member
I think the 'right' way to do this is proving Cauchy Schwarz first, then proving triangle inequality.
- - - -
A less often used approach that I happen to like is quasi-linearisation. (Note, change of variables ##z:= -y##)

you want to prove

##f \big( x + z \big) = \big \vert x + z \big \vert \leq \big \vert x \big \vert + \big \vert z \big \vert = f \big( x \big) + f \big( z \big)##

now here I've defined ##f## as the absolute value function -- in common shorthand, I've said ##f(u) := \big \vert u\big \vert##

##\begin{equation*}
\begin{aligned}
& f\big(u\big) := {\text{maximize }}\lambda \cdot u\\
& \text{subject to: }\lambda \in \{-1,+1\}\\
\end{aligned}
\end{equation*}##

From here, you'd need to confirm that the two definitions are equivalent, and the obvious fact that 2 choices are better than 1 (at least in 'single player' optimization problems).

Gold Member
The same old question year after year.
:-)

Bonnie
Thank you all for your replies :)

Homework Helper
Dearly Missed
I think the 'right' way to do this is proving Cauchy Schwarz first, then proving triangle inequality.
- - - -
A less often used approach that I happen to like is quasi-linearisation. (Note, change of variables ##z:= -y##)

you want to prove

##f \big( x + z \big) = \big \vert x + z \big \vert \leq \big \vert x \big \vert + \big \vert z \big \vert = f \big( x \big) + f \big( z \big)##

now here I've defined ##f## as the absolute value function -- in common shorthand, I've said ##f(u) := \big \vert u\big \vert##

##\begin{equation*}
\begin{aligned}
& f\big(u\big) := {\text{maximize }}\lambda \cdot u\\
& \text{subject to: }\lambda \in \{-1,+1\}\\
\end{aligned}
\end{equation*}##

From here, you'd need to confirm that the two definitions are equivalent, and the obvious fact that 2 choices are better than 1 (at least in 'single player' optimization problems).

You could even say
$$f(u) = \max_{-1 \leq \lambda \leq 1} \lambda \cdot u$$
to make it "less combinatorical".

$$f(u) = \max_{-1 \leq \lambda \leq 1} \lambda \cdot u$$