Definition coprimep p q := size (gcdp p q) == 1%N.

(* Specifications: *)
Lemma coprimep_size_gcd p q : coprimep p q -> size (gcdp p q) = 1%N.
Lemma coprime1p p : coprimep 1 p.
Lemma coprimep1 p : coprimep p 1.
Lemma coprimepPn p q : p != 0 ->
reflect (exists d, (d %| gcdp p q) && ~~ (d %= 1)) (~~ coprimep p q).
Lemma coprimep_dvdl q p r : r %| q -> coprimep p q -> coprimep p r.
Lemma coprimep_dvdr  p q r :
r %| p -> coprimep p q -> coprimep r q.
Lemma coprimep_modl p q : coprimep (p %% q) q = coprimep p q.
Lemma coprimep_modr q p : coprimep q (p %% q) = coprimep q p.
Lemma eqp_coprimepr p q r : q %= r -> coprimep p q = coprimep p r.
Lemma eqp_coprimepl p q r : q %= r -> coprimep q p = coprimep r p.
Lemma egcdpP p q : p != 0 ->  q != 0 -> forall (e := egcdp p q),
[/\ size e.1 <= size q, size e.2 <= size p & gcdp p q %= e.1 * p + e.2 * q].
Lemma egcdpE p q (e := egcdp p q) : gcdp p q %= e.1 * p + e.2 * q.
Lemma Bezoutp p q : exists u, u.1 * p + u.2 * q %= (gcdp p q).
Lemma Bezout_coprimepP : forall p q,
reflect (exists u, u.1 * p + u.2 * q %= 1) (coprimep p q).
Lemma coprimep_root p q x : coprimep p q -> root p x -> q.[x] != 0.
Lemma Gauss_dvdpl p q d: coprimep d q -> (d %| p * q) = (d %| p).
Lemma Gauss_dvdpr p q d: coprimep d q -> (d %| q * p) = (d %| p).
Lemma Gauss_gcdpr p m n : coprimep p m -> gcdp p (m * n) %= gcdp p n.
Lemma Gauss_gcdpl p m n : coprimep p n -> gcdp p (m * n) %= gcdp p m.
Lemma coprimep_mull p q r: coprimep (q * r) p = (coprimep q p && coprimep r p).
Lemma coprimep_pexpl k m n : 0 < k -> coprimep (m ^+ k) n = coprimep m n.
Lemma coprimep_pexpr k m n : 0 < k -> coprimep m (n ^+ k) = coprimep m n.
Lemma gcdp_mul2r q r p : gcdp (q * p) (r * p) %= (gcdp q r * p).
Lemma divp_eq0 p q : (p %/ q == 0) = [|| p == 0, q ==0 | size p < size q].
Lemma dvdp_div_eq0 p q : q %| p -> (p %/ q == 0) = (p == 0).
Lemma Bezout_coprimepPn p q : p != 0 -> q != 0 ->
reflect (exists2 uv : {poly R} * {poly R},
(0 < size uv.1 < size q) && (0 < size uv.2 < size p) &
uv.1 * p = uv.2 * q)
(~~ (coprimep p q)).