Section ZpDef.
(***********************************************************************)
(*                                                                     *)
(*  Mod p arithmetic on the finite set {0, 1, 2, ..., p - 1}           *)
(*                                                                     *)
(***********************************************************************)
Variable p' : nat.
Local Notation p := p'.+1.
Implicit Types x y z : 'I_p.
(* Standard injection; val (inZp i) = i %% p *)
Definition inZp i := Ordinal (ltn_pmod i (ltn0Sn p')).

Lemma modZp x : x %% p = x.