End ZpRing.
Definition Zp_trunc p := p.-2.
Notation "''Z_' p" := 'I_(Zp_trunc p).+2
(at level 8, p at level 2, format "''Z_' p") : type_scope.
Notation "''F_' p" := 'Z_(pdiv p)
(at level 8, p at level 2, format "''F_' p") : type_scope.
Arguments natr_Zp {p'} x.
Section Groups.
Variable p : nat.
Definition Zp := if p > 1 then [set: 'Z_p] else 1%g.
Definition units_Zp := [set: {unit 'Z_p}].

(* Specifications: *)
Lemma Zp_cast : p > 1 -> (Zp_trunc p).+2 = p.
Lemma Zp_group_set : group_set Zp.
Lemma mem_Zp x : p > 1 -> x \in Zp. Proof. by rewrite /Zp => ->. Qed.
Canonical units_Zp_group := [group of units_Zp].
Lemma card_units_Zp : p > 0 -> #|units_Zp| = totient p.
Lemma units_Zp_abelian : abelian units_Zp.
Definition Fp_idomainMixin := FieldIdomainMixin Fp_fieldMixin.