Permutation descents, Eulerian numbers, and the cd-index
A Rocq / MathComp formalization of Stanley EC1 §1.4 + §1.6

6.2 Stirling numbers of the first kind

Definition 6.4 Signless Stirling cycle numbers

\(c(n, k) = \# \{ \sigma \in \mathfrak {S}_{n} : c(\sigma ) = k\} \) counts permutations of \(\{ 0, \dots , n-1\} \) with exactly \(k\) cycles in their disjoint-cycle decomposition. Stanley writes \(c(n, k)\) throughout §1.3.2.

Lemma 6.5 Row sum

\(\sum _{k=0}^{n} c(n, k) = n!\). Each permutation is counted by exactly one \(k\), so the row sum recovers the total.

Theorem 6.6 Stirling recurrence

For all \(n, k \in \mathbb {N}\),

\[ c(n+1, k+1) \; =\; n \cdot c(n, k+1) + c(n, k). \]

Combinatorially: \(n+1\) either becomes a fixed point of a \(k\)-cycle permutation (giving \(c(n, k)\)), or is inserted into one of \(n\) positions of a \((k+1)\)-cycle permutation (giving \(n \cdot c(n, k+1)\)).

Formalization route. The proof factors through a construction \(\mathrm{insert\_ after}\, j_0\, s : \mathfrak {S}_{n+1}\) that splices \(\mathrm{ord\_ max}\) into the \(s\)-cycle through \(j_0\). The key algebraic identity

\[ \mathrm{insert\_ after}\, j_0\, s \; =\; \mathrm{tperm}\, (\mathrm{ord\_ max})\, (\mathrm{lift}\, \mathrm{ord\_ max}\, j_0) \; \cdot \; \mathrm{lift\_ perm}\, \mathrm{ord\_ max}\, \mathrm{ord\_ max}\, s \]

reduces cycle-count preservation to MathComp’s porbits_mul_tperm composed with the fixed-point cycle-count lemma in .