(* "gdcop Q P" is the Greatest Divisor of P which is coprime to Q *)
(* if P null, we pose that gdcop returns 1 if Q null, 0 otherwise*)
Fixpoint gdcop_rec q p k :=
if k is m.+1 then
if coprimep p q then p
else gdcop_rec q (divp p (gcdp p q)) m
else (q == 0)%:R.
Definition gdcop q p := gdcop_rec q p (size p).
Variant gdcop_spec q p : {poly R} -> Type :=
GdcopSpec r of (dvdp r p) & ((coprimep r q) || (p == 0))
& (forall d,  dvdp d p -> coprimep d q -> dvdp d r)
: gdcop_spec q p r.

Lemma dvdp_prod_XsubC (I : Type) (r : seq I) (F : I -> R) p :
p %| \prod_(i <- r) ('X - (F i)%:P) ->
{m | p %= \prod_(i <- mask m r) ('X - (F i)%:P)}.