Natural number multiplicity #
This file contains lemmas about the multiplicity function (the maximum prime power dividing a number) when applied to naturals, in particular calculating it for factorials and binomial coefficients.
Multiplicity calculations #
Nat.Prime.multiplicity_factorial
: Legendre's Theorem. The multiplicity ofp
inn!
isn / p + ... + n / p ^ b
for anyb
such thatn / p ^ (b + 1) = 0
. SeepadicValNat_factorial
for this result stated in the language ofp
-adic valuations andsub_one_mul_padicValNat_factorial
for a related result.Nat.Prime.multiplicity_factorial_mul
: The multiplicity ofp
in(p * n)!
isn
more than that ofn!
.Nat.Prime.multiplicity_choose
: Kummer's Theorem. The multiplicity ofp
inn.choose k
is the number of carries whenk
andn - k
are added in basep
. SeepadicValNat_choose
for the same result but stated in the language ofp
-adic valuations andsub_one_mul_padicValNat_choose_eq_sub_sum_digits
for a related result.
Other declarations #
Nat.multiplicity_eq_card_pow_dvd
: The multiplicity ofm
inn
is the number of positive natural numbersi
such thatm ^ i
dividesn
.Nat.multiplicity_two_factorial_lt
: The multiplicity of2
inn!
is strictly less thann
.Nat.Prime.multiplicity_something
: Specialization ofmultiplicity.something
to a prime in the naturals. Avoids having to providep ≠ 1
and other trivialities, along with translating betweenPrime
andNat.Prime
.
Tags #
Legendre, p-adic
The multiplicity of m
in n
is the number of positive natural numbers i
such that m ^ i
divides n
. This set is expressed by filtering Ico 1 b
where b
is any bound greater than
log m n
.
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 multiplicity of p
in n!
equals n
minus
the sum of base p
digits of n
.
The multiplicity of p
in (p * (n + 1))!
is one more than the sum
of the multiplicities of p
in (p * n)!
and n + 1
.
The multiplicity of p
in (p * n)!
is n
more than that of n!
.
A prime power divides n!
iff it is at most the sum of the quotients n / p ^ i
.
This sum is expressed over the set Ico 1 b
where b
is any bound greater than log p n
The multiplicity 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)
.
The multiplicity 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
.
A lower bound on the multiplicity of p
in choose n k
.