💎 Reusable layer
← all 82R0027

The Pólya–Redfield enumeration theorem

showcase

Use this theorem

  1. Create a project

    Shell
    lake +leanprover/lean4:v4.35.0 new myproject std.toml
    cd myproject

    Standard template, not math: the math template adds its own Mathlib requirement pinned to the Lean release tag, not to the Mathlib commit this package is built and tested with, so you would get a second, different Mathlib. Mathlib comes in through this package. Skip this step in an existing project with the same Lean and Mathlib.

  2. Add the dependency to lakefile.toml

    TOML
    [[require]]
    name = "formalizations"
    git = "https://github.com/karlesmarin/formalizations"
    rev = "v0.15.0"
  3. Import the minimal module

    Lean 4
    import Formalizations.Reusable.GroupTheory

    In a file of the project, e.g. Example.lean.

  4. Paste the example

    Lean 4
    open Formalizations.Reusable
    open Classical in
    open scoped Pointwise in
    
    /-- Counting colourings up to symmetry (all weights `1`): `|G| · #orbits` is the sum over `g` of
    `|C|` to the number of cycles of `g` on `α`, fixed points included. -/
    example {G α C : Type*} [Group G] [Fintype G] [MulAction G α] [Fintype α] [Fintype C] :
        letI := arrowAction (G := G) (A := α) (B := C)
        Fintype.card G * Fintype.card (MulAction.orbitRel.Quotient G (α → C)) =
          ∑ g : G, (Fintype.card C) ^
            (Fintype.card (Function.fixedPoints (MulAction.toPerm g : Equiv.Perm α)) +
              (MulAction.toPerm g : Equiv.Perm α).cycleType.card) := by
      let _ := arrowAction (G := G) (A := α) (B := C)
      have h := polya_redfield_card_mul_sum_orbit_weight (G := G) (α := α) (C := C) (R := ℤ)
        (fun _ => 1)
      simp only [Finset.prod_const_one, Finset.sum_const, Finset.card_univ, one_pow, nsmul_eq_mul,
        mul_one, Multiset.map_const', Multiset.prod_replicate] at h
      rw [← Nat.cast_inj (R := ℤ)]
      push_cast
      rw [h]
      refine Finset.sum_congr rfl fun g _ => ?_
      rw [pow_add]

    Steps 3 and 4 together are a complete Lean file:FormalizationsTest/ReusableGroupTheoryExample.lean at v0.15.0, compiled by the CI.

  5. Fetch and check

    Shell
    lake update
    lake lean Example.lean

    lake update fetches this package and Mathlib, and Mathlib's update hook downloads the compiled Mathlib (lake exe cache get). lake lean Example.lean builds the imports of the file (steps 3 and 4) and checks it. If the file belongs to a lean_lib of your project, lake build <lib> does the same. Avoid a bare lake build in a project from the standard template: its default target is the executable, whose link compiles every imported Mathlib module to native code. Same versions required: Lean v4.35.0, Mathlib f0b4c81.

Alternative: import Formalizations.Reusable imports the whole layer (all areas).

Pólya–Redfield enumeration theorem: for a finite group G acting on a finite set α and colour weights w, |G| · Σ over orbits of colourings of Π_a w(F a) equals Σ_g p₁^(fixed points of g) · Π over the cycles of g of p_length, where p_k = Σ_c w(c)^k.

Lean statement

Lean 4
theorem polya_redfield_card_mul_sum_orbit_weight {G α C R : Type*} [Group G] [Fintype G]
    [MulAction G α] [Fintype α] [Fintype C] [CommRing R] (w : C → R) :
    letI := arrowAction (G := G) (A := α) (B := C)
    (Fintype.card G : R) * ∑ O : MulAction.orbitRel.Quotient G (α → C), ∏ a, w (O.out a) =
      ∑ g : G, (∑ c, w c) ^ (Fintype.card (Function.fixedPoints (MulAction.toPerm g : Equiv.Perm α))) *
        ((MulAction.toPerm g : Equiv.Perm α).cycleType.map (fun k => ∑ c, w c ^ k)).prod
Name
Formalizations.Reusable.polya_redfield_card_mul_sum_orbit_weight
Import
import Formalizations.Reusable.GroupTheory
Version
formalizations 0.15.0Lean v4.35.0Mathlib f0b4c81
Role
showcase a classical theorem, to consult
Provenance
PolyaRedfield.card_mul_sum_orbit_weight in Formalizations.GroupTheory.GroupAction.PolyaRedfield
Paper: none (Theorem of the Day)
Classical reference
J. H. Redfield, Amer. J. Math. 49 (1927) 433–455; G. Pólya, Acta Math. 68 (1937) 145–254
Trust
standard axioms only propext, Classical.choice, Quot.sound
#print axioms in FormalizationsTest/Axioms.lean, audited by scripts/check_axioms.sh (2758 results), which the CI build workflow runs and passed at this commit.
Status
reusable upstream candidate
Area
Group Theory

Links

Lean docstring

The Pólya–Redfield enumeration theorem (weighted form). A finite group G acting on a finite set α acts on colourings F : α → C by Mathlib's arrowAction, (g • F) a = F (g⁻¹ • a). Give each colour a weight w c in a commutative ring and each colouring the weight W F = ∏ₐ w (F a). Then |G| · Σ_{orbits O} W O = Σ_{g ∈ G} p₁^{fix g} · ∏_{cycles of g of length k ≥ 2} p_k, where p_k = Σ_c (w c)^k: the cycle index of the action evaluated at the power sums of the weights (Mathlib's Equiv.Perm.cycleType lists the cycles of length at least 2; the fixed points are the cycles of length 1). With w = 1 it counts colourings up to symmetry.

  • Archive: PolyaRedfield.card_mul_sum_orbit_weight (Formalizations.GroupTheory.GroupAction.PolyaRedfield, a weighted Burnside lemma plus the factorization of the fixed colourings over the cycles); the module cites no paper DOI of ours.
  • Classical reference: J. H. Redfield, The theory of group-reduced distributions, Amer. J. Math. 49 (1927) 433–455; G. Pólya, Acta Math. 68 (1937) 145–254.
  • Example: the necklaces of 4 beads in 2 colours up to rotation (G = ZMod 4 acting on itself) are (2⁴ + 2 + 2² + 2) / 4 = 6.

Upstream

Mathlib has Burnside's lemma (MulAction.sum_card_fixedBy_eq_card_orbits_mul_card_group) and Equiv.Perm.cycleType but not the enumeration theorem

Depends on, in this repository

None besides the archive module (repo_dependencies = []).