Documentation

Mathlib.Combinatorics.Enumerative.Stirling

Stirling Numbers #

This file defines Stirling numbers of the first and second kinds, proves their fundamental recurrence relations, and establishes some of their key properties and identities.

The Stirling numbers of the first kind #

The unsigned Stirling numbers of the first kind, represent the number of ways to partition n distinct elements into k non-empty cycles.

The Stirling numbers of the second kind #

The Stirling numbers of the second kind, represent the number of ways to partition n distinct elements into k non-empty subsets.

Main definitions #

References #

Nat.stirlingFirst n k is the (unsigned) Stirling number of the first kind, counting the number of permutations of n elements with exactly k disjoint cycles.

Equations
Instances For
    theorem Nat.stirlingFirst_succ_left (n k : ) (hk : k 0) :
    theorem Nat.stirlingFirst_succ_right (n k : ) (hn : n 0) :
    n.stirlingFirst (k + 1) = (n - 1) * (n - 1).stirlingFirst (k + 1) + (n - 1).stirlingFirst k

    Nat.stirlingSecond n k is the Stirling number of the second kind, counting the number of ways to partition a set of n elements into k nonempty subsets.

    Equations
    Instances For
      theorem Nat.stirlingSecond_succ_left (n k : ) (hk : k 0) :
      theorem Nat.stirlingSecond_succ_right (n k : ) (hn : n 0) :
      n.stirlingSecond (k + 1) = (k + 1) * (n - 1).stirlingSecond (k + 1) + (n - 1).stirlingSecond k
      theorem Nat.stirlingSecond_succ_succ (n k : ) :
      (n + 1).stirlingSecond (k + 1) = (k + 1) * n.stirlingSecond (k + 1) + n.stirlingSecond k