Definition CoPrime (a b : nat) := gcd (Z_of_nat a) (Z_of_nat b) 1.
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.

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)))}.