Proof of a nearest-integer inequality Let $N(y)$ be the nearest-integer function and undefined on half-integers.
For all $r \in \mathbb R$ that are not half-integers, prove $$\forall{\ i \in \mathbb Z}:\left|N(r)-r\right|\leq\left|i-r\right|$$
Does this even need to be "proven" or perhaps only "demonstrated"? Does it follow directly from the typical definition of the nearest-integer function?
 A: If I had to define
a nearest-integer function
$N(r)$,
one way to do it is this:
First, the distance to the nearest integer:
$D(r)
=\min_{n \in \mathbb{Z}} |r-n|
$
Then,
the integer(s) whose distance
is the same as
the distance to the nearest integer:
$N(r)
=\{n \mid |r-n| = D(r)\}
$
Then you have to derive
uniqueness, existence,
and things like that.
Another way,
if you have the
integer-part function
$I(r)$
defined as the integer
$n$ such that
$n \le r < n+1$,
then you could define
$N(r)
=I(r)\ if\ r-I(r)< \frac12\ otherwise\ I(r)+1
$
or,
alternatively but equivalently,
$N(r)
= I(r)+I(2(r-I(r)))
$.
A: Giving a rigorous definition of the nearest-integer function,
$$N(r)::=j\in\mathbb Z:\forall i\in\mathbb Z, |j-r|\le|i-r|,$$
it is indeed immediate that 
$$\forall i\in\mathbb Z, |N(r)-r|\le|i-r|.$$
That definition is not completely valid, as there could be several $j$ that realize the minimum distance (and this is indeed the case for half-integer $r$). But even if we arbitrarily choose for $N(r)$ any $j$ that achieves the minimum, the claimed property holds despite non-uniqueness.
