The areas / V30. Combinatorics
Mathlib.Combinatorics.Enumerative.Schroder
17 declarations. Mathlib docs · Source
Schröder numbers
The Schröder numbers (https://oeis.org/A006318) are a sequence of integers that appear in various combinatorial contexts.
Main definitions
largeSchroder n: thenth large Schröder number, defined recursively asL 0 = 1andL (n + 1) = L n + ∑ i ≤ n, L i * L (n - i).smallSchroder n: thenth small Schröder number, defined asS 0 = 1andS n = L n / 2forn > 0.
Main results
largeSchroder_even: The large Schröder numbers are positive and even forn > 0.smallSchroder_succ: A recursive formula for small Schröder numbers:S (n + 1) = 3 * S n + 2 * ∑ i < n - 2, S (i + 2) * S (n - 1 - i).
Tags
Schroeder, Schroder
theorem Nat.largeSchroder.match_1.congr_eq_1 E1 #
∀ (motive : ℕ → Sort u_1) (x : ℕ) (h_1 : Unit → motive 0) (h_2 : (n : ℕ) → motive n.succ),
x = 0 →
(match x with
| 0 => h_1 ()
| n.succ => h_2 n) ≍
h_1 ()
theorem Nat.largeSchroder.match_1.congr_eq_2 E1 #
∀ (motive : ℕ → Sort u_1) (x : ℕ) (h_1 : Unit → motive 0) (h_2 : (n : ℕ) → motive n.succ) (n : ℕ),
x = n.succ →
(match x with
| 0 => h_1 ()
| n.succ => h_2 n) ≍
h_2 n
theorem Nat.smallSchroder.match_1.congr_eq_1 E1 #
∀ (motive : ℕ → Sort u_1) (x : ℕ) (h_1 : Unit → motive 0) (h_2 : Unit → motive 1) (h_3 : (n : ℕ) → motive n.succ),
x = 0 →
(match x with
| 0 => h_1 ()
| 1 => h_2 ()
| n.succ => h_3 n) ≍
h_1 ()
theorem Nat.smallSchroder.match_1.congr_eq_2 E1 #
∀ (motive : ℕ → Sort u_1) (x : ℕ) (h_1 : Unit → motive 0) (h_2 : Unit → motive 1) (h_3 : (n : ℕ) → motive n.succ),
x = 1 →
(match x with
| 0 => h_1 ()
| 1 => h_2 ()
| n.succ => h_3 n) ≍
h_2 ()
theorem Nat.smallSchroder.match_1.congr_eq_3 E1 #
∀ (motive : ℕ → Sort u_1) (x : ℕ) (h_1 : Unit → motive 0) (h_2 : Unit → motive 1) (h_3 : (n : ℕ) → motive n.succ)
(n : ℕ),
x = n.succ →
(n = 0 → False) →
(match x with
| 0 => h_1 ()
| 1 => h_2 ()
| n.succ => h_3 n) ≍
h_3 n
def Nat.largeSchroder E1 #
ℕ → ℕ
The recursive definition of the sequence of the large Schröder numbers :
a (n + 1) = a n + ∑ i : Fin n.succ, a i * a (n - i)
theorem Nat.largeSchroder_zero E0 #
Nat.largeSchroder 0 = 1
theorem Nat.largeSchroder_one E0 #
Nat.largeSchroder 1 = 2
theorem Nat.largeSchroder_two E0 #
Nat.largeSchroder 2 = 6
theorem Nat.largeSchroder_succ E1 #
∀ (n : ℕ), (n + 1).largeSchroder = n.largeSchroder + ∑ i ≤ n, i.largeSchroder * (n - i).largeSchroder
theorem Nat.even_largeSchroder E1 #
∀ {n : ℕ}, n ≠ 0 → Even n.largeSchroder
def Nat.smallSchroder E1 #
ℕ → ℕ
The small Schröder number is equal to : largeSchroder n = 2 * smallSchroder (n + 1), n ≥ 1
theorem Nat.smallSchroder_zero E0 #
Nat.smallSchroder 0 = 1
theorem Nat.smallSchroder_one E0 #
Nat.smallSchroder 1 = 1
theorem Nat.smallSchroder_succ_eq_largeSchroder_div_two E1 #
∀ {n : ℕ}, n ≠ 0 → (n + 1).smallSchroder = n.largeSchroder / 2
theorem Nat.two_mul_smallSchroder_succ E1 #
∀ {n : ℕ}, n ≠ 0 → 2 * (n + 1).smallSchroder = n.largeSchroder
theorem Nat.smallSchroder_succ E3 #
∀ {n : ℕ},
1 < n →
(n + 1).smallSchroder =
3 * n.smallSchroder + 2 * ∑ i ∈ Finset.Ioo 0 (n - 1), (i + 1).smallSchroder * (n - i).smallSchroder