Definition Dmult :
  forall (a : Term A n) (nZa : ~ zeroP (A:=A) A0 eqA (n:=n) a),
  list (Term A n) -> list (Term A n) -> list (Term A n).

(* Specifications: *)
Theorem canonical_Dmult : forall (a : Term A n) (nZa : ~ zeroP (A:=A) A0 eqA (n:=n) a) (p q : list (Term A n)), canonical A0 eqA ltM p -> canonical A0 eqA ltM q -> canonical A0 eqA ltM (Dmult a nZa p q).
Theorem divp_is_multTerm : forall (a b : Term A n) (nZb : ~ zeroP (A:=A) A0 eqA (n:=n) b), divP A A0 eqA multA divA n a b -> forall p : list (Term A n), canonical A0 eqA ltM p -> eqP A eqA n (mults (A:=A) multA (n:=n) (divTerm (A:=A) (A0:=A0) (eqA:=eqA) divA (n:=n) a (b:=b) nZb) p) (divpf b nZb (mults (A:=A) multA (n:=n) a p)).
Theorem Rminus_is_mult : forall (r p q : list (Term A n)) (a : Term A n) (nZa : ~ zeroP (A:=A) A0 eqA (n:=n) a), canonical A0 eqA ltM p -> canonical A0 eqA ltM q -> canonical A0 eqA ltM r -> divPp a r -> eqP A eqA n (Rminus a nZa p q r) (minuspf A A0 A1 eqA invA minusA multA eqA_dec n ltM ltM_dec p (Dmult a nZa r q)).
Theorem divpf_comp : forall (a b : Term A n) (p q : list (Term A n)), eqP A eqA n p q -> canonical A0 eqA ltM p -> canonical A0 eqA ltM q -> eqTerm (A:=A) eqA (n:=n) a b -> forall (nZa : ~ zeroP (A:=A) A0 eqA (n:=n) a) (nZb : ~ zeroP (A:=A) A0 eqA (n:=n) b), eqP A eqA n (divpf a nZa p) (divpf b nZb q).
Theorem Dmult_is_mulpf : forall (a : Term A n) (nZa : ~ zeroP (A:=A) A0 eqA (n:=n) a) (p q : list (Term A n)), canonical A0 eqA ltM p -> canonical A0 eqA ltM q -> eqP A eqA n (Dmult a nZa (mults (A:=A) multA (n:=n) a p) q) (multpf A A0 eqA plusA multA eqA_dec n ltM ltM_dec p q).
Theorem sp_Rminus : forall (a b : Term A n) (nZb : ~ zeroP (A:=A) A0 eqA (n:=n) b) (p q : list (Term A n)), canonical A0 eqA ltM (pX a p) -> canonical A0 eqA ltM (pX b q) -> eqP A eqA n (Rminus b nZb (minuspf A A0 A1 eqA invA minusA multA eqA_dec n ltM ltM_dec (mults (A:=A) multA (n:=n) b p) (mults (A:=A) multA (n:=n) a q)) (pX b q) (mults (A:=A) multA (n:=n) b p)) (mults (A:=A) multA (n:=n) (invTerm (A:=A) invA (n:=n) (T1 A1 n)) (multpf A A0 eqA plusA multA eqA_dec n ltM ltM_dec (pX a p) q)).
Theorem minuspf_spoly_in : forall (a b : Term A n) (nZa : ~ zeroP (A:=A) A0 eqA (n:=n) a) (nZb : ~ zeroP (A:=A) A0 eqA (n:=n) b), eqT (ppc (A:=A) A1 (n:=n) a b) (multTerm (A:=A) multA (n:=n) a b) -> forall p q : list (Term A n), canonical A0 eqA ltM p -> canonical A0 eqA ltM q -> (forall c : Term A n, In c p -> ltT ltM c (multTerm (A:=A) multA (n:=n) a b) /\ eqT c (multTerm (A:=A) multA (n:=n) (divTerm (A:=A) (A0:=A0) (eqA:=eqA) divA (n:=n) c (b:=b) nZb) b)) -> (forall c : Term A n, In c q -> ltT ltM c (multTerm (A:=A) multA (n:=n) a b) /\ eqT c (multTerm (A:=A) multA (n:=n) (divTerm (A:=A) (A0:=A0) (eqA:=eqA) divA (n:=n) c (b:=a) nZa) a)) -> forall c : Term A n, In c p -> In c (minuspf A A0 A1 eqA invA minusA multA eqA_dec n ltM ltM_dec p q).
Theorem multTerm_or_z_d1 : forall (a b : Term A n) (nZb : ~ zeroP (A:=A) A0 eqA (n:=n) b) (p : list (Term A n)), canonical A0 eqA ltM (pX a p) -> forall c : Term A n, In c (mults (A:=A) multA (n:=n) b p) -> ltT ltM c (multTerm (A:=A) multA (n:=n) a b) /\ eqT c (multTerm (A:=A) multA (n:=n) (divTerm (A:=A) (A0:=A0) (eqA:=eqA) divA (n:=n) c (b:=b) nZb) b).
Theorem multTerm_or_z_d2 : forall (a b : Term A n) (nZb : ~ zeroP (A:=A) A0 eqA (n:=n) b) (p : list (Term A n)), canonical A0 eqA ltM (pX a p) -> forall c : Term A n, In c (mults (A:=A) multA (n:=n) b p) -> ltT ltM c (multTerm (A:=A) multA (n:=n) b a) /\ eqT c (multTerm (A:=A) multA (n:=n) (divTerm (A:=A) (A0:=A0) (eqA:=eqA) divA (n:=n) c (b:=b) nZb) b).
Theorem in_minuspf_spoly_in : forall a b : Term A n, eqT (ppc (A:=A) A1 (n:=n) a b) (multTerm (A:=A) multA (n:=n) a b) -> forall p q : list (Term A n), canonical A0 eqA ltM (pX a p) -> canonical A0 eqA ltM (pX b q) -> forall c : Term A n, In c (mults (A:=A) multA (n:=n) b p) -> In c (minuspf A A0 A1 eqA invA minusA multA eqA_dec n ltM ltM_dec (mults (A:=A) multA (n:=n) b p) (mults (A:=A) multA (n:=n) a q)).
Theorem divPp_mults1 : forall a : Term A n, ~ zeroP (A:=A) A0 eqA (n:=n) a -> forall p : list (Term A n), (forall b : Term A n, In b p -> ~ zeroP (A:=A) A0 eqA (n:=n) b) -> divPp a (mults (A:=A) multA (n:=n) a p).
Theorem spoly_Reduce : forall (Q : list (poly A0 eqA ltM)) (a b : Term A n), eqT (ppc (A:=A) A1 (n:=n) a b) (multTerm (A:=A) multA (n:=n) a b) -> forall p q : list (Term A n), inPolySet A A0 eqA n ltM (pX b q) Q -> canonical A0 eqA ltM (pX a p) -> reduceplus A A0 A1 eqA invA minusA multA divA eqA_dec n ltM ltM_dec Q (minuspf A A0 A1 eqA invA minusA multA eqA_dec n ltM ltM_dec (mults (A:=A) multA (n:=n) b p) (mults (A:=A) multA (n:=n) a q)) (mults (A:=A) multA (n:=n) (invTerm (A:=A) invA (n:=n) (T1 A1 n)) (multpf A A0 eqA plusA multA eqA_dec n ltM ltM_dec (pX a p) q)).
Theorem spoly_reduceplus_pO : forall (Q : list (poly A0 eqA ltM)) (p q : list (Term A n)), inPolySet A A0 eqA n ltM q Q -> canonical A0 eqA ltM p -> reduceplus A A0 A1 eqA invA minusA multA divA eqA_dec n ltM ltM_dec Q (multpf A A0 eqA plusA multA eqA_dec n ltM ltM_dec p q) (pO A n).
Theorem fspoly_Reduceplus_pO : forall (Q : list (poly A0 eqA ltM)) (a b : Term A n), eqT (ppc (A:=A) A1 (n:=n) a b) (multTerm (A:=A) multA (n:=n) a b) -> forall p q : list (Term A n), inPolySet A A0 eqA n ltM (pX b q) Q -> inPolySet A A0 eqA n ltM (pX a p) Q -> reduceplus A A0 A1 eqA invA minusA multA divA eqA_dec n ltM ltM_dec Q (minuspf A A0 A1 eqA invA minusA multA eqA_dec n ltM ltM_dec (mults (A:=A) multA (n:=n) b p) (mults (A:=A) multA (n:=n) a q)) (pO A n).
Theorem spoly_Reducestar_pO : forall (Q : list (poly A0 eqA ltM)) (a b : Term A n), eqT (ppc (A:=A) A1 (n:=n) a b) (multTerm (A:=A) multA (n:=n) a b) -> forall (p q : list (Term A n)) (Cpxb : canonical A0 eqA ltM (pX b q)) (Cpxa : canonical A0 eqA ltM (pX a p)), inPolySet A A0 eqA n ltM (pX b q) Q -> inPolySet A A0 eqA n ltM (pX a p) Q -> reduceplus A A0 A1 eqA invA minusA multA divA eqA_dec n ltM ltM_dec Q (spolyf A A0 A1 eqA invA minusA multA divA eqA_dec n ltM ltM_dec (pX a p) (pX b q) Cpxa Cpxb) (pO A n).
Theorem spoly_Reducestar_ppc : forall (Q : list (poly A0 eqA ltM)) (a b : Term A n), eqT (ppc (A:=A) A1 (n:=n) a b) (multTerm (A:=A) multA (n:=n) a b) -> forall (p q : list (Term A n)) (Cpxb : canonical A0 eqA ltM (pX b q)) (Cpxa : canonical A0 eqA ltM (pX a p)), inPolySet A A0 eqA n ltM (pX b q) Q -> inPolySet A A0 eqA n ltM (pX a p) Q -> reducestar A A0 A1 eqA invA minusA multA divA eqA_dec n ltM ltM_dec Q (spolyf A A0 A1 eqA invA minusA multA divA eqA_dec n ltM ltM_dec (pX a p) (pX b q) Cpxa Cpxb) (pO A n).