Aether Catalog definitions — Speculative_NumberTheory_EulerianNumbers
DefinitionSpeculative_NumberTheory_EulerianNumbersaether-catalogspeculative
Definition bundle for the Aether Catalog module Speculative.NumberTheory.EulerianNumbers, transplanted by skeleton subtraction; supplies the types and constants the catalog's theorems import.
Definition code
-- Def bundle generated from Speculative/NumberTheory/EulerianNumbers.lean by skeleton subtraction
import Mathlib
/-
Copyright (c) 2026 Harmonic. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
-/
/-!
# Eulerian numbers and the row-sum identity
The *Eulerian number* `A(n, k)` counts the permutations of `{1, …, n}` with exactly `k`
ascents. Here we define a concrete recursive version `eul n k` and prove the classical
**row-sum identity**: for `n ≥ 1`,
`∑_{k = 0}^{n-1} eul n k = n!`.
The definition follows the standard triangular recurrence
`A(n+1, k+1) = (k+2) · A(n, k+1) + (n - k) · A(n, k)`,
with base row `A(0, 0) = 1` and left column `A(n, 0) = 1`.
-/
namespace Catalog.EulerianNumbers
open Finset
/-- The Eulerian numbers, defined by the triangular recurrence. -/
def eul : ℕ → ℕ → ℕ
| 0, 0 => 1
| 0, (_ + 1) => 0
| (_ + 1), 0 => 1
| (n + 1), (k + 1) => (k + 2) * eul n (k + 1) + (n - k) * eul n k
end Catalog.EulerianNumbers