Bell Numbers
Statement
The -th Bell number counts the total number of partitions of a set of elements. It satisfies:
where are the Stirling NumbersStirling NumbersCounting partitions of n elements into k non-empty subsetsRead more → of the second kind. Equivalently, by the Bell triangle recursion:
Visualization
Values through :
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | |
|---|---|---|---|---|---|---|---|
| 1 | 1 | 2 | 5 | 15 | 52 | 203 |
All partitions of — verifying :
1 block (k=1):
{ {1, 2, 3} }
2 blocks (k=2):
{ {1}, {2, 3} }
{ {2}, {1, 3} }
{ {3}, {1, 2} }
3 blocks (k=3):
{ {1}, {2}, {3} }
Five partitions total. .
Bell triangle (each row gives the next Bell number and recursion weights):
Row 0: 1
Row 1: 1 2
Row 2: 2 3 5
Row 3: 5 7 10 15
Row 4: 15 20 27 37 52
Each row starts with the last element of the previous row; each subsequent element is the sum of the element to its left and the element directly above it. The first element of each row is .
Recursion unrolled for :
Proof Sketch
The recursion follows from conditioning on the block containing element : if that block has size , choose the remaining members from in ways, then partition the leftover elements in ways. Summing over gives the formula (after re-indexing with ).
Mathlib's Nat.bell uses the Finset-indexed form ∑ i : Fin n.succ, choose n i * Nat.bell (n - i), proved as Nat.bell_succ.
Connections
- Stirling NumbersStirling NumbersCounting partitions of n elements into k non-empty subsetsRead more → — ; Bell numbers are horizontal sums of the Stirling triangle
- Inclusion-Exclusion PrincipleInclusion-Exclusion PrincipleThe size of a union is the alternating sum of intersection sizesRead more → — each in the sum is itself an inclusion-exclusion formula
- Catalan NumbersCatalan NumbersThe ubiquitous sequence counting balanced parentheses, binary trees, and Dyck pathsRead more → — both count partition-like objects; for since Catalan only counts non-crossing partitions
- Pigeonhole PrinciplePigeonhole PrincipleIf n+1 objects are placed into n boxes, some box contains at least two objectsRead more → — the rapid growth of means that any assignment of objects to partition-types must repeat a type for large
- Binomial TheoremBinomial TheoremExpanding powers of a sum via binomial coefficientsRead more → — the binomial coefficients in the recursion come from choosing block members
- Möbius InversionMöbius InversionIf g equals the Dirichlet convolution of f with the constant 1, then f recovers via the Möbius functionRead more → — the exponential generating function is proved via Möbius inversion on the partition lattice
Lean4 Proof
import Mathlib.Combinatorics.Enumerative.Bell
open Nat
/-- The Bell number recursion: B(n+1) = ∑ᵢ C(n,i) * B(n-i).
This is `Nat.bell_succ` in Mathlib. -/
theorem bell_recursion (n : ℕ) :
Nat.bell (n + 1) = ∑ i : Fin n.succ, Nat.choose n i * Nat.bell (n - i) :=
Nat.bell_succ n
/-- Verify small Bell numbers by computation.
Uses `native_decide` since `Nat.bell` does not reduce under `decide`. -/
theorem bell_vals :
Nat.bell 0 = 1 ∧ Nat.bell 1 = 1 ∧ Nat.bell 2 = 2 ∧
Nat.bell 3 = 5 ∧ Nat.bell 4 = 15 ∧ Nat.bell 5 = 52 := by native_decide
/-- B(0) = 1: the empty set has exactly one partition (the empty partition). -/
theorem bell_zero : Nat.bell 0 = 1 :=
Nat.bell_zero
/-- B(5) = 52, verifying the sixth Bell number. -/
theorem bell_five : Nat.bell 5 = 52 := by native_decideReferenced by
- Inclusion-Exclusion PrincipleCombinatorics
- Catalan NumbersCombinatorics
- Stirling NumbersCombinatorics
- Pigeonhole PrincipleCombinatorics
- Stirling's ApproximationCombinatorics