The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V30. Combinatorics

Mathlib.Combinatorics.Enumerative.Partition.Glaisher

10 declarations. Mathlib docs · Source

Glaisher's theorem

This file proves Glaisher's theorem: the number of partitions of an integer $n$ into parts not divisible by $d$ is equal to the number of partitions in which no part is repeated $d$ or more times.

Main declarations

  • Nat.Partition.card_restricted_eq_card_countRestricted: Glaisher's theorem.
  • Nat.Partition.card_odds_eq_card_distincts: Euler's partition theorem, a special case of Glaisher's theorem when m = 2. This is also Theorem 45 from the 100 Theorems List.

Proof outline

The proof is based on the generating functions for restricted and countRestricted partitions, which turn out to be equal:

$$\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)})$$

References

https://en.wikipedia.org/wiki/Glaisher%27s_theorem

theorem Nat.Partition.restricted.congr_simp E1 #

∀ (n : ℕ) (p p_1 : ℕ → Prop),
  p = p_1 →
    ∀ {inst : DecidablePred p} [inst_1 : DecidablePred p_1],
      Nat.Partition.restricted n p = Nat.Partition.restricted n p_1

theorem Nat.Partition.hasProd_powerSeriesMk_card_restricted E1 #

∀ (R : Type u_1) [inst : TopologicalSpace R] [T2Space R] [inst_2 : CommSemiring R] [IsTopologicalSemiring R]
  (p : ℕ → Prop) [inst_4 : DecidablePred p],
  HasProd (fun i ↦ if p (i + 1) then ∑' (j : ℕ), PowerSeries.X ^ ((i + 1) * j) else 1)
    (PowerSeries.mk fun n ↦ ↑(Nat.Partition.restricted n p).card)

The generating function of Nat.Partition.restricted n p is $$ \prod_{i \in p} \sum_{j = 0}^{\infty} X^{ij} $$

theorem Nat.Partition.multipliable_powerSeriesMk_card_restricted E1 #

∀ (R : Type u_1) [inst : TopologicalSpace R] [T2Space R] [inst_2 : CommSemiring R] [IsTopologicalSemiring R]
  (p : ℕ → Prop) [inst_4 : DecidablePred p],
  Multipliable fun i ↦ if p (i + 1) then ∑' (j : ℕ), PowerSeries.X ^ ((i + 1) * j) else 1

theorem Nat.Partition.powerSeriesMk_card_restricted_eq_tprod E1 #

∀ (R : Type u_1) [inst : TopologicalSpace R] [T2Space R] [inst_2 : CommSemiring R] [IsTopologicalSemiring R]
  (p : ℕ → Prop) [inst_4 : DecidablePred p],
  (PowerSeries.mk fun n ↦ ↑(Nat.Partition.restricted n p).card) =
    ∏' (i : ℕ), if p (i + 1) then ∑' (j : ℕ), PowerSeries.X ^ ((i + 1) * j) else 1

theorem Nat.Partition.hasProd_powerSeriesMk_card_countRestricted E1 #

∀ (R : Type u_1) [inst : TopologicalSpace R] [T2Space R] [inst_2 : CommSemiring R] {m : ℕ},
  0 < m →
    HasProd (fun i ↦ ∑ j ∈ Finset.range m, PowerSeries.X ^ ((i + 1) * j))
      (PowerSeries.mk fun n ↦ ↑(Nat.Partition.countRestricted n m).card)

The generating function of Nat.Partition.countRestricted n m is $$ \prod_{i = 1}^{\infty} \sum_{j = 0}^{m - 1} X^{ij} $$

theorem Nat.Partition.multipliable_powerSeriesMk_card_countRestricted E1 #

∀ (R : Type u_1) [inst : TopologicalSpace R] [T2Space R] [inst_2 : CommSemiring R] (m : ℕ),
  Multipliable fun i ↦ ∑ j ∈ Finset.range m, PowerSeries.X ^ ((i + 1) * j)

theorem Nat.Partition.powerSeriesMk_card_countRestricted_eq_tprod E1 #

∀ (R : Type u_1) [inst : TopologicalSpace R] [T2Space R] [inst_2 : CommSemiring R] {m : ℕ},
  0 < m →
    (PowerSeries.mk fun n ↦ ↑(Nat.Partition.countRestricted n m).card) =
      ∏' (i : ℕ), ∑ j ∈ Finset.range m, PowerSeries.X ^ ((i + 1) * j)

theorem Nat.Partition.powerSeriesMk_card_restricted_eq_powerSeriesMk_card_countRestricted E1 #

∀ (R : Type u_1) [inst : CommRing R] [NoZeroDivisors R] {m : ℕ},
  0 < m →
    (PowerSeries.mk fun n ↦ ↑(Nat.Partition.restricted n fun x ↦ ¬m ∣ x).card) =
      PowerSeries.mk fun n ↦ ↑(Nat.Partition.countRestricted n m).card

theorem Nat.Partition.card_restricted_eq_card_countRestricted E3 #

∀ (n : ℕ) {m : ℕ}, 0 < m → (Nat.Partition.restricted n fun x ↦ ¬m ∣ x).card = (Nat.Partition.countRestricted n m).card

theorem Nat.Partition.card_odds_eq_card_distincts E3 #

∀ (n : ℕ), (Nat.Partition.odds n).card = (Nat.Partition.distincts n).card