@@ -17,6 +17,16 @@ times.
1717
1818## Main declarations
1919* `Nat.Partition.card_restricted_eq_card_countRestricted`: Glaisher's theorem.
20+ * `Nat.Partition.card_odds_eq_card_distincts`: Euler's partition theorem, a special case
21+ of Glaisher's theorem when `m = 2`. This is also Theorem 45 from the
22+ [ 100 Theorems List ] (https://www.cs.ru.nl/~freek/100/).
23+
24+ ## Proof outline
25+
26+ The proof is based on the generating functions for `restricted` and `countRestricted` partitions,
27+ which turn out to be equal:
28+
29+ $$\prod_{i=1,i\nmid m}^\infty\frac{1}{1-X^i}=\prod_{i=0}^\infty (1+X^{i+1}+\cdots+X^{(m-1)(i+1)})$$
2030
2131## References
2232https://en.wikipedia.org/wiki/Glaisher%27s_theorem
@@ -34,7 +44,7 @@ variable [CommSemiring R]
3444
3545/-- The generating function of `Nat.Partition.restricted n p` is
3646$$
37- \prod_{i \mem p} \sum_{j = 0}^{\infty} X^{ij}
47+ \prod_{i \in p} \sum_{j = 0}^{\infty} X^{ij}
3848$$ -/
3949theorem hasProd_powerSeriesMk_card_restricted [IsTopologicalSemiring R]
4050 (p : ℕ → Prop ) [DecidablePred p] :
@@ -145,4 +155,8 @@ theorem card_restricted_eq_card_countRestricted (n : ℕ) {m : ℕ} (hm : 0 < m)
145155 simpa using PowerSeries.ext_iff.mp
146156 (powerSeriesMk_card_restricted_eq_powerSeriesMk_card_countRestricted ℤ hm) n
147157
158+ theorem card_odds_eq_card_distincts (n : ℕ) : #(odds n) = #(distincts n) := by
159+ simp_rw [← countRestricted_two, odds, even_iff_two_dvd]
160+ exact card_restricted_eq_card_countRestricted n (by norm_num)
161+
148162end Nat.Partition
0 commit comments