Catalan numbers

Content created by Fredrik Bakke, Egbert Rijke, Jonathan Prieto-Cubides and Eléonore Mangel.

Created on 2022-03-21.
Last modified on 2024-10-16.

module elementary-number-theory.catalan-numbers where
Imports
open import elementary-number-theory.binomial-coefficients
open import elementary-number-theory.distance-natural-numbers
open import elementary-number-theory.multiplication-natural-numbers
open import elementary-number-theory.natural-numbers
open import elementary-number-theory.strict-inequality-natural-numbers
open import elementary-number-theory.strong-induction-natural-numbers
open import elementary-number-theory.sums-of-natural-numbers

open import univalent-combinatorics.standard-finite-types

Idea

The Catalan numbers is a sequence of natural numbers that occur in several combinatorics problems. The sequence starts

  n   0   1   2   3   4   5   6
  Cₙ  1   1   2   5  14  42 132 ⋯

The Catalan numbers may be defined by any of the formulas

  1. , with ,
  2. ,
  3. , with ,
  4. ,
  5. .

Where are binomial coefficients and is the factorial function.

Definitions

Inductive sum formula for the Catalan numbers

The Catalan numbers may be defined to be the sequence satisfying and the recurrence relation

catalan-numbers :   
catalan-numbers =
  strong-ind-ℕ
    ( λ _  )
    ( 1)
    ( λ k C 
      sum-Fin-ℕ k
        ( λ i 
          mul-ℕ
            ( C ( nat-Fin k i)
                ( leq-le-ℕ (nat-Fin k i) k (strict-upper-bound-nat-Fin k i)))
            ( C ( dist-ℕ (nat-Fin k i) k)
                ( leq-dist-ℕ
                  ( nat-Fin k i)
                  ( k)
                  ( leq-le-ℕ
                    ( nat-Fin k i)
                    ( k)
                    ( strict-upper-bound-nat-Fin k i))))))

Binomial difference formula for the Catalan numbers

The Catalan numbers may be computed as a distance between two consecutive binomial coefficients

Since in general is larger than or equal to , this distance is equal to the difference

However, we prefer the use of the distance binary operation on natural numbers in general at it is a total function on natural numbers, and allows us to skip proving this inequality.

catalan-numbers-binomial :   
catalan-numbers-binomial n =
  dist-ℕ
    ( binomial-coefficient-ℕ (2 *ℕ n) n)
    ( binomial-coefficient-ℕ (2 *ℕ n) (succ-ℕ n))

Recent changes