(** The falling factorial *)
Definition falling_factorial := nosimpl ffact_rec.
Notation "n ^_ m" := (falling_factorial n m)
(at level 30, right associativity) : nat_scope.

(* Specifications: *)
Lemma ffactE : falling_factorial = ffact_rec. Proof. by []. Qed.
Lemma ffactn0 n : n ^_ 0 = 1. Proof. by []. Qed.
Lemma ffact0n m : 0 ^_ m = (m == 0). Proof. by case: m. Qed.
Lemma ffactnS n m : n ^_ m.+1 = n * n.-1 ^_ m. Proof. by []. Qed.
Lemma ffactSS n m : n.+1 ^_ m.+1 = n.+1 * n ^_ m. Proof. by []. Qed.
Lemma ffactn1 n : n ^_ 1 = n. Proof. exact: muln1. Qed.
Lemma ffactnSr n m : n ^_ m.+1 = n ^_ m * (n - m).
Lemma ffact_gt0 n m : (0 < n ^_ m) = (m <= n).
Lemma ffact_factd n m : m <= n -> n ^_ m = n`! %/ (n - m)`!.
Lemma leq_bin2l n1 n2 m : n1 <= n2 -> 'C(n1, m) <= 'C(n2, m).
Lemma bin_small n m : n < m -> 'C(n, m) = 0.
Lemma bin_fact n m : m <= n -> 'C(n, m) * (m`! * (n - m)`!) = n`!.
(* In fact the only exception for bin_factd is n = 0 and m = 1 *)
Lemma bin_factd n m : 0 < n -> 'C(n, m) = n`! %/ (m`! * (n - m)`!).
Lemma bin_ffact n m : 'C(n, m) * m`! = n ^_ m.
Lemma bin_ffactd n m : 'C(n, m) = n ^_ m %/ m`!.
(* Multiply to move down in the Pascal triangle. *)
Lemma mul_bin_down n m : n * 'C(n.-1, m) = (n - m) * 'C(n, m).
(* Multiply to move left in the Pascal triangle. *)
Lemma mul_bin_left n m : m.+1 * 'C(n, m.+1) = (n - m) * 'C(n, m).
Lemma triangular_sum n : \sum_(0 <= i < n) i = 'C(n, 2).
Lemma textbook_triangular_sum n : \sum_(0 <= i < n) i = 'C(n, 2).
Theorem Pascal a b n :
(a + b) ^ n = \sum_(i < n.+1) 'C(n, i) * (a ^ (n - i) * b ^ i).