The pair-colouring count with margins #
Summed over all permutations, the number of fixed pair colourings
with prescribed row and column margins is n! times the number of
pair contents with those margins: Fubini, the pair stabilizer
count, content grouping, and orbit–stabilizer.
theorem
RS.pair_count_sum
{n k : ℕ}
(α β : Fin k → ℕ)
:
∑ π : Equiv.Perm (Fin n),
{p : Fin n → Fin k × Fin k |
(∀ (a : Fin k), fibreCard (fun (i : Fin n) => (p i).1) a = α a) ∧ (∀ (b : Fin k), fibreCard (fun (i : Fin n) => (p i).2) b = β b) ∧ p ∘ ⇑π = p}.card = n.factorial * Fintype.card
{ s : Sym (Fin k × Fin k) n // (∀ (a : Fin k), ∑ b : Fin k, Multiset.count (a, b) ↑s = α a) ∧ ∀ (b : Fin k), ∑ a : Fin k, Multiset.count (a, b) ↑s = β b }
The pair-colouring count with margins.