File: Mathlib/Data/Nat/Choose/Basic.lean

full_name: Nat.choose
code: /-- `choose n k` is the number of `k`-element subsets in an `n`-element set. Also known as binomial
coefficients. -/
def choose : ℕ → ℕ → ℕ
  
goal: ℕ → ℕ → ℕ

full_name: Nat.choose_zero_right
code: @[simp]
theorem choose_zero_right (n : ℕ) : choose n 0 = 1 
goal: n.choose 0 = 1

full_name: Nat.choose_zero_succ
code: @[simp]
theorem choose_zero_succ (k : ℕ) : choose 0 (succ k) = 0 
goal: Nat.choose 0 k.succ = 0

full_name: Nat.choose_succ_succ
code: theorem choose_succ_succ (n k : ℕ) : choose (succ n) (succ k) = choose n k + choose n (succ k) 
goal: n.succ.choose k.succ = n.choose k + n.choose k.succ

full_name: Nat.choose_succ_succ'
code: theorem choose_succ_succ' (n k : ℕ) : choose (n + 1) (k + 1) = choose n k + choose n (k + 1) 
goal: (n + 1).choose (k + 1) = n.choose k + n.choose (k + 1)

full_name: Nat.choose_eq_zero_of_lt
code: theorem choose_eq_zero_of_lt : ∀ {n k}, n < k → choose n k = 0
  
goal: n < k → n.choose k = 0

full_name: Nat.choose_self
code: @[simp]
theorem choose_self (n : ℕ) : choose n n = 1 
goal: n.choose n = 1

full_name: Nat.choose_succ_self
code: @[simp]
theorem choose_succ_self (n : ℕ) : choose n (succ n) = 0 
goal: n.choose n.succ = 0

full_name: Nat.choose_one_right
code: @[simp]
lemma choose_one_right (n : ℕ) : choose n 1 = n 
goal: n.choose 1 = n

full_name: Nat.triangle_succ
code: theorem triangle_succ (n : ℕ) : (n + 1) * (n + 1 - 1) / 2 = n * (n - 1) / 2 + n 
goal: (n + 1) * (n + 1 - 1) / 2 = n * (n - 1) / 2 + n

full_name: Nat.choose_two_right
code: /-- `choose n 2` is the `n`-th triangle number. -/
theorem choose_two_right (n : ℕ) : choose n 2 = n * (n - 1) / 2 
goal: n.choose 2 = n * (n - 1) / 2

full_name: Nat.choose_pos
code: theorem choose_pos : ∀ {n k}, k ≤ n → 0 < choose n k
  
goal: k ≤ n → 0 < n.choose k

full_name: Nat.choose_eq_zero_iff
code: theorem choose_eq_zero_iff {n k : ℕ} : n.choose k = 0 ↔ n < k 
goal: n.choose k = 0 ↔ n < k

full_name: Nat.succ_mul_choose_eq
code: theorem succ_mul_choose_eq : ∀ n k, succ n * choose n k = choose (succ n) (succ k) * succ k
  
goal: n.succ * n.choose k = n.succ.choose k.succ * k.succ

full_name: Nat.choose_mul_factorial_mul_factorial
code: theorem choose_mul_factorial_mul_factorial : ∀ {n k}, k ≤ n → choose n k * k ! * (n - k)! = n !
  
goal: k ≤ n → n.choose k * k ! * (n - k)! = n !

full_name: Nat.choose_mul
code: theorem choose_mul {n k s : ℕ} (hkn : k ≤ n) (hsk : s ≤ k) :
    n.choose k * k.choose s = n.choose s * (n - s).choose (k - s) 
goal: n.choose k * k.choose s = n.choose s * (n - s).choose (k - s)

full_name: Nat.choose_eq_factorial_div_factorial
code: theorem choose_eq_factorial_div_factorial {n k : ℕ} (hk : k ≤ n) :
    choose n k = n ! / (k ! * (n - k)!) 
goal: n.choose k = n ! / (k ! * (n - k)!)

full_name: Nat.add_choose
code: theorem add_choose (i j : ℕ) : (i + j).choose j = (i + j)! / (i ! * j !) 
goal: (i + j).choose j = (i + j)! / (i ! * j !)

full_name: Nat.add_choose_mul_factorial_mul_factorial
code: theorem add_choose_mul_factorial_mul_factorial (i j : ℕ) :
    (i + j).choose j * i ! * j ! = (i + j)! 
goal: (i + j).choose j * i ! * j ! = (i + j)!

full_name: Nat.factorial_mul_factorial_dvd_factorial
code: theorem factorial_mul_factorial_dvd_factorial {n k : ℕ} (hk : k ≤ n) : k ! * (n - k)! ∣ n ! 
goal: k ! * (n - k)! ∣ n !

full_name: Nat.factorial_mul_factorial_dvd_factorial_add
code: theorem factorial_mul_factorial_dvd_factorial_add (i j : ℕ) : i ! * j ! ∣ (i + j)! 
goal: i ! * j ! ∣ (i + j)!

full_name: Nat.choose_symm
code: @[simp]
theorem choose_symm {n k : ℕ} (hk : k ≤ n) : choose n (n - k) = choose n k 
goal: n.choose (n - k) = n.choose k

full_name: Nat.choose_symm_of_eq_add
code: theorem choose_symm_of_eq_add {n a b : ℕ} (h : n = a + b) : Nat.choose n a = Nat.choose n b 
goal: n.choose a = n.choose b

full_name: Nat.choose_symm_add
code: theorem choose_symm_add {a b : ℕ} : choose (a + b) a = choose (a + b) b 
goal: (a + b).choose a = (a + b).choose b

full_name: Nat.choose_symm_half
code: theorem choose_symm_half (m : ℕ) : choose (2 * m + 1) (m + 1) = choose (2 * m + 1) m 
goal: (2 * m + 1).choose (m + 1) = (2 * m + 1).choose m

full_name: Nat.choose_succ_right_eq
code: theorem choose_succ_right_eq (n k : ℕ) : choose n (k + 1) * (k + 1) = choose n k * (n - k) 
goal: n.choose (k + 1) * (k + 1) = n.choose k * (n - k)

full_name: Nat.choose_succ_self_right
code: @[simp]
theorem choose_succ_self_right : ∀ n : ℕ, (n + 1).choose n = n + 1
  
goal: (n + 1).choose n = n + 1

full_name: Nat.choose_mul_succ_eq
code: theorem choose_mul_succ_eq (n k : ℕ) : n.choose k * (n + 1) = (n + 1).choose k * (n + 1 - k) 
goal: n.choose k * (n + 1) = (n + 1).choose k * (n + 1 - k)

full_name: Nat.ascFactorial_eq_factorial_mul_choose
code: theorem ascFactorial_eq_factorial_mul_choose (n k : ℕ) :
    (n + 1).ascFactorial k = k ! * (n + k).choose k 
goal: (n + 1).ascFactorial k = k ! * (n + k).choose k

full_name: Nat.ascFactorial_eq_factorial_mul_choose'
code: theorem ascFactorial_eq_factorial_mul_choose' (n k : ℕ) :
    n.ascFactorial k = k ! * (n + k - 1).choose k 
goal: n.ascFactorial k = k ! * (n + k - 1).choose k

full_name: Nat.factorial_dvd_ascFactorial
code: theorem factorial_dvd_ascFactorial (n k : ℕ) : k ! ∣ n.ascFactorial k 
goal: k ! ∣ n.ascFactorial k

full_name: Nat.choose_eq_asc_factorial_div_factorial
code: theorem choose_eq_asc_factorial_div_factorial (n k : ℕ) :
    (n + k).choose k = (n + 1).ascFactorial k / k ! 
goal: (n + k).choose k = (n + 1).ascFactorial k / k !

full_name: Nat.choose_eq_asc_factorial_div_factorial'
code: theorem choose_eq_asc_factorial_div_factorial' (n k : ℕ) :
    (n + k - 1).choose k = n.ascFactorial k / k ! 
goal: (n + k - 1).choose k = n.ascFactorial k / k !

full_name: Nat.descFactorial_eq_factorial_mul_choose
code: theorem descFactorial_eq_factorial_mul_choose (n k : ℕ) : n.descFactorial k = k ! * n.choose k 
goal: n.descFactorial k = k ! * n.choose k

full_name: Nat.factorial_dvd_descFactorial
code: theorem factorial_dvd_descFactorial (n k : ℕ) : k ! ∣ n.descFactorial k 
goal: k ! ∣ n.descFactorial k

full_name: Nat.choose_eq_descFactorial_div_factorial
code: theorem choose_eq_descFactorial_div_factorial (n k : ℕ) : n.choose k = n.descFactorial k / k ! 
goal: n.choose k = n.descFactorial k / k !

full_name: Nat.fast_choose
code: /-- A faster implementation of `choose`, to be used during bytecode evaluation
and in compiled code. -/
def fast_choose n k 
goal: ℕ

full_name: Nat.choose_eq_fast_choose
code: @[csimp] lemma choose_eq_fast_choose : Nat.choose = fast_choose 
goal: Nat.choose = Nat.fast_choose

full_name: Nat.choose_le_succ_of_lt_half_left
code: /-- Show that `Nat.choose` is increasing for small values of the right argument. -/
theorem choose_le_succ_of_lt_half_left {r n : ℕ} (h : r < n / 2) :
    choose n r ≤ choose n (r + 1) 
goal: n.choose r ≤ n.choose (r + 1)

full_name: _private.Mathlib.Data.Nat.Choose.Basic.0.Nat.choose_le_middle_of_le_half_left
code: /-- Show that for small values of the right argument, the middle value is largest. -/
private theorem choose_le_middle_of_le_half_left {n r : ℕ} (hr : r ≤ n / 2) :
    choose n r ≤ choose n (n / 2) 
goal: n.choose r ≤ n.choose (n / 2)

full_name: Nat.choose_le_middle
code: /-- `choose n r` is maximised when `r` is `n/2`. -/
theorem choose_le_middle (r n : ℕ) : choose n r ≤ choose n (n / 2) 
goal: n.choose r ≤ n.choose (n / 2)

full_name: Nat.choose_le_succ
code: theorem choose_le_succ (a c : ℕ) : choose a c ≤ choose a.succ c 
goal: a.choose c ≤ a.succ.choose c

full_name: Nat.choose_le_add
code: theorem choose_le_add (a b c : ℕ) : choose a c ≤ choose (a + b) c 
goal: a.choose c ≤ (a + b).choose c

full_name: Nat.choose_le_choose
code: theorem choose_le_choose {a b : ℕ} (c : ℕ) (h : a ≤ b) : choose a c ≤ choose b c 
goal: a.choose c ≤ b.choose c

full_name: Nat.choose_mono
code: theorem choose_mono (b : ℕ) : Monotone fun a => choose a b 
goal: Monotone fun a => a.choose b

full_name: Nat.multichoose
code: /--
`multichoose n k` is the number of multisets of cardinality `k` from a type of cardinality `n`. -/
def multichoose : ℕ → ℕ → ℕ
  
goal: ℕ → ℕ → ℕ

full_name: Nat.multichoose_zero_right
code: @[simp]
theorem multichoose_zero_right (n : ℕ) : multichoose n 0 = 1 
goal: n.multichoose 0 = 1

full_name: Nat.multichoose_zero_succ
code: @[simp]
theorem multichoose_zero_succ (k : ℕ) : multichoose 0 (k + 1) = 0 
goal: Nat.multichoose 0 (k + 1) = 0

full_name: Nat.multichoose_succ_succ
code: theorem multichoose_succ_succ (n k : ℕ) :
    multichoose (n + 1) (k + 1) = multichoose n (k + 1) + multichoose (n + 1) k 
goal: (n + 1).multichoose (k + 1) = n.multichoose (k + 1) + (n + 1).multichoose k

full_name: Nat.multichoose_one
code: @[simp]
theorem multichoose_one (k : ℕ) : multichoose 1 k = 1 
goal: Nat.multichoose 1 k = 1

full_name: Nat.multichoose_two
code: @[simp]
theorem multichoose_two (k : ℕ) : multichoose 2 k = k + 1 
goal: Nat.multichoose 2 k = k + 1

full_name: Nat.multichoose_one_right
code: @[simp]
theorem multichoose_one_right (n : ℕ) : multichoose n 1 = n 
goal: n.multichoose 1 = n

full_name: Nat.multichoose_eq
code: theorem multichoose_eq : ∀ n k : ℕ, multichoose n k = (n + k - 1).choose k
  
goal: n.multichoose k = (n + k - 1).choose k