Section BuchRed.
Load "hCoefStructure".
Load "hOrderStructure".
Load "hBuch".
intros L p q H; apply Cb_incl with (1 := cs) (P := addEnd A A0 eqA n ltM p L);
auto.
elim L; simpl in |- *; auto.
intros a l H0 a0 H1; elim H1; clear H1; intros H1; auto.
case (H0 a0); auto.
Qed.
intros L p q H; apply Cb_incl with (1 := cs) (P := p :: L); auto.
elim L; simpl in |- *; auto.
intros a l H0 a0 H1; elim H1; clear H1; intros H1; auto.
case H1; auto.
Qed.
intros L p q H H0.
apply Cb_trans with (1 := cs) (b := p); auto.
apply Cb_cons_addEnd; auto.
Qed.
intros p L; unfold nf, LetP in |- *; auto.
case
(Reducef A A0 A1 eqA plusA invA minusA multA divA cs eqA_dec n ltM ltM_dec
os L p); simpl in |- *; auto.
intros x0; case x0; simpl in |- *.
intros x c H'.
change
(CombLinear A A0 eqA plusA multA eqA_dec n ltM ltM_dec
(p :: L)
(mults (A:=A) multA (n:=n)
(unit A A0 A1 eqA divA n ltM (mks A A0 eqA n ltM x c)) x))
in |- *.
apply CombLinear_mults1 with (1 := cs); auto.
apply unit_nZ with (1 := cs); auto.
apply reducestar_cb1 with (1 := cs); auto.
Qed.
intros L1 L2 H' q; case q; simpl in |- *.
intros x H'0 H'1.
apply CombLinear_compo with (1 := cs) (L1 := L1); auto.
intros q0 H'2.
case inPolySet_inv1 with (1 := H'2); auto.
intros q1 H; elim H; intros H0 H1; clear H.
lapply (H' q1); [ intros H'6 | idtac ]; auto.
generalize H'6 H1; case q1; simpl in |- *; auto.
intros x0 H'5 H'7 H'8; rewrite H'8; auto.
Defined.
intros p L; unfold nf in |- *.
case
(Reducef A A0 A1 eqA plusA invA minusA multA divA cs eqA_dec n ltM ltM_dec
os L p); auto.
case p.
unfold LetP in |- *; intros x H' x0; case x0; simpl in |- *.
intros x1 c H'0.
change
(CombLinear A A0 eqA plusA multA eqA_dec n ltM ltM_dec
(mks A A0 eqA n ltM
(mults (A:=A) multA (n:=n)
(unit A A0 A1 eqA divA n ltM (mks A A0 eqA n ltM x1 c)) x1)
(canonical_mults A A0 A1 eqA plusA invA minusA multA divA cs eqA_dec
n ltM os (unit A A0 A1 eqA divA n ltM (mks A A0 eqA n ltM x1 c))
x1
(unit_nZ A A0 A1 eqA plusA invA minusA multA divA cs n ltM
(mks A A0 eqA n ltM x1 c)) c) :: L) x)
in |- *.
apply CombLinear_compo with (1 := cs) (L1 := mks A A0 eqA n ltM x1 c :: L);
auto.
change
(CombLinear A A0 eqA plusA multA eqA_dec n ltM ltM_dec
(mks A A0 eqA n ltM x1 c :: L)
(s2p A A0 eqA n ltM (mks A A0 eqA n ltM x H')))
in |- *.
apply reducestar_cb2 with (1 := cs); auto.
intros q H'1; inversion H'1; auto.
2: apply CombLinear_id with (1 := cs); auto.
2: apply inskip; auto.
generalize c H2; case x1; auto.
intros c0 H'2; inversion H'2.
intros a0 l c0 H'2.
cut
(~
zeroP (A:=A) A0 eqA (n:=n)
(unit A A0 A1 eqA divA n ltM (mks A A0 eqA n ltM (a0 :: l) c0)));
[ intros nZu | idtac ]; auto.
apply
CombLinear_1
with
(a := divTerm (A:=A) (A0:=A0) (eqA:=eqA) divA (n:=n)
(T1 A1 n)
(b:=unit A A0 A1 eqA divA n ltM (mks A A0 eqA n ltM (pX a0 l) c0))
nZu)
(p := pO A n)
(q := mults (A:=A) multA (n:=n)
(unit A A0 A1 eqA divA n ltM (mks A A0 eqA n ltM (pX a0 l) c0))
(pX a0 l)); auto.
simpl in |- *; auto.
change
(inPolySet A A0 eqA n ltM
(pX
(multTerm (A:=A) multA (n:=n)
(unit A A0 A1 eqA divA n ltM (mks A A0 eqA n ltM (pX a0 l) c0)) a0)
(mults (A:=A) multA (n:=n)
(unit A A0 A1 eqA divA n ltM (mks A A0 eqA n ltM (pX a0 l) c0)) l))
(exist (fun a1 => canonical A0 eqA ltM a1)
(pX
(multTerm (A:=A) multA (n:=n)
(unit A A0 A1 eqA divA n ltM (mks A A0 eqA n ltM (a0 :: l) c0))
a0)
(mults (A:=A) multA (n:=n)
(unit A A0 A1 eqA divA n ltM (mks A A0 eqA n ltM (a0 :: l) c0))
l))
(canonical_mults A A0 A1 eqA plusA invA minusA multA divA cs eqA_dec
n ltM os
(unit A A0 A1 eqA divA n ltM (mks A A0 eqA n ltM (pX a0 l) c0))
(pX a0 l)
(unit_nZ _ _ _ _ _ _ _ _ _ cs _ ltM
(mks A A0 eqA n ltM (pX a0 l) c0)) c0) :: L))
in |- *.
apply incons; auto.
apply CombLinear_0; auto.
apply
(eqp_trans _ _ _ _ _ _ _ _ _ cs n)
with
(y := mults (A:=A) multA (n:=n)
(divTerm (A:=A) (A0:=A0) (eqA:=eqA) divA (n:=n)
(T1 A1 n)
(b:=unit A A0 A1 eqA divA n ltM
(mks A A0 eqA n ltM (a0 :: l) c0)) nZu)
(mults (A:=A) multA (n:=n)
(unit A A0 A1 eqA divA n ltM (mks A A0 eqA n ltM (a0 :: l) c0))
(a0 :: l))); auto.
2: apply (eqp_sym _ _ _ _ _ _ _ _ _ cs n); auto.
apply
(eqp_trans _ _ _ _ _ _ _ _ _ cs n)
with
(y := mults (A:=A) multA (n:=n)
(multTerm (A:=A) multA (n:=n)
(divTerm (A:=A) (A0:=A0) (eqA:=eqA) divA (n:=n)
(T1 A1 n)
(b:=unit A A0 A1 eqA divA n ltM
(mks A A0 eqA n ltM (a0 :: l) c0)) nZu)
(unit A A0 A1 eqA divA n ltM (mks A A0 eqA n ltM (a0 :: l) c0)))
(a0 :: l)); auto.
apply
(eqp_trans _ _ _ _ _ _ _ _ _ cs n)
with (y := mults (A:=A) multA (n:=n) (T1 A1 n) (a0 :: l));
auto.
rewrite H'2; auto.
apply (eqp_sym _ _ _ _ _ _ _ _ _ cs n); auto.
apply mults_comp with (1 := cs); auto.
apply divTerm_on_eqT with (1 := cs); auto.
apply (eqT_sym A n); auto.
apply unit_T1; auto.
apply unit_nZ with (1 := cs); auto.
Qed.
intros L p q H' H'0.
apply Cb_comp with (L1 := p :: L); auto.
simpl in |- *; auto.
intros p0 H'1; case H'1;
[ intros H'2; rewrite <- H'2; clear H'1 | intros H'2; clear H'1 ];
auto.
generalize H'; case p; simpl in |- *; auto.
intros x; case x; simpl in |- *; auto.
intros H'1 H'3; try assumption.
change (CombLinear A A0 eqA plusA multA eqA_dec n ltM ltM_dec L (pO A n))
in |- *.
apply CombLinear_0; auto.
intros a l H'1 H'3; elim H'3; auto.
apply Cb_id with (1 := cs); auto.
Qed.
intros p L1 H' L2 H'0.
apply Cb_comp with (L1 := L1); auto.
Qed.
Definition reducep (L : list (poly A0 eqA ltM)) (p q : poly A0 eqA ltM) :
Prop :=
reduce A A0 A1 eqA invA minusA multA divA eqA_dec n ltM ltM_dec L
(s2p A A0 eqA n ltM p) (s2p A A0 eqA n ltM q).
intros L H'; inversion H'; auto.
intros p H'0.
case
(Reducef A A0 A1 eqA plusA invA minusA multA divA cs eqA_dec n ltM ltM_dec
os L p).
intros x H'1; inversion H'.
lapply (H0 (s2p A A0 eqA n ltM p) (s2p A A0 eqA n ltM x));
[ intros H'4; lapply H'4; [ clear H'4 | clear H'4 ] | idtac ];
auto.
inversion H'1; auto.
inversion H1; auto.
intros H'2; left.
cut (eqP A eqA n (s2p A A0 eqA n ltM p) (pO A n)); auto.
case p; simpl in |- *; auto.
intros x1; case x1; auto.
intros a l H'3 H'4; inversion H'4.
apply (eqp_trans _ _ _ _ _ _ _ _ _ cs n) with (y := s2p A A0 eqA n ltM x);
auto.
intros H'2; right; cut (canonical A0 eqA ltM y); auto.
intros H'3; exists (mks A A0 eqA n ltM y H'3); generalize H5; case p;
simpl in |- *; auto.
apply canonical_reduce with (1 := cs) (3 := H5); auto.
generalize H'0; case p; simpl in |- *; auto.
generalize H'0; case p; simpl in |- *; auto.
Qed.
intros L H'.
apply Grobner0.
intros p q H'0 H'1.
cut (canonical A0 eqA ltM p).
intros H'2.
cut (canonical A0 eqA ltM q).
intros H'3.
elim (H' (mks A A0 eqA n ltM q H'3)); [ intros H'6 | intros H'6 | idtac ];
auto.
generalize H'3 H'6; case q; simpl in |- *; auto.
intros a l H'4 H'5; elim H'5; auto.
case H'6; intros q0 E; clear H'6.
inversion H'1.
generalize H0 E; case q0; auto.
simpl in |- *; auto.
intros x H'4 H'5 H'6;
absurd
(reduce A A0 A1 eqA invA minusA multA divA eqA_dec n ltM ltM_dec L q x);
auto.
simpl in |- *; auto.
apply reducestar_cb with (a := p) (1 := cs); auto.
inversion H'1.
apply canonical_reduceplus with (1 := cs) (3 := H); auto.
apply CombLinear_canonical with (1 := cs) (3 := H'0); auto.
Qed.

Theorem reduce_divp :
forall (p q : poly A0 eqA ltM) (Q : list (poly A0 eqA ltM)),
reduce A A0 A1 eqA invA minusA multA divA eqA_dec n ltM ltM_dec Q
(s2p A A0 eqA n ltM p) (s2p A A0 eqA n ltM q) ->
exists r : poly A0 eqA ltM,
In r (q :: Q) /\
divp A A0 eqA multA divA n ltM p r /\ ~ zerop A A0 eqA n ltM r.