(** * The list of integers between 1 and n (inclusive) *)
Fixpoint until (n : nat) : Zlist :=
match n with
| O => Nil Z
| S n => Cons Z (Z_of_nat (S n)) (until n)
end.

Lemma until_mod_all :
forall (p : nat) (x : Z),
0 < p ->
~ Mod x 0 p -> exists y : Z, inlist Z y (until (pred p)) /\ Mod x y p.