Definition lift (p : {poly F}) := map GRing.Const p.

(* Specifications: *)
Lemma eval_lift (e : seq F) (p : {poly F}) : eval_poly e (lift p) = p.
Fixpoint lead_coefT p : cps tF :=
if p is c :: q then
'let l <- lead_coefT q; 'if (l == 0) then c else l
else ret 0%T.
Lemma lead_coefTP (k : tF -> fF) :
(forall x e, qf_eval e (k x) = qf_eval e (k (eval e x)%:T%T)) ->
forall (p : polyF) (e : seq F),
qf_eval e (lead_coefT p k) = qf_eval e (k (lead_coef (eval_poly e p))%:T%T).
Lemma lead_coefT_qf (p : polyF) : rpoly p -> qf_cps (@rterm _) (lead_coefT p).
Fixpoint amulXnT (a : tF) (n : nat) : polyF :=
if n is n'.+1 then 0%T :: (amulXnT a n') else [:: a].
Lemma eval_amulXnT  (a : tF) (n : nat) (e : seq F) :
eval_poly e (amulXnT a n) = (eval e a)%:P * 'X^n.
Lemma ramulXnT: forall a n, rterm a -> rpoly (amulXnT a n).
Lemma rsumpT (p q : polyF) : rpoly p -> rpoly q -> rpoly (sumpT p q).
Fixpoint mulpT (p q : polyF) :=
if p isn't a :: p then [::]
else sumpT [seq (a * x)%T | x <- q] (0%T :: mulpT p q).
Lemma eval_mulpT (p q : polyF) (e : seq F) :
eval_poly e (mulpT p q) = (eval_poly e p) * (eval_poly e q).
Lemma rpoly_map_mul (t : tF) (p : polyF) (rt : rterm t) :
rpoly [seq (t * x)%T | x <- p] = rpoly p.
Lemma rmulpT (p q : polyF) : rpoly p -> rpoly q -> rpoly (mulpT p q).
Definition opppT : polyF -> polyF := map (GRing.Mul (- 1%T)%T).
Lemma eval_opppT (p : polyF) (e : seq F) :
eval_poly e (opppT p) = - eval_poly e p.