Range of Values of Floor Function

Theorem
Let $$x \in \R$$ be a real number and let $$\left \lfloor{x}\right \rfloor$$ be the floor of $$x$$.

Then the following results apply:


 * 1) $$\left \lfloor{x}\right \rfloor < n \iff x < n$$;
 * 2) $$\left \lfloor{x}\right \rfloor \ge n \iff x \ge n$$;
 * 3) $$\left \lfloor{x}\right \rfloor = n \iff x - 1 < n \le x$$;
 * 4) $$\left \lfloor{x}\right \rfloor = n \iff n \le x < n + 1$$.

Proof
From the definition of the floor function:


 * $$\left \lfloor {x} \right \rfloor = \sup \left({\left\{{m \in \Z: m \le x}\right\}}\right)$$

That is, $$\left \lfloor {x} \right \rfloor$$ is the greatest integer less than or equal to $$x$$.

Thus we have that:


 * $$\left \lfloor {x} \right \rfloor$$ is an integer;
 * $$\left \lfloor {x} \right \rfloor \le x$$;
 * $$\left \lfloor {x} \right \rfloor + 1 > x$$.

Also, we have that $$\forall m, n \in \Z: m < n \iff m \le n - 1$$.

Proof of Result 1
Let $$\left \lfloor{x}\right \rfloor < n$$.

Then:

$$ $$ $$ $$ $$

Next suppose $$x < n$$.

Then as $$\left \lfloor {x} \right \rfloor \le x$$ it follows that $$\left \lfloor {x} \right \rfloor < n$$.

So $$\left \lfloor{x}\right \rfloor < n \iff x < n$$.

Proof of Result 2
Let $$\left \lfloor{x}\right \rfloor \ge n$$.

Then as $$x \ge \left \lfloor{x}\right \rfloor$$ it follows that $$x \ge n$$.

Now let $$x \ge n$$.

Suppose $$\left \lfloor{x}\right \rfloor < n$$.

Then $$\left \lfloor{x}\right \rfloor + 1 \le n$$ and so $$\left \lfloor{x}\right \rfloor + 1 \le x$$, which is a contradiction of $$\left \lfloor{x}\right \rfloor + 1 < x$$.

Thus by proof by contradiction, $$\left \lfloor{x}\right \rfloor \ge n$$.

So $$\left \lfloor{x}\right \rfloor \ge n \iff x \ge n$$.

Proof of Result 3
Suppose $$\left \lfloor{x}\right \rfloor = n$$.

Then $$\left \lfloor{x}\right \rfloor \ge n$$ and so by result 2, $$n \le x$$.

Also, we have that $$x - 1 < \left \lfloor{x}\right \rfloor = n$$ and so $$x - 1 < n$$.

So $$\left \lfloor{x}\right \rfloor = n \implies x - 1 < n \le x$$.

Now suppose $$x - 1 < n \le x$$.

From $$n \le x$$, we have by result 2 that $$n \le \left \lfloor{x}\right \rfloor$$.

From $$x - 1 < n$$ we have that $$x < n + 1$$.

Hence by result 1 we have $$\left \lfloor{x}\right \rfloor < n + 1$$ and so $$\left \lfloor{x}\right \rfloor \le n$$.

Thus as $$n \le \left \lfloor{x}\right \rfloor$$ and $$\left \lfloor{x}\right \rfloor \le n$$ it follows that $$\left \lfloor{x}\right \rfloor = n$$.

Thus $$x - 1 < n \le x \implies \left \lfloor{x}\right \rfloor = n$$.

So $$\left \lfloor{x}\right \rfloor = n \iff x - 1 < n \le x$$.

Proof of Result 4
Suppose $$\left \lfloor{x}\right \rfloor = n$$.

We have already shown that $$n \le x$$ (from result 2).

We also have that $$\left \lfloor{x}\right \rfloor + 1 = n + 1$$.

But from above, we have $$x < \left \lfloor {x} \right \rfloor + 1$$, and so $$x < n + 1$$.

So $$\left \lfloor{x}\right \rfloor = n \implies n \le x < n + 1$$.

Now suppose $$n \le x < n + 1$$.

We have already shown that $$n \le x \implies n \le \left \lfloor{x}\right \rfloor$$ by result 2.

In result 3 we saw that $$x < n + 1 \implies \left \lfloor{x}\right \rfloor \le n$$.

Thus $$n \le x < n + 1 \le x \implies \left \lfloor{x}\right \rfloor = n$$.

So $$\left \lfloor{x}\right \rfloor = n \iff n \le x < n + 1 \le x$$.