# Show x<=y<=z IFF |x-y|+|y-z|=|x-z|

## Homework Statement

If x, y, z in R and x<=z, show that x<=y<=z IFF |x-y|+|y-z|=|x-z|

Interpret geometrically.

## The Attempt at a Solution

1) Assume that x<=y<=z. We need to prove that |x-y|+|y-z|=|x-z|.

Knowing that x<=y<=z,

-(x-y)+(-(y-z))= -(x-z)
y-x-y+z=-x+z
-x+z=-x+z

2) Assume that |x-y|+|y-z|=|x-z|. We need to prove that x<=y<=z.

a) Assume y<=z<=x.
(x-y)-(y-z)=(x-z)
x-2y+z=x-z
z-2y=z

b) Assume z<=x<=y
-(x-y)+(y-z)=(x-z)
-x-z=x-z

c) Assume x<=y<=z
-(x-y)+(-(y-z))= -(x-z)
y-x-y+z=-x+z
-x+z=-x+z
Correcto!

Thanks!

## Homework Statement

If x, y, z in R and x<=z, show that x<=y<=z IFF |x-y|+|y-z|=|x-z|

Interpret geometrically.

## The Attempt at a Solution

1) Assume that x<=y<=z. We need to prove that |x-y|+|y-z|=|x-z|.

Knowing that x<=y<=z,

-(x-y)+(-(y-z))= -(x-z)
y-x-y+z=-x+z
-x+z=-x+z

Seems good. However, I have some problems with your second part:

2) Assume that |x-y|+|y-z|=|x-z|. We need to prove that x<=y<=z.

a) Assume y<=z<=x.
(x-y)-(y-z)=(x-z)
x-2y+z=x-z
z-2y=z

you know that x<= z, so why split into the case y<= z<= x? Isn't this supposed to be y<=x<= z?

b) Assume z<=x<=y
-(x-y)+(y-z)=(x-z)
-x-z=x-z

Same remark as above. Isn't this supposed to be x<=z<=y?

c) Assume x<=y<=z
-(x-y)+(-(y-z))= -(x-z)
y-x-y+z=-x+z
-x+z=-x+z
Correcto!

Technically, this is not wrong, but it is superfluous. You need to show: "IF blabla THEN x<=y<=z". But what you did here is actually proving the converse...

Hi! Thanks for the feedback. I tried fixing the last part according to your comments. What I did, I squared the both sides of

|x-y|+|y-z|=|x-z|,

then, I solved it and squared |xxxx| again in order to get rid of the absolute value. The answer was short but strange. And probably, wrong.

Why in earth did you do that? You just need to use the technique you used this far.
So for y<=x<=z, you just need to simplify...

|x-y|+|y-z|=|x-z|

and show that this does hold.

In don't see why you start squaring things. 