(** * Permutations modulo p. *)

Fixpoint permmod (p : nat) (l1 : Zlist) {struct l1} : 
 Zlist -> Prop :=
  fun l2 : Zlist =>
  match l1 with
  | Nil => l2 = Nil Z
  | Cons x t =>
      exists y : Z, inlist Z y l2 /\ Mod x y p /\ permmod p t (zdrop y l2)
  end.

Lemma permmod_drop_drop1 : forall (n p : nat) (x y : Z) (l : Zlist), n = length Z l -> Mod x y p -> inlist Z x l -> inlist Z y l -> permmod p (zdrop x l) (zdrop y l).