Sum over j of Function of Floor of mj over n

Theorem
Let $f$ be a real function.

Then:
 * $\displaystyle \sum_{0 \mathop \le j \mathop < n} f \left({\left \lfloor{\dfrac {m j} n}\right \rfloor}\right) = \sum_{0 \mathop \le r \mathop < m} \left \lceil{\dfrac {r n} m}\right \rceil \left({f \left({r - 1}\right) - f \left({r}\right)}\right) + n f \left({m - 1}\right)$

Proof
Hence: