(** ** Scalar multiplication of a polynomial

  - [pscalar n p] is the polynomial [p] where all coefficients have been multiplied by [n].
*)

Definition pscalar_mon (n:nat)(m:mon) : mon :=
  (n * fst m, snd m).Definition pscalar (n:nat)(p:pol) : pol :=
  (fst p, map (pscalar_mon n) (snd p)).

(* Specifications: *)
Lemma parity_pscalar n p : parity (pscalar n p) = parity p.
Lemma pWF_pscalar : forall n p, pWF p -> pWF (pscalar n p).
Lemma pscalar_mon_correct : forall n m l, peval_mon (pscalar_mon n m) l = n * peval_mon m l.
Lemma map_pscalar_mon n ml l : plusl (map (fun m => peval_mon (pscalar_mon n m) l) ml) = n * plusl (map (fun m => peval_mon m l) ml).
Lemma pscalar_correct : forall n p l, peval (pscalar n p) l = n * peval p l.