(* This code is copyrighted by its authors; it is distributed under  *)
(* the terms of the LGPL license (see LICENSE and description files) *)
Require Export Pspoly.
Require Export Pmult.
Section crit.
Load "hCoefStructure".
Load "hOrderStructure".
Load "hSpoly".
Load "hMult".
Definition Rminus :
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) -> list (Term A n).
intros a nZa p q r; elim r; clear r.
exact p.
intros b r Rec;
exact
(minuspf A A0 A1 eqA invA minusA multA eqA_dec n ltM ltM_dec Rec
(mults (A:=A) multA (n:=n)
(divTerm (A:=A) (A0:=A0) (eqA:=eqA) divA (n:=n) b (b:=a) nZa) q)).
Defined.

(* Specifications: *)
Theorem minuspf_in :
forall (p q : list (Term A n)) (a b : Term A n),
In a p ->
ltT ltM b a ->
canonical A0 eqA ltM p ->
canonical A0 eqA ltM (pX b q) ->
In a
(minuspf A A0 A1 eqA invA minusA multA eqA_dec n ltM ltM_dec p (pX b q)).