(* 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 LetP.
Local Unset Injection On Proofs.
Section Pcomb.
Load "hCoefStructure".
Load "hOrderStructure".
Load "hSpoly".
Inductive CombLinear (Q : list (poly A0 eqA ltM)) :
list (Term A n) -> Prop :=
| CombLinear_0 : CombLinear Q (pO A n)
| CombLinear_1 :
forall (a : Term A n) (p q s : list (Term A n)),
~ zeroP (A:=A) A0 eqA (n:=n) a ->
inPolySet A A0 eqA n ltM q Q ->
CombLinear Q p ->
eqP A eqA n s
(pluspf (A:=A) A0 (eqA:=eqA) plusA eqA_dec (n:=n) (ltM:=ltM) ltM_dec
(mults (A:=A) multA (n:=n) a q) p) -> CombLinear Q s.
Hint Resolve CombLinear_0 CombLinear_1.

(* Specifications: *)
Theorem CombLinear_canonical :
forall (Q : list (poly A0 eqA ltM)) (p : list (Term A n)),
CombLinear Q p -> canonical A0 eqA ltM p.