User:Leigh.Samphier/Sandbox/Canonical P-adic Expansion of Rational is Eventually Periodic/Lemma 2

Theorem
Let $p$ be a prime number.

Let $a \in \Z, b \in Z_{> 0}$

Let:
 * $\forall n \in \N: \exists r_n \in \Z: \dfrac {a - \paren{p^{n+1} - 1} b } {p^{n+1}} \le r_n \le \dfrac a {p^{n+1}}$

Then:
 * $\exists n_0 \in \N : \forall n \ge n_0 : -b \le r_n \le 0$

Lemma 8
In the real numbers $\R$:

By definition of convergence:
 * $\exists n_1 \in \N: \forall n \ge n_1 : - \dfrac 1 2 < \dfrac a {p^{n+1}} < \dfrac 1 2$

Lemma 9
In the real numbers $\R$:

By definition of convergence:
 * $\exists n_2 \in \N: \forall n \ge n_2 : -b - \dfrac 1 2 < \dfrac {a - \paren{p^{n+1} - 1} b } {p^{n+1}} < -b + \dfrac 1 2$

Let:
 * $n_0 = \max \set{n_1, n_2}$

Then:
 * $\forall n \ge n_0 : -b - \dfrac 1 2 < \dfrac {a - \paren{p^{n+1} - 1} b } {p^{n+1}} \le r_n \le \dfrac a {p^{n+1}} < \dfrac 1 2$

By hypothesis:
 * $b \in \Z$ and $\forall n \in \N: r_n \in \Z$

Hence:
 * $\forall n \ge n_0 : -b \le r_n \le 0$