# Analysis Question regarding absolute value

If $a<x<b$ and $a<y<b$ show that $|x-y| < b - a$.

I am guessing that I can say y

$y-a<b-a$

Also we can say that $a-x<0$

So if we add these, we get:

$y-x<b-a$

WLOG, $x-y<b-a$ so $|x - y| < b - a$

Does this look ok or am I missing some steps? Thank you for your help!

-

Without loss of generality, suppose that $y \leq x$. Then

$x - y \leq b - a$

since $x < b$ and $a < y$.

If $x \leq y$, then by the same argument

$y - x = -(x - y) \leq b - a$.

Since $a < b$, $|b - a| = b- a$. Hence in both cases

$|x - y| = |-(x - y)| \leq |b - a| = b - a$

-

$$a<x<b~~~(1)$$ $$a<y<b==> -b<-y<-a~~ (2)$$ add (1) and (2) $$-(b-a)<x-y<(b-a)==> abs(x-y)<(b-a)$$

-

The absolute value of the difference of two numbers has a geometric interpretation: that's the Euclidean distance between two points in one dimension. Imagine a line with four points on it: $a, b$ and $x, y$ between them. Then the distance from $x$ to $y$ $(|x - y|)$ is shorter than from $a$ to $b$ $(|a-b| = b - a$, as $b > a$ in this case$)$.

-