Sum of Floor and Floor of Negative

Theorem
Let $x \in \R$. Then:


 * $\floor x + \floor {-x} = \begin{cases} 0 & : x \in \Z \\ -1 & : x \notin \Z \end{cases}$

where $\floor x$ denotes the floor of $x$.

Proof
Let $x \in \Z$.

Then from Real Number is Integer iff equals Floor:
 * $x = \floor x$

Now $x \in \Z \implies -x \in \Z$, so:
 * $\floor {-x} = -x$

Thus:
 * $\floor x + \floor {-x} = x + \paren {-x} = x - x = 0$

Now let $x \notin \Z$.

From Real Number is Floor plus Difference:
 * $x = n + t$

where $n = \floor x$ and $t \in \hointr 0 1$.

Thus:
 * $-x = -\paren {n + t} = -n - t = -n - 1 + \paren {1 - t}$

As $t \in \hointr 0 1$, we have:
 * $1 - t \in \hointr 0 1$

Thus:
 * $\floor {-x} = -n - 1$

So:
 * $\floor x + \floor {-x} = n + \paren {-n - 1} = n - n - 1 = -1$