# The triangle inequality

## 1. Introduction

The single most important inequality in analysis is the triangle inequality, and it will be used a lot throughout this course. Later on it becomes the main building block for a more general theory of analysis that you learn about when you study metric spaces.

The triangle inequality concerns distance between points and says that the straight line distance between $A$ and $B$ is less than the sum of the distances from $A$ to $C$ and from $C$ to $B$. It is very much part of our everyday intuition about distances and easy to remember. It is, however, very useful.

## 2. Distances in the reals

Given real numbers $x$ and $y$ the value $| x - y |$ represents the distance along the numberline from $x$ to $y$. By definition, it is equal to $x - y$ if $x ⩾ y$ and to $y - x$ if $y > x$. So $| x - y | = | y - x |$. We will sometimes denote this distance by $d ( x , y )$ or $d ( y , x )$.

The triangle inequality.

For all $x , y , z ∈ ℝ$ we have

$d ( x , y ) ⩽ d ( x , z ) + d ( z , y )$

Proof.

This is just by looking at all the cases.

Subproof.

Case 1: $x ⩾ y$. Then $d ( x , y ) = | x - y | = x - y$. There are three subcases. They are all very similar.

Subproof.

Case 1a: $z ⩾ x$, so $d ( x , z ) = | x - z | = z - x ⩾ 0$ and $d ( z , y ) = | z - y | = z - y ⩾ x - y = d ( x , y )$ giving $d ( x , z ) + d ( z , y ) ⩾ d ( x , y )$.

Subproof.

Case 1b: $x > z ⩾ y$, so $d ( x , z ) = | x - z | = x - z$ and $d ( z , y ) = | z - y | = z - y$ giving $d ( x , z ) + d ( z , y ) = x - z + z - y = x - y = d ( x , y )$.

Subproof.

Case 1c: $y > z$, so $d ( x , z ) = | x - z | = x - z ⩾ x - y$ and $d ( z , y ) = | z - y | = y - z ⩾ 0$ giving $d ( x , z ) + d ( z , y ) ⩾ = x - y = d ( x , y )$.

Also:

Subproof.

Case 2: $x < y$. Then $d ( x , y ) = | x - y | = y - x$. There are three subcases.

Subproof.

Case 2a: $z ⩾ y$, so $d ( x , z ) = | x - z | = z - x ⩾ d ( x , y )$ and $d ( z , y ) = | z - y | = z - y ⩾ 0$ giving $d ( x , z ) + d ( z , y ) ⩾ d ( x , y )$.

Subproof.

Case 2b: $y > z ⩾ x$, so $d ( x , z ) = | x - z | = z - x$ and $d ( z , y ) = | z - y | = y - z$ giving $d ( x , z ) + d ( z , y ) = z - x + y - z = y - x = d ( x , y )$.

Subproof.

Case 2c: $x > z$, so $d ( x , z ) = | x - z | = x - z ⩾ 0$ and $d ( z , y ) = | z - y | = y - z ⩾ y - x$ giving $d ( x , z ) + d ( z , y ) ⩾ = y - x = d ( x , y )$.

The triangle inequality in $ℝ$ takes the form

$| x - y | ⩽ | x - z | + | z - y |$

Note the $⩽$, the $+$ sign and the introduced intermediate point $z$ on the right. By rearranging we have $| x - y | - | z - y | ⩽ | x - z |$, or

$| x - z | ⩾ | x - y | - | y - z |$

which also has an intermediate point $y$ added on the right in the same way, but the $⩽$ has changed to $⩾$ and the $+$ has changed to $-$. Both forms are equally useful. I find the first easy to remember; the hints here will help you remember the second just as easily.

We can also write the triangle inequality in $ℝ$ in the form

$| x + y | ⩽ | x | + | y |$

To derive this from the other versions just note that

$| x - ( - y ) | ⩽ | x - 0 | + | 0 - ( - y ) |$

Hence the result. Its alternative form,

$| x + y | ⩾ | x | - | y |$

can be derived in a similar way. If we switch $- y$ for $y$ we can even get

$| x - y | ⩽ | x | + | y |$

and

$| x + y | ⩾ | x | - | y |$

which can also be useful, especially if we don't know if $y$ is negative or positive.