Theorem 15.11 — Pólya's Enumeration Theorem
ProvedAppliedComb.Polya.polya_enumerationLet be a set with and the set of colorings . Let be a permutation group of , acting on colorings by and so inducing an equivalence relation on . Let be the cycle index of , where is the number of cycles of length of (fixed points counted as cycles of length ). Then
is the generating function for the number of nonequivalent colorings of in : in commuting variables , the coefficient of is the number of equivalence classes of colorings that use each color exactly times. Equivalently,
Setting every recovers the number of nonequivalent colorings, .
Formalization Note. is AppliedComb.Polya.cycleIndex G in MvPolynomial (Fin r) ℚ with = Fintype.card S, and the substitution is MvPolynomial.bind₁ sending the variable with index k : Fin r to . The right side is AppliedComb.Polya.patternInventory G m in MvPolynomial (Fin m) ℚ, the sum over the classes of colorSetoid G m of the weight of a representative. The cycle index is defined from cycle structure alone, so the theorem is not a restatement of its definition.
import Mathlib import Definitions.Def_AppliedComb_Polya_cycleIndex import Definitions.Def_AppliedComb_Polya_patternInventory
namespace AppliedComb.Polya
open MvPolynomial
/-- Keller–Trotter, Theorem 15.11 (Pólya's Enumeration Theorem), p. 302. Let `S` be a set with
`|S| = r` and `𝒞` the set of colorings of `S` using the colors `c_1, …, c_m`. If a permutation
group `G` acts on `S` to induce an equivalence relation on `𝒞`, then
`P_G(∑ c_i, ∑ c_i^2, …, ∑ c_i^r)` is the generating function for the number of nonequivalent
colorings of `S` in `𝒞`: substituting the power sum `∑_{i=1}^m c_i^k` for `x_k` (`1 ≤ k ≤ r`)
in the cycle index `P_G` gives the pattern inventory. The variable `X k` (`k : Fin r`) of `P_G`
stands for `x_{k+1}`, and the variable `X i` (`i : Fin m`) for the color `c_{i+1}`. -/
theorem polya_enumeration {S : Type*} [Fintype S] [DecidableEq S]
(G : Subgroup (Equiv.Perm S)) (m : ℕ) :
bind₁ (fun k : Fin (Fintype.card S) => ∑ i : Fin m, (X i : MvPolynomial (Fin m) ℚ) ^ (k.val + 1))
(cycleIndex G) = patternInventory G m := by sorry
end AppliedComb.Polya
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
Fix a finite type with decidable equality, and write for its number of elements. Let be any subgroup of the symmetric group of all permutations of . No further condition is placed on , so it may be the trivial subgroup or all of . Let be any natural number, with no lower bound.
The statement uses two objects defined elsewhere in this bundle, whose definitions are not included in the code given:
- . From how it is used, this is a multivariate polynomial with rational coefficients in variables , indexed by . It depends only on . What it actually computes cannot be read off from this declaration.
- . This is a multivariate polynomial with rational coefficients in variables , indexed by . It depends on and . Its content likewise cannot be read off from this declaration.
For each , define the power-sum polynomial
The variable with index is paired with exponent , so goes to , goes to , and so on up to , which goes to .
The theorem asserts an exact equality of polynomials in . Take the polynomial and substitute for each variable . This substitution is the -algebra homomorphism that sends and extends to all polynomials. The result is exactly :
The claim holds for every finite , every subgroup of , and every . Because the two named definitions are not visible here, the statement's mathematical content depends entirely on what they compute.
Degenerate cases.
- empty (). has one element, so is the trivial group. is then a polynomial in no variables, that is, a rational constant. The substitution leaves it unchanged, so the statement says equals that same constant, for every .
- . Every power sum is an empty sum and equals . The left side is then evaluated with every variable set to , which is its constant term. The right side is a polynomial in no variables, so the statement says is that rational number.
- . There is only the variable , which is replaced by .
- The group . It may be trivial or the full symmetric group. No hypothesis restricts it, and the code states no hypothesis that could be impossible to satisfy.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.