Euler's Partition Theorem #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
This file proves Theorem 45 from the 100 Theorems List.
The theorem concerns the counting of integer partitions -- ways of
writing a positive integer n
as a sum of positive integer parts.
Specifically, Euler proved that the number of integer partitions of n
into distinct parts equals the number of partitions of n
into odd
parts.
Proof outline #
The proof is based on the generating functions for odd and distinct partitions, which turn out to be equal:
$$\prod_{i=0}^\infty \frac {1}{1-X^{2i+1}} = \prod_{i=0}^\infty (1+X^{i+1})$$
In fact, we do not take a limit: it turns out that comparing the n
'th coefficients of the partial
products up to m := n + 1
is sufficient.
In particular, we
- define the partial product for the generating function for odd partitions
partial_odd_gf m
:= $$\prod_{i=0}^m \frac {1}{1-X^{2i+1}}$$; - prove
odd_gf_prop
: ifm
is big enough (m * 2 > n
), the partial product's coefficient counts the number of odd partitions; - define the partial product for the generating function for distinct partitions
partial_distinct_gf m
:= $$\prod_{i=0}^m (1+X^{i+1})$$; - prove
distinct_gf_prop
: ifm
is big enough (m + 1 > n
), then
th coefficient of the partial product counts the number of distinct partitions ofn
; - prove
same_coeffs
: if m is big enough (m ≥ n
), then
th coefficient of the partial products are equal; - combine the above in
partition_theorem
.
References #
https://en.wikipedia.org/wiki/Partition_(number_theory)#Odd_parts_and_distinct_parts
The partial product for the generating function for odd partitions.
TODO: As m
tends to infinity, this converges (in the X
-adic topology).
If m
is sufficiently large, the i
th coefficient gives the number of odd partitions of the
natural number i
: proved in odd_gf_prop
.
It is stated for an arbitrary field α
, though it usually suffices to use ℚ
or ℝ
.
Equations
- theorems_100.partial_odd_gf m = (finset.range m).prod (λ (i : ℕ), (1 - power_series.X ^ (2 * i + 1))⁻¹)
The partial product for the generating function for distinct partitions.
TODO: As m
tends to infinity, this converges (in the X
-adic topology).
If m
is sufficiently large, the i
th coefficient gives the number of distinct partitions of the
natural number i
: proved in distinct_gf_prop
.
It is stated for an arbitrary commutative semiring α
, though it usually suffices to use ℕ
, ℚ
or ℝ
.
Equations
- theorems_100.partial_distinct_gf m = (finset.range m).prod (λ (i : ℕ), 1 + power_series.X ^ (i + 1))
Functions defined only on s
, which sum to n
. In other words, a partition of n
indexed by s
.
Every function in here is finitely supported, and the support is a subset of s
.
This should be thought of as a generalisation of finset.nat.antidiagonal_tuple
where
antidiagonal_tuple k n
is the same thing as cut (s : finset.univ (fin k)) n
.
There is only one cut
of 0.
A convenience constructor for the power series whose coefficients indicate a subset.
Equations
- theorems_100.indicator_series α s = power_series.mk (λ (n : ℕ), ite (n ∈ s) 1 0)
If m is big enough, the partial product's coefficient counts the number of odd partitions
If m is big enough, the partial product's coefficient counts the number of distinct partitions
The key proof idea for the partition theorem, showing that the generating functions for both
sequences are ultimately the same (since the factor converges to 0 as m tends to infinity).
It's enough to not take the limit though, and just consider large enough m
.