Relation between Floor and Ceiling

Theorem
Let $$x \in \R$$ be a real number.

Let $$\left \lfloor {x}\right \rfloor$$ be the floor of $$x$$, and $$\left \lceil {x}\right \rceil$$ be the ceiling of $$x$$.

Then the following results apply:

Result 1

 * $$\left \lceil {\left \lfloor {x}\right \rfloor}\right \rceil = \left \lfloor {x}\right \rfloor$$;


 * $$\left \lfloor {\left \lceil {x}\right \rceil}\right \rfloor = \left \lceil {x}\right \rceil$$.

That is:
 * The ceiling of the floor is the floor;
 * The floor of the ceiling is the ceiling.

Result 2
\left \lceil {x}\right \rceil & : x \in \Z \\ \left \lceil {x}\right \rceil - 1 & : x \notin \Z \\ \end{cases}$$
 * $$\left \lfloor {x}\right \rfloor = \begin{cases}

or equivalently: \left \lfloor {x}\right \rfloor & : x \in \Z \\ \left \lfloor {x}\right \rfloor + 1 & : x \notin \Z \\ \end{cases}$$
 * $$\left \lceil {x}\right \rceil = \begin{cases}

where $$\Z$$ is the set of integers;

Result 3

 * $$\left \lfloor {-x}\right \rfloor = - \left \lceil {x}\right \rceil$$;


 * $$\left \lceil {-x}\right \rceil = - \left \lfloor {x}\right \rfloor$$.

Proof of Result 1
From Integer Equals Floor And Ceiling, we have:


 * $$x = \left \lfloor {x} \right \rfloor \iff x \in \Z$$
 * $$x = \left \lceil {x} \right \rceil \iff x \in \Z$$

As $$\left \lfloor {x} \right \rfloor$$ and $$\left \lceil {x} \right \rceil$$ are integers by definition, the result follows directly.

Proof of Result 2
From Integer Equals Floor And Ceiling, we have that:
 * $$x \in \Z \implies x = \left \lfloor {x}\right \rfloor$$;
 * $$x \in \Z \implies x = \left \lceil {x}\right \rceil$$.

So $$x \in \Z \implies \left \lfloor {x}\right \rfloor = \left \lceil {x}\right \rceil$$.

Also:
 * $$x \in \Z \implies -x \in \Z \implies \left \lfloor {-x}\right \rfloor = - x = - \left \lfloor {x}\right \rfloor$$.

Similarly:
 * $$x \in \Z \implies -x \in \Z \implies \left \lceil {-x} \right \rceil = - x = - \left \lceil {x}\right \rceil$$.

Now let $$x \notin \Z$$.

Then $$\exists t \in \left\{{x \in \R: 0 < x < 1}\right\}: x = \left \lfloor {x}\right \rfloor + t$$ from Real Number is Floor plus Difference.

Then $$-x = - \left \lfloor {x}\right \rfloor - t = - \left \lfloor {x}\right \rfloor$$.

But from work in progress, $$\left \lceil {- \left \lfloor {x}\right \rfloor - t}\right \rceil = \left \lceil {- \left \lfloor {x}\right \rfloor}\right \rceil$$

Proof of Result 3
From Range of Values of Floor Function we have:
 * $$x - 1 < \left \lfloor{x}\right \rfloor \le x$$

and so:
 * $$-x + 1 > -\left \lfloor{x}\right \rfloor \ge x$$

From Range of Values of Ceiling Function we have:
 * $$\left \lceil{x}\right \rceil = n \iff x \le n < x + 1$$

And so $$-x \le -\left \lfloor{x}\right \rfloor < -x + 1 \implies -\left \lfloor{x}\right \rfloor = \left \lceil{-x}\right \rceil$$.

Similarly, from Range of Values of Ceiling Function we have:
 * $$x \le \left \lceil{x}\right \rceil < x + 1$$

and so:
 * $$-x \ge -\left \lceil{x}\right \rceil < -x - 1$$

From Range of Values of Floor Function we have:
 * $$\left \lfloor{x}\right \rfloor = n \iff x - 1 < n \le x$$

And so $$-x - 1 < -\left \lceil{x}\right \rceil \le x \implies -\left \lceil{x}\right \rceil = \left \lfloor{-x}\right \rfloor$$.