Inductive Spoly_1 (Q : list (poly A0 eqA ltM)) :
list (Term A n) -> list (Term A n) -> Prop :=
  | Spoly_10 :
      forall (p q : list (Term A n)) (Cp : canonical A0 eqA ltM p)
        (Cq : canonical A0 eqA ltM q),
      reducestar A A0 A1 eqA invA minusA multA divA eqA_dec n ltM ltM_dec Q
        (spolyf p q Cp Cq) (pO A n) -> Spoly_1 Q p q
  | Spoly_11 :
      forall (b c d : Term A n) (q r r0 s0 t : list (Term A n)),
      Spoly_1 Q (pX c r) (pX d t) ->
      Spoly_1 Q (pX d t) (pX b q) ->
      inPolySet A A0 eqA n ltM (pX d t) Q ->
      divP A A0 eqA multA divA n (ppc (A:=A) A1 (n:=n) c b) d ->
      Spoly_1 Q (pX c r) (pX b q).Inductive Spoly_1 (Q : list (poly A0 eqA ltM)) :
list (Term A n) -> list (Term A n) -> Prop :=
  | Spoly_10 :
      forall (p q : list (Term A n)) (Cp : canonical A0 eqA ltM p)
        (Cq : canonical A0 eqA ltM q),
      reducestar A A0 A1 eqA invA minusA multA divA eqA_dec n ltM ltM_dec Q
        (spolyf p q Cp Cq) (pO A n) -> Spoly_1 Q p q
  | Spoly_11 :
      forall (b c d : Term A n) (q r r0 s0 t : list (Term A n)),
      Spoly_1 Q (pX c r) (pX d t) ->
      Spoly_1 Q (pX d t) (pX b q) ->
      inPolySet A A0 eqA n ltM (pX d t) Q ->
      divP A A0 eqA multA divA n (ppc (A:=A) A1 (n:=n) c b) d ->
      Spoly_1 Q (pX c r) (pX b q).Inductive Spoly_1 (Q : list (poly A0 eqA ltM)) :
list (Term A n) -> list (Term A n) -> Prop :=
  | Spoly_10 :
      forall (p q : list (Term A n)) (Cp : canonical A0 eqA ltM p)
        (Cq : canonical A0 eqA ltM q),
      reducestar A A0 A1 eqA invA minusA multA divA eqA_dec n ltM ltM_dec Q
        (spolyf p q Cp Cq) (pO A n) -> Spoly_1 Q p q
  | Spoly_11 :
      forall (b c d : Term A n) (q r r0 s0 t : list (Term A n)),
      Spoly_1 Q (pX c r) (pX d t) ->
      Spoly_1 Q (pX d t) (pX b q) ->
      inPolySet A A0 eqA n ltM (pX d t) Q ->
      divP A A0 eqA multA divA n (ppc (A:=A) A1 (n:=n) c b) d ->
      Spoly_1 Q (pX c r) (pX b q).Inductive SpolyQ (Q : list (poly A0 eqA ltM)) : Prop :=
    SpolyQ0 :
      (forall p q : list (Term A n),
       inPolySet A A0 eqA n ltM p Q ->
       canonical A0 eqA ltM p ->
       inPolySet A A0 eqA n ltM q Q ->
       canonical A0 eqA ltM q -> Spoly_1 Q p q) -> 
      SpolyQ Q.Inductive SpolyQ (Q : list (poly A0 eqA ltM)) : Prop :=
    SpolyQ0 :
      (forall p q : list (Term A n),
       inPolySet A A0 eqA n ltM p Q ->
       canonical A0 eqA ltM p ->
       inPolySet A A0 eqA n ltM q Q ->
       canonical A0 eqA ltM q -> Spoly_1 Q p q) -> 
      SpolyQ Q.Inductive Reducep (Q : list (poly A0 eqA ltM)) :
list (Term A n) -> list (Term A n) -> list (Term A n) -> Prop :=
    Reducep0 :
      forall (a b c : Term A n) (nZb : ~ zeroP (A:=A) A0 eqA (n:=n) b)
        (nZc : ~ zeroP (A:=A) A0 eqA (n:=n) c) (p q r : list (Term A n)),
      reduce A A0 A1 eqA invA minusA multA divA eqA_dec n ltM ltM_dec Q
        (pX a p)
        (spminusf A A0 A1 eqA invA minusA multA divA eqA_dec n ltM ltM_dec a
           b nZb p q) ->
      reduce A A0 A1 eqA invA minusA multA divA eqA_dec n ltM ltM_dec Q
        (pX a p)
        (spminusf A A0 A1 eqA invA minusA multA divA eqA_dec n ltM ltM_dec a
           c nZc p r) ->
      divP A A0 eqA multA divA n a b ->
      inPolySet A A0 eqA n ltM (pX b q) Q ->
      divP A A0 eqA multA divA n a c ->
      inPolySet A A0 eqA n ltM (pX c r) Q ->
      Reducep Q (pX a p) (pX b q) (pX c r).Inductive Reducep (Q : list (poly A0 eqA ltM)) :
list (Term A n) -> list (Term A n) -> list (Term A n) -> Prop :=
    Reducep0 :
      forall (a b c : Term A n) (nZb : ~ zeroP (A:=A) A0 eqA (n:=n) b)
        (nZc : ~ zeroP (A:=A) A0 eqA (n:=n) c) (p q r : list (Term A n)),
      reduce A A0 A1 eqA invA minusA multA divA eqA_dec n ltM ltM_dec Q
        (pX a p)
        (spminusf A A0 A1 eqA invA minusA multA divA eqA_dec n ltM ltM_dec a
           b nZb p q) ->
      reduce A A0 A1 eqA invA minusA multA divA eqA_dec n ltM ltM_dec Q
        (pX a p)
        (spminusf A A0 A1 eqA invA minusA multA divA eqA_dec n ltM ltM_dec a
           c nZc p r) ->
      divP A A0 eqA multA divA n a b ->
      inPolySet A A0 eqA n ltM (pX b q) Q ->
      divP A A0 eqA multA divA n a c ->
      inPolySet A A0 eqA n ltM (pX c r) Q ->
      Reducep Q (pX a p) (pX b q) (pX c r).Inductive Confluent (Q : list (poly A0 eqA ltM)) :
list (Term A n) -> list (Term A n) -> list (Term A n) -> Prop :=
    Confluent0 :
      forall (a b c : Term A n) (nZb : ~ zeroP (A:=A) A0 eqA (n:=n) b)
        (nZc : ~ zeroP (A:=A) A0 eqA (n:=n) c) (p q r : list (Term A n)),
      (forall r1 s1 : list (Term A n),
       reducestar A A0 A1 eqA invA minusA multA divA eqA_dec n ltM ltM_dec Q
         (spminusf A A0 A1 eqA invA minusA multA divA eqA_dec n ltM ltM_dec a
            b nZb p q) r1 ->
       reducestar A A0 A1 eqA invA minusA multA divA eqA_dec n ltM ltM_dec Q
         (spminusf A A0 A1 eqA invA minusA multA divA eqA_dec n ltM ltM_dec a
            c nZc p r) s1 -> eqP A eqA n r1 s1) ->
      Confluent Q (pX a p) (pX b q) (pX c r).Inductive Confluent (Q : list (poly A0 eqA ltM)) :
list (Term A n) -> list (Term A n) -> list (Term A n) -> Prop :=
    Confluent0 :
      forall (a b c : Term A n) (nZb : ~ zeroP (A:=A) A0 eqA (n:=n) b)
        (nZc : ~ zeroP (A:=A) A0 eqA (n:=n) c) (p q r : list (Term A n)),
      (forall r1 s1 : list (Term A n),
       reducestar A A0 A1 eqA invA minusA multA divA eqA_dec n ltM ltM_dec Q
         (spminusf A A0 A1 eqA invA minusA multA divA eqA_dec n ltM ltM_dec a
            b nZb p q) r1 ->
       reducestar A A0 A1 eqA invA minusA multA divA eqA_dec n ltM ltM_dec Q
         (spminusf A A0 A1 eqA invA minusA multA divA eqA_dec n ltM ltM_dec a
            c nZc p r) s1 -> eqP A eqA n r1 s1) ->
      Confluent Q (pX a p) (pX b q) (pX c r).

Theorem confl_restar : forall Q : list (poly A0 eqA ltM), SpolyQ Q -> forall p : poly A0 eqA ltM, ReduStarConfluent Q (s2p A A0 eqA n ltM p).