Bell numbers for multisets #
For n : ℕ, the nth Bell number is the number of partitions of a set of cardinality n. Here, we define a refinement of these numbers, that count, for any m : Multiset ℕ, the number of partitions of a set of cardinality m.sum whose parts have cardinalities given by m.
The definition presents it as a natural number.
Multiset.bell: number of partitions of a set whose parts have cardinalities a given multisetNat.uniformBell m n: short name forMultiset.bell (replicate m n)Multiset.bell_mul_eqshows thatm.bell * (m.map (fun j ↦ j !)).prod * Π j ∈ (m.toFinset.erase 0), (m.count j)! = m.sum !Nat.uniformBell_mul_eqshows thatuniformBell m n * n ! ^ m * m ! = (m * n)!Nat.uniformBell_succ_leftcomputesNat.uniformBell (m + 1) nfromNat.uniformBell m n
TODO #
Prove that it actually counts the number of partitions as indicated. (When m contains 0, the result requires to admit repetitions of the empty set as a part.)
Number of partitions of a set of cardinality m.sum whose parts have cardinalities given by m
Equations
- m.bell = (Nat.multinomial m.toFinset fun (k : ℕ) => k * Multiset.count k m) * ∏ k ∈ m.toFinset.erase 0, ∏ j ∈ Finset.range (Multiset.count k m), (j * k + k - 1).choose (k - 1)
Instances For
Number of possibilities of dividing a set with m * n elements into m groups of n-element subsets.
Equations
- m.uniformBell n = (Multiset.replicate m n).bell