- Boxes
- definitions
- Ellipses
- theorems and lemmas
- Blue border
- the statement of this result is ready to be formalized; all prerequisites are done
- Orange border
- the statement of this result is not ready to be formalized; the blueprint needs more work
- Blue background
- the proof of this result is ready to be formalized; all prerequisites are done
- Green border
- the statement of this result is formalized
- Green background
- the proof of this result is formalized
- Dark green background
- the proof of this result and all its ancestors are formalized
- Dark green border
- this is in math-comp
Let \(m {\gt} 0\). Then for all \(a, b \in \mathbb {N}\),
where \([\cdot ]\) denotes the Iverson bracket. Proof. Write \(a = qm + r\) and \(b = q'm + r'\) with \(0 \leq r, r' {\lt} m\). Then \(a + b = (q + q')m + (r + r')\). Since \(0 \leq r + r' {\lt} 2m\), we have \(\lfloor (r+r')/m\rfloor \in \{ 0, 1\} \), and it equals \(1\) exactly when \(r + r' \geq m\).
For \(p {\gt} 0\) and \(k \leq n\),
Proof. Write \(n = k + (n-k)\) and apply Lemma 2.1 with \(m = p^i\).
For prime \(p\) and \(n {\gt} 0\),
Proof. From the digit representation \(n = \sum _i d_i(n) \cdot p^i\) and Legendre’s formula \(v_p(n!) = \sum _{k \geq 1} \lfloor n/p^k \rfloor \). A telescoping argument gives the result.
For prime \(p\) and \(k \leq n\),
Proof. From \(\binom {n}{k} \cdot k! \cdot (n-k)! = n!\) (Lemma 1.10), apply \(v_p\) to both sides using multiplicativity (Lemma 1.3), noting that all factors are positive by Lemmas 1.11 and 1.12.
For prime \(p\), \(k \leq n\), and \(b {\gt} \texttt{trunc\_ log}(p, n)\),
Proof. Substitute Lemma 3.2 (applied to \(n\), \(k\), and \(n-k\), all with the same bound \(b\)) into Lemma 3.3.
For prime \(p\) and \(b {\gt} \texttt{trunc\_ log}(p, n)\),
Proof. By Lemma 1.9, \(v_p(n!) = \sum _{i=1}^{n} \lfloor n/p^i \rfloor \). The extra terms for \(i {\gt} \texttt{trunc\_ log}(p,n)\) vanish by Lemma 3.1.
For prime \(p\), \(k \leq n\), and \(b {\gt} \texttt{trunc\_ log}(p, n)\),
Proof. Apply Lemma 2.7 pointwise for each \(i \in \{ 1, \ldots , b\} \) and use linearity of summation.
Let \(p\) be prime and \(0 \leq k \leq n\). Then
for any \(b {\gt} \texttt{trunc\_ log}(p, n)\). Equivalently, the \(p\)-adic valuation of \(\binom {n}{k}\) equals the number of carries when adding \(k\) and \(n-k\) in base \(p\). Proof. By Lemma 3.4,
For prime \(p\), \(k \leq n\), and \(b {\gt} \texttt{trunc\_ log}(p, n)\),
Proof. Since \(\mathrm{carry}\) is boolean, summing it over \(\{ 1, \ldots , b\} \) equals the cardinality of the set where it holds.