Euler's Partition Theorem #
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
partialOddGF m
:= $$\prod_{i=0}^m \frac {1}{1-X^{2i+1}}$$; - prove
oddGF_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
partialDistinctGF m
:= $$\prod_{i=0}^m (1+X^{i+1})$$; - prove
distinctGF_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 oddGF_prop
.
It is stated for an arbitrary field α
, though it usually suffices to use ℚ
or ℝ
.
Equations
- Theorems100.partialOddGF m = ∏ i ∈ Finset.range m, (1 - PowerSeries.X ^ (2 * i + 1))⁻¹
Instances For
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 distinctGF_prop
.
It is stated for an arbitrary commutative semiring α
, though it usually suffices to use ℕ
, ℚ
or ℝ
.
Equations
- Theorems100.partialDistinctGF m = ∏ i ∈ Finset.range m, (1 + PowerSeries.X ^ (i + 1))
Instances For
A convenience constructor for the power series whose coefficients indicate a subset.
Equations
- Theorems100.indicatorSeries α s = PowerSeries.mk fun (n : ℕ) => if n ∈ s then 1 else 0
Instances For
Equations
- Theorems100.mkOdd = { toFun := fun (i : ℕ) => 2 * i + 1, inj' := Theorems100.mkOdd.proof_1 }
Instances For
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
.