# How to prove that the absolute difference of two numbers

which are within the same interval is equal or less to the difference of the marginal values of the interval?

I have the following inequalities: $$a \le x \le b$$ $$a \le y \le b$$

How to prove that: $$|x - y| \le b - a$$

I tried subtracting y from the first inequality to get:

$$a - y \le x - y \le b - y$$ but don't know how to conclude: $$| x - y | \le b - a$$ ?

-

Hint: Multiply the second inequality with $-1$ and then add the two. Can you continue this reasoning? Also note that $$\left|x\right|\le y\iff -y\le x\le y$$ for $y\ge 0$
So if I understood it correctly: $$a \le x \le b$$ $$a \le y \le b$$ $$\implies$$ $$a \le x \le b$$ $$-a \ge -y \ge -b$$ $$\implies$$ $$a \le x \le b$$ $$-b \le -y \le -a$$ $$\implies a - b \le x - y \le b - a$$ $$a - b = - (b - a)$$ and by using $$-p \le q \le p \implies |q| \le p$$ I get $$|x - y | \le b - a$$ is that correct? – AltairAC Dec 28 '12 at 16:07
$$x-y \leq b-a \, \mbox{and} \, y-x \leq b-a \,.$$