Definition prod : forall (n : nat) (x : nat -> nat), nat.
intros.
induction n as [| n Hrecn].
exact 1.
exact (x n * Hrecn).
Defined.
Definition factorial (n : nat) : nat := prod n S.

(* Specifications: *)
Lemma coPrime1 : forall a : nat, CoPrime 1 a.
Lemma coPrimeMult3 :
forall a b c : nat,
a > 0 -> b > 0 -> c > 0 -> CoPrime a c -> CoPrime b c -> CoPrime (a * b) c.
Lemma multBig1 : forall a b : nat, a > 0 -> b > 0 -> a * b > 0.
Lemma prodBig1 :
forall (n : nat) (x : nat -> nat),
(forall z : nat, z < n -> x z > 0) -> prod n x > 0.
Lemma sameProd :
forall (n : nat) (x1 x2 : nat -> nat),
(forall z : nat, z < n -> x1 z = x2 z) -> prod n x1 = prod n x2.
Lemma coPrimeProd :
forall (n : nat) (x : nat -> nat),
(forall z1 z2 : nat,
z1 < S n -> z2 < S n -> z1 <> z2 -> CoPrime (x z1) (x z2)) ->
(forall z : nat, z < S n -> x z > 0) -> CoPrime (prod n x) (x n).
Lemma divProd :
forall (n : nat) (x : nat -> nat) (i : nat),
i < n -> Divides (x i) (prod n x).
Lemma chRem :
forall (n : nat) (x : nat -> nat),
(forall z1 z2 : nat, z1 < n -> z2 < n -> z1 <> z2 -> CoPrime (x z1) (x z2)) ->
forall (y : nat -> nat) (py : forall z : nat, z < n -> y z < x z),
{a : nat |
a < prod n x /\
(forall (z : nat) (pz : z < n),
y z = snd (proj1_sig (modulo (x z) (ltgt1 _ _ (py z pz)) a)))}.
Lemma minusS : forall a b : nat, b - a = S b - S a.
Lemma primeDiv :
forall a : nat, 1 < a -> exists p : nat, Prime p /\ Divides p a.