Modulo Operation as Integer Difference by Quotient

Theorem
Let $x, y, z \in \R$ be real numbers.

Let $y > 0$.

Let $0 \le z < y$.

Let:
 * $\dfrac {x - z} y = k$

for some integer $k$.

Then:
 * $z = x \bmod y$

where $\bmod$ denotes the modulo operation.

Proof
We have:

We also have:


 * $0 \le z < y$

Hence:
 * $0 \le \dfrac z y < 1$

and so by definition of floor function:
 * $(2): \quad \left\lfloor{\dfrac z y}\right\rfloor = 0$

Thus:

The result follows.