Fixpoint fact n := match n with 0 => 1 | S n => (S n) * fact n end.Fact fact_0 : fact 0 = 1.Fact fact_S n : fact (S n) = (S n)*fact n.Fact fact_gt_0 n : 0 < fact n.Infix "<d" := divides (at level 70, no associativity).Fixpoint binomial n p :=
    match n, p with
      | n, 0     => 1
      | 0, S _   => 0
      | S n, S p => binomial n p + binomial n (S p)
    end.Fact binomial_n0 n : binomial n 0 = 1.Fact binomial_SS n p : binomial (S n) (S p) = binomial n p + binomial n (S p).Fact binomial_n1 n : 1 <= n -> binomial n 1 = n.Fact binomial_gt n : forall p, n < p -> binomial n p = 0.Fact binomial_nn n : binomial n n = 1.

Theorem binomial_thm n p : p <= n -> fact n = binomial n p * fact p * fact (n-p).