Documentation

Mathlib.Data.Nat.Choose.Factorization

Factorization of Binomial Coefficients #

This file contains a few results on the multiplicity of prime factors within certain size bounds in binomial coefficients. These include:

These results appear in the Erdős proof of Bertrand's postulate.

theorem Nat.factorization_factorial {p : } (hp : Prime p) {n b : } :
log p n < bn.factorial.factorization p = iFinset.Ico 1 b, n / p ^ i

Legendre's Theorem

The multiplicity of a prime in n! is the sum of the quotients n / p ^ i. This sum is expressed over the finset Ico 1 b where b is any bound greater than log p n.

For a prime number p, taking (p - 1) times the factorization of p in n! equals n minus the sum of base p digits of n.

The factorization of p in (p * (n + 1))! is one more than the sum of the factorizations of p in (p * n)! and n + 1.

The factorization of p in (p * n)! is n more than that of n!.

theorem Nat.multiplicity_choose_aux {p n b k : } (hp : Prime p) (hkn : k n) :
iFinset.Ico 1 b, n / p ^ i = iFinset.Ico 1 b, k / p ^ i + iFinset.Ico 1 b, (n - k) / p ^ i + {iFinset.Ico 1 b | p ^ i k % p ^ i + (n - k) % p ^ i}.card
theorem Nat.factorization_choose' {p n k b : } (hp : Prime p) (hnb : log p (n + k) < b) :
((n + k).choose k).factorization p = {iFinset.Ico 1 b | p ^ i k % p ^ i + n % p ^ i}.card

The factorization of p in choose (n + k) k is the number of carries when k and n are added in base p. The set is expressed by filtering Ico 1 b where b is any bound greater than log p (n + k).

theorem Nat.factorization_choose {p n k b : } (hp : Prime p) (hkn : k n) (hnb : log p n < b) :
(n.choose k).factorization p = {iFinset.Ico 1 b | p ^ i k % p ^ i + (n - k) % p ^ i}.card

The factorization of p in choose n k is the number of carries when k and n - k are added in base p. The set is expressed by filtering Ico 1 b where b is any bound greater than log p n.

theorem Nat.factorization_le_factorization_of_dvd_right {a b c : } (h : b c) (hb : b 0) (hc : c 0) :

Modified version of emultiplicity_le_emultiplicity_of_dvd_right but for factorization.

A lower bound on the factorization of p in choose n k.

theorem Nat.factorization_choose_prime_pow_add_factorization {p n k : } (hp : Prime p) (hkn : k p ^ n) (hk0 : k 0) :
theorem Nat.factorization_choose_prime_pow {p n k : } (hp : Prime p) (hkn : k p ^ n) (hk0 : k 0) :

A logarithmic upper bound on the multiplicity of a prime in a binomial coefficient.

theorem Nat.pow_factorization_choose_le {p n k : } (hn : 0 < n) :

A pow form of Nat.factorization_choose_le

theorem Nat.factorization_choose_le_one {p n k : } (p_large : n < p ^ 2) :

Primes greater than about sqrt n appear only to multiplicity 0 or 1 in the binomial coefficient.

theorem Nat.factorization_choose_of_lt_three_mul {p n k : } (hp' : p 2) (hk : p k) (hk' : p n - k) (hn : n < 3 * p) :
theorem Nat.factorization_centralBinom_of_two_mul_self_lt_three_mul {p n : } (n_big : 2 < n) (p_le_n : p n) (big : 2 * n < 3 * p) :

Primes greater than about 2 * n / 3 and less than n do not appear in the factorization of centralBinom n.

If a prime p has positive multiplicity in the nth central binomial coefficient, p is no more than 2 * n

theorem Nat.prod_pow_factorization_choose (n k : ) (hkn : k n) :
pFinset.range (n + 1), p ^ (n.choose k).factorization p = n.choose k

A binomial coefficient is the product of its prime factors, which are at most n.

The nth central binomial coefficient is the product of its prime factors, which are at most 2n.