Documentation

BourbakiLean2.Combinatorics.Defs

noncomputable def Nat.factorial (n : Nat) :
Equations
Instances For
    @[simp]
    theorem Nat.factorial_succ {n : Nat} :
    (n + 1).factorial = n.factorial * (n + 1)
    @[simp]
    theorem Nat.factorial_pos {n : Nat} :
    0 < n.factorial
    theorem Nat.factorial_lt_succ {n : Nat} :
    (n + 1).factorial < (n + 1 + 1).factorial
    theorem Nat.factorial_strictMono :
    StrictMonotone fun (n : Nat) => (n + 1).factorial
    noncomputable def Nat.binom (n k : Nat) :
    Equations
    • n.binom k = if k n then n.factorial / (k.factorial * (n - k).factorial) else 0
    Instances For
      @[simp]
      theorem Nat.binom_zero_of_gt {n k : Nat} :
      n < kn.binom k = 0
      @[simp]
      theorem Nat.binom_of_le {n k : Nat} :
      k nn.binom k = n.factorial / (k.factorial * (n - k).factorial)