Section BuchAux.
Load "hCoefStructure".
Load "hOrderStructure".
Load "hComb".
Definition red (a : poly A0 eqA ltM) (P : list (poly A0 eqA ltM)) :=
reducestar A A0 A1 eqA invA minusA multA divA eqA_dec n ltM ltM_dec P
(s2p A A0 eqA n ltM a) (pO A n).
Definition addEnd :
poly A0 eqA ltM -> list (poly A0 eqA ltM) -> list (poly A0 eqA ltM).
intros a H'0; elim H'0.
exact (a :: nil).
intros b L1 Rec; exact (b :: Rec).
Defined.
intros a b aL; elim aL; simpl in |- *; auto.
intros H'; case H'; [ intros H'0; rewrite <- H'0 | intros H'0; clear H' ];
auto.
intros a0 l H' H'0; case H'0;
[ intros H'1; rewrite <- H'1; clear H'0 | intros H'1; clear H'0 ];
auto.
case (H' H'1); auto.
Qed.
intros a aL; elim aL; simpl in |- *; auto.
Qed.
intros a b aL; elim aL; simpl in |- *; auto.
intros a0 l H' H'0; case H'0; auto.
Qed.
intros a P; elim P; simpl in |- *; auto.
intros a0 l H'; elim H'; auto.
Qed.
Definition spolyp : poly A0 eqA ltM -> poly A0 eqA ltM -> poly A0 eqA ltM.
intros p q; case p; case q.
intros x Cpx x0 Cpx0;
exists
(spolyf A A0 A1 eqA invA minusA multA divA eqA_dec n ltM ltM_dec x x0 Cpx
Cpx0); auto.
apply spolyf_canonical with (1 := cs); auto.
Defined.
intros a b; case a; case b; simpl in |- *.
unfold red in |- *; simpl in |- *.
intros x Cx x0 Cx0 aL H'1; inversion H'1.
cut
(canonical A0 eqA ltM
(spolyf A A0 A1 eqA invA minusA multA divA eqA_dec n ltM ltM_dec x x0 Cx
Cx0)); [ intros Op1 | apply spolyf_canonical with (1 := cs) ];
auto.
cut
(canonical A0 eqA ltM
(spolyf A A0 A1 eqA invA minusA multA divA eqA_dec n ltM ltM_dec x0 x Cx0
Cx)); [ intros Op2 | apply spolyf_canonical with (1 := cs) ];
auto.
apply reducestar0; auto.
apply
reduceplus_eqp_com
with
(1 := cs)
(p := mults (A:=A) multA (n:=n) (invTerm (A:=A) invA (n:=n) (T1 A1 n))
(spolyf A A0 A1 eqA invA minusA multA divA eqA_dec n ltM ltM_dec
x x0 Cx Cx0))
(q := mults (A:=A) multA (n:=n) (invTerm (A:=A) invA (n:=n) (T1 A1 n))
(pO A n)); auto.
apply reduceplus_mults with (1 := cs); auto.
inversion H; auto.
apply (eqp_sym _ _ _ _ _ _ _ _ _ cs n); auto.
apply spolyf_com with (1 := cs); auto.
apply (eqp_sym _ _ _ _ _ _ _ _ _ cs n); auto.
apply spolyf_com with (1 := cs); auto.
Qed.
intros Q p H' H'0.
elim
reduce0_reducestar
with
(1 := cs)
(eqA_dec := eqA_dec)
(ltM_dec := ltM_dec)
(Q := Q)
(p := pO A n); auto.
intros t E; apply reducestar0; auto.
apply pO_irreducible; auto.
Qed.
Definition spO : poly A0 eqA ltM.
exists (pO A n); simpl in |- *; auto.
Defined.
Definition sp1 : poly A0 eqA ltM.
exists (pX (A1, M1 n) nil); auto.
Defined.
Definition sgen : nat -> poly A0 eqA ltM.
intros m; exists (pX (A1, gen_mon n m) (pO A n)).
apply canonicalp1; auto.
Defined.
Definition sscal : A -> poly A0 eqA ltM -> poly A0 eqA ltM.
intros a p; case p.
intros x H'1; exists (tmults A0 multA eqA_dec (a, M1 n) x); auto.
unfold tmults in |- *; case (zeroP_dec A A0 eqA eqA_dec n (a, M1 n));
simpl in |- *; auto.
Qed.

Theorem red_cons :
forall (a : poly A0 eqA ltM) (p : list (poly A0 eqA ltM)), In a p -> red a p.