Proving the inequality $|a-b| \leq |a-c| + |c-b|$ for real $a,b,c$

Let $a,b,c$ real numbers. Prove the inequality $|a-b| \leq |a-c| + |c-b|$. Prove that equality holds if and only if $a \leq c \leq b$ or $b \leq c \leq a$.

I've tried starting with just $a \leq c$ and using field properties to reconstruct the inequality, however I haven't been able to make it work. I also tried making the negatives positive and stripping the inequalities and making something happen but again I don't know if that's a proper rule and it didn't seem to get me anywhere.


Solution 1:

You could use the triangle inequality and the fact that you can write $|a-b|=|(a-c)+(c-b)|$.

Solution 2:

As others have pointed out, you should prove this by using the triangle inequality. I also think you should try to understand the problem intuitively so I drew a picture:enter image description here

$|a-b|$ represents the distance between the points $a$ and $b$ on the number line. If $c$ is between $a$ and $b$, or is equal to either $a$ or $b$, then the distance from $a$ to $c$, which is $|a-c|$, plus the distance from $c$ to $b$, which is $|c-b|$, will equal the total distance from $a$ to $b$. In other words, the length of the two red line segments in case $2$ equals the length of the green line segment in case $1$. If $c$ does not lie between $a$ and $b$, as in case $3$, then the distance from $c$ to either $a$ or $b$ must be greater than the distance from $a$ to $b$.

Note that the above is in not a proof but it can help you understand the problem.

Solution 3:

Just for fun, here is a proof that does not use the triangle equality, and instead uses the definition $$ |x| \;=\; x\text{ max }-x $$ together with the properties of $\;\text{max}\;$: \begin{align} & |a-c| \;+\; |c-b| \\ = & \qquad \text{"the above definition of $\;|\quad|\;$, twice"} \\ & ((a-c)\text{ max }(c-a)) \;+\; ((c-b)\text{ max }(b-c)) \\ = & \qquad \text{"$\;+\;$ distributes over $\;\text{max}\;$, three times"} \\ & (a-c+c-b)\text{ max }(a-c+b-c)\text{ max }(c-a+c-b)\text{ max }(c-a+b-c) \\ = & \qquad \text{"arithmetic: simplify"} \\ & (a-b)\text{ max }(a+b-2c)\text{ max }(2c-a-b)\text{ max }(b-a) \\ \ge & \qquad \text{"basic property of $\;\text{max}\;$: $\;x\text{ max }y \ge x\;$} \\ & \qquad \phantom{\text{"}}\text{-- to get rid of the parts that contain $\;c\;$"} \\ & (a-b)\text{ max }(b-a) \\ = & \qquad \text{"the above definition of $\;|\quad|\;$"} \\ & |a - b| \\ \end{align}

Solution 4:

The inequality is a simple application of the triangle inequality as already mentioned (with $x=a-c$ and $y=c-b$).

The equality therefore holds when $xy=(a-c)(c-b)\geq 0$, so either when $a-c\leq 0$ and $c-b\leq 0$ or when $a-c\geq 0$ and $c-b\geq 0$, which eventually means when $a\leq c\leq b$ or $b\leq c\leq a$.