Kummer’s theorem in MathComp

6.1 Digit extraction

Definition 6.1 Base-\(p\) digit
#

For \(p \geq 2\), the \(i\)-th digit of \(n\) in base \(p\) is

\[ d_i(n) := \left\lfloor \frac{n}{p^i} \right\rfloor \bmod p. \]

Lemma 6.2 Digit bound

For \(p \geq 2\),

\[ d_i(n) {\lt} p. \]

Proof.

Lemma 6.3 Digit representation

For \(p \geq 2\) and \(n {\gt} 0\),

\[ n = \sum _{i=0}^{\texttt{trunc\_ log}(p,n)} d_i(n) \cdot p^i. \]

Proof.