The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V30. Combinatorics

Mathlib.Combinatorics.Enumerative.Catalan.Basic

11 declarations. Mathlib docs · Source

Catalan numbers

The Catalan numbers (http://oeis.org/A000108) are probably the most ubiquitous sequence of integers in mathematics. They enumerate several important objects like binary trees, Dyck paths, and triangulations of convex polygons.

Main definitions

  • catalan n: the nth Catalan number, defined recursively as catalan (n + 1) = ∑ i : Fin n.succ, catalan i * catalan (n - i).

Main results

  • catalan_eq_centralBinom_div: The explicit formula for the Catalan number using the central binomial coefficient, catalan n = Nat.centralBinom n / (n + 1).

Implementation notes

The proof of catalan_eq_centralBinom_div follows https://math.stackexchange.com/questions/3304415

TODO

  • Prove that the Catalan numbers enumerate many interesting objects.
  • Provide the many variants of Catalan numbers, e.g. associated to complex reflection groups, Fuss-Catalan, etc.

theorem catalan.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 catalan.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 ()

def catalan E3 #

ℕ → ℕ

The recursive definition of the sequence of Catalan numbers: catalan (n + 1) = ∑ i : Fin n.succ, catalan i * catalan (n - i)

theorem catalan_zero E0 #

catalan 0 = 1

theorem catalan_succ E1 #

∀ (n : ℕ), catalan (n + 1) = ∑ i, catalan ↑i * catalan (n - ↑i)

theorem catalan_succ' E1 #

∀ (n : ℕ), catalan (n + 1) = ∑ ij ∈ Finset.HasAntidiagonal.antidiagonal n, catalan ij.1 * catalan ij.2

theorem catalan_one E0 #

catalan 1 = 1

theorem catalan_eq_centralBinom_div E3 #

∀ (n : ℕ), catalan n = n.centralBinom / (n + 1)

theorem succ_mul_catalan_eq_centralBinom E1 #

∀ (n : ℕ), (n + 1) * catalan n = n.centralBinom

theorem catalan_two E1 #

catalan 2 = 2

theorem catalan_three E1 #

catalan 3 = 5