(***********************************************************************
**********************************************************************
**********************************************************************

	BINOMIAL
*)

Fixpoint binomial (a : nat) : nat -> nat :=
  fun b : nat =>
  match a, b with
  | _, O => 1
  | O, S b' => 0
  | S a', S b' => binomial a' (S b') + binomial a' b'
  end.

(* Specifications: *)
Lemma binomial_def1 : forall n : nat, binomial n 0 = 1.
Lemma binomial_def2 : forall n m : nat, n < m -> binomial n m = 0.
Lemma binomial_def3 : forall n : nat, binomial n n = 1.
Lemma binomial_def4 : forall n k : nat, k < n -> binomial (S n) (S k) = binomial n (S k) + binomial n k.
Lemma binomial_fact : forall m n : nat, binomial (n + m) n * (factorial n * factorial m) = factorial (n + m).
Theorem exp_Pascal : forall a b n : nat, power (a + b) n = sum_nm n 0 (fun k : nat => binomial n k * (power a (n - k) * power b k)).