McEliece's Theorem (Integer Functions)

Theorem
Let $f: \R \to \R$ be a continuous, strictly increasing real function defined on an interval $A$.

Let:
 * $\forall x \in A: \left \lfloor{x}\right \rfloor \in A, \left \lceil{x}\right \rceil \in A$

where:
 * $\left \lfloor{x}\right \rfloor$ denotes the floor of $x$
 * $\left \lceil{x}\right \rceil$ denotes the ceiling of $x$

Then:
 * $\forall x \in A: \left \lfloor{f \left({x}\right)}\right \rfloor = \left \lfloor{f \left({\left \lfloor{x}\right \rfloor}\right)}\right \rfloor \iff \left \lceil{f \left({x}\right)}\right \rceil = \left \lceil{f \left({\left \lceil{x}\right \rceil}\right)}\right \rceil \iff \left(f \left({x}\right) \in \Z \implies x \in \Z)\right)$

Proof
Let $x \in A$.

Hence we have that both $\left \lfloor{x}\right \rfloor \in A$ and $\left \lceil{x}\right \rceil \in A$.

Necessary Condition
Let $f \left({x}\right) \in \Z$.

Let:
 * $\left \lfloor{f \left({x}\right)}\right \rfloor = \left \lfloor{f \left({\left \lfloor{x}\right \rfloor}\right)}\right \rfloor$

Then:

$x \notin \Z$.

Thus by Proof by Contradiction:
 * $x \in \Z$

Similarly, let:
 * $\left \lceil{f \left({x}\right)}\right \rceil = \left \lceil{f \left({\left \lceil{x}\right \rceil}\right)}\right \rceil$

Then:

$x \notin \Z$.

Thus by Proof by Contradiction:
 * $x \in \Z$

Thus:
 * $\forall x \in A: \left \lfloor{f \left({x}\right)}\right \rfloor = \left \lfloor{f \left({\left \lfloor{x}\right \rfloor}\right)}\right \rfloor \implies \left(f \left({x}\right) \in \Z \implies x \in \Z)\right)$

and:
 * $\forall x \in A: \left \lceil{f \left({x}\right)}\right \rceil = \left \lceil{f \left({\left \lceil{x}\right \rceil}\right)}\right \rceil \implies \left(f \left({x}\right) \in \Z \implies x \in \Z)\right)$