Stirling numbers of the first kind
DefinitionSigned Stirling numbers of the first kind#✓fully proved
For natural numbers \(n\) and \(k\), the signed Stirling number of the first kind is the integer \((-1)^{n-k} c(n,k)\), where \(c(n,k)\) is the unsigned Stirling number of the first kind (the number of permutations of \(n\) elements with exactly \(k\) cycles) and \(n - k\) is truncated subtraction, equal to \(0\) when \(k > n\).
def signedStirlingFirst : ℕ → ℕ → ℤ :=
fun n k => (-1 : ℤ) ^ (n - k) * (Nat.stirlingFirst n k : ℤ)
Used by 22
DefinitionNumber of cycles of a permutation#✓fully proved
For a permutation \(\sigma\) of a finite type \(\alpha\), the number of cycles of \(\sigma\), counting each fixed point as a cycle of length one, is the number of equivalence classes of \(\alpha\) under the relation that holds between \(x\) and \(y\) when \(\sigma^i(x) = y\) for some integer \(i\).
public noncomputable def cycleQuotientCount {α : Type*} [Fintype α]
(σ : Equiv.Perm α) : ℕ :=
Nat.card (Quotient (Equiv.Perm.SameCycle.setoid σ))
Used by 37
TheoremCounting cycles via the cycle type#✓fully proved
For a permutation \(\sigma\) of a finite type, the number of cycles of \(\sigma\), counting each fixed point as a cycle of length one, equals the number of cycles of \(\sigma\) of length at least \(2\) (the length of its cycle type) plus the number of fixed points of \(\sigma\).
public theorem cycleQuotientCount_eq {α : Type*} [Fintype α] [DecidableEq α]
(σ : Equiv.Perm α) :
cycleQuotientCount σ =
Multiset.card σ.cycleType + Fintype.card (Function.fixedPoints σ)
public noncomputable def cycleQuotientCount {α : Type*} [Fintype α]
(σ : Equiv.Perm α) : ℕ :=
Nat.card (Quotient (Equiv.Perm.SameCycle.setoid σ))
MathlibExt/Combinatorics/Enumerative/Stirling.lean:27
Uses 1 · Used by 5
TheoremStirling numbers of the first kind count permutations by cycles#✓fully proved
For all natural numbers \(n\) and \(k\), the number of permutations \(\sigma\) of \(\{0, \dots, n-1\}\) such that the number of cycles of \(\sigma\) of length at least \(2\) plus the number of fixed points of \(\sigma\) equals \(k\) is the unsigned Stirling number of the first kind \(c(n, k)\). In other words, \(c(n, k)\) counts the permutations of an \(n\)-element set with exactly \(k\) cycles, each fixed point counted as a cycle of length one.
public theorem card_perm_cycleCount_eq_stirlingFirst (n k : ℕ) :
Fintype.card {σ : Equiv.Perm (Fin n) //
Multiset.card σ.cycleType + Fintype.card (Function.fixedPoints σ) = k} =
Nat.stirlingFirst n k
Uses 2 · Used by 1
TheoremRising factorial generates Stirling numbers of the first kind#✓fully proved
The rising factorial is the generating polynomial of the unsigned Stirling numbers of the
first kind: ascPochhammer S n = ∑_{k=0}^{n} stirlingFirst n k * X ^ k
(Graham–Knuth–Patashnik, §6.1).
theorem sum_stirlingFirst_mul_X_pow (S : Type*) [Semiring S] (n : ℕ) :
∑ k ∈ range (n + 1), (stirlingFirst n k : S[X]) * X ^ k = ascPochhammer S n
Used by 1
TheoremStirling numbers of the first kind and the rising factorial#✓fully proved
∑_{k=0}^{n} stirlingFirst n k * x ^ k = x (x + 1) ⋯ (x + n - 1)
(Graham–Knuth–Patashnik, §6.1).
theorem sum_stirlingFirst_mul_pow {S : Type*} [Semiring S] (n : ℕ) (x : S) :
∑ k ∈ range (n + 1), (stirlingFirst n k : S) * x ^ k = (ascPochhammer S n).eval x
Uses 1
TheoremAddition formula for Stirling numbers of the first kind#✓fully proved
Write \(c(n,k)\) for the unsigned Stirling numbers of the first kind and \(u^{\overline{i}} = u(u+1)\cdots(u+i-1)\) for the rising factorial. For all natural numbers \(u\), \(v\) and \(k\),
where a term with \(j > k\) is read as \(0\).
theorem stirlingFirst_addition (u v k : ℕ) :
Nat.stirlingFirst (u + v) k =
∑ j ∈ Finset.range (v + 1), ∑ i ∈ Finset.range (v + 1),
v.choose i * u.ascFactorial i * Nat.stirlingFirst (v - i) j *
(if j ≤ k then Nat.stirlingFirst u (k - j) else 0)
Sources
- Grzegorz Rządkowski, "Two Formulas for Successive Derivatives and Their Applications," Journal of Integer Sequences 12 (2009), Article 09.8.2, Theorem, equation (ex44), lines 257–263, https://cs.uwaterloo.ca/journals/JIS/VOL12/Rzadkowski/rzadkowski3.tex
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.