(**
   Below is an attempt to restate Pocklington's theorem
   using only numbers from Z. This will make concrete
   computations faster.
 *)

(** ZallLinCombMod is equivalent to AllLinCombMod but uses Z. *)

Definition ZallLinCombMod (a n m N : Z) (qlist : Zlist) :=
  alllist Z
    (fun q : Z => ZLinCombMod 1 (ZExp a (m * zmultDrop q qlist) - 1) n N)
    qlist.

Theorem Zpocklington : forall (n q m a : Z) (qlist : Zlist), (n > 1)%Z -> (0 <= q)%Z -> (0 <= m)%Z -> n = (q * m + 1)%Z -> q = zproduct qlist -> allZPrime qlist -> ZMod (ZExp a (n - 1)) 1 n -> ZallLinCombMod a n m n qlist -> (n <= q * q)%Z -> ZPrime n.