Skip to content

Commit 901b783

Browse files

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Mathlib/Data/Nat/Choose/Sum.lean

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,14 @@ theorem four_pow_le_two_mul_add_one_mul_central_binom (n : ℕ) :
132132
_ = (2 * n + 1) * choose (2 * n) n := by simp
133133
#align nat.four_pow_le_two_mul_add_one_mul_central_binom Nat.four_pow_le_two_mul_add_one_mul_central_binom
134134

135+
/-- **Zhu Shijie's identity** aka hockey-stick identity. -/
136+
theorem sum_Icc_choose (n k : ℕ) : ∑ m in Icc k n, m.choose k = (n + 1).choose (k + 1) := by
137+
cases' le_or_gt k n with h h
138+
· induction' n, h using le_induction with n _ ih; · simp
139+
rw [← Ico_insert_right (by linarith), sum_insert (by simp),
140+
show Ico k (n + 1) = Icc k n by rfl, ih, choose_succ_succ' (n + 1)]
141+
· rw [choose_eq_zero_of_lt (by linarith), Icc_eq_empty_of_lt h, sum_empty]
142+
135143
end Nat
136144

137145
theorem Int.alternating_sum_range_choose {n : ℕ} :

0 commit comments

Comments
 (0)