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.
intros Q p H'; elim H'; auto.
intros a p0 q s H'0 H'1 H'2 H'3 H'4.
apply
eqp_imp_canonical
with
(p := pluspf (A:=A) A0 (eqA:=eqA) plusA eqA_dec (n:=n) (ltM:=ltM) ltM_dec
(mults (A:=A) multA (n:=n) a q) p0)
(1 := cs); auto.
apply (eqp_sym _ _ _ _ _ _ _ _ _ cs n); auto.
apply canonical_pluspf; auto.
apply canonical_mults with (1 := cs); auto.
apply inPolySet_imp_canonical with (L := Q); auto.
Qed.

Theorem CombLinear_comp :
forall (Q : list (poly A0 eqA ltM)) (p : list (Term A n)),
CombLinear Q p ->
forall q : list (Term A n),
canonical A0 eqA ltM q -> eqP A eqA n p q -> CombLinear Q q.