College Geometry: Proving the triangle inequality for a distance metric.

For all points on the x-axis, represented conveniently by the coordinates themselves, a concept for distance is defined as follows:

*d (x, y)* = {the number |*x - y*| *rounded up*}, that is either |x - y| itself if it is an integer, or the *next higher integer* if it is not.

[Examples: d(2, 5) = 3, d(2, 5.5) = 4, d(-2, 5.5) = 8.]

**Prove the triangle inequality for this metric**.

In class, our professor told us there would be 3 cases to prove for this triangle inequality with this distance metric. I am lost as to what those 3 cases are, since I can only think of one.

Proof I found, and would use for one case:

The basic properties of the triangle inequality are: [x + y] ≤ [x] + [y] and,

for x < y, [x] ≤ [y]. Let x, y, z be three non-colinear points.

Since by definition d(x, y) = [|x - y|], we have

d(x, y) = [|x - y|] = [|x - z + z - y|] ≤ [|x - z| + |z - y|] ≤ [|x - z|] + [|z - y|]

= d(x, z) + d(z, y).

How did they get from the red part to the blue part? Howcome you can separate the absolute values like that? Also, would the other 2 cases pretty much be the same except the ordering points would be different, or would the direction of the inequalities change depending on the order of the points?

Thank you for your time!