Canonical P-adic Expansion of Rational is Eventually Periodic/Lemma 4

Theorem
Let $\struct {\Q_p, \norm {\,\cdot\,}_p}$ be the $p$-adic numbers for some prime $p$.

Let $y$ be a rational $p$-adic integer.

Let $b \in \Z_{> 0}$:
 * $b, p$ are coprime

Let $a \in \Z$:
 * $a, b$ are coprime

Let

Let:
 * $\forall n \in \N: \exists A_n, r_n \in \Z$ :
 * $(1) \quad \dfrac a b = A_n + p^n \dfrac {r_n} b$
 * $(2) \quad 0 \le A_n \le p^n - 1$
 * $(3) \quad \dfrac {a - \paren{p^n - 1} b } {p^n} \le r_n \le \dfrac a {p^n}$

Then:
 * $\forall n \in \N:$
 * $A_{n+1} = A_n + d_n p^n$
 * $r_n = d_n b + p r_{n+1}$

Proof
We have: