
theorem :: lemma 5.26, p. 202
  for n being Nat, T being admissible connected TermOrder of n, L being
  Abelian add-associative right_complementable right_zeroed commutative
  associative well-unital distributive almost_left_invertible non degenerated
  non empty doubleLoopStr, P being non empty Subset of Polynom-Ring(n,L), f,g
being Element of Polynom-Ring(n,L) holds f,g are_congruent_mod P-Ideal implies
  f,g are_convertible_wrt PolyRedRel(P,T)
proof
  let n be Nat, T be admissible connected TermOrder of n, L be Abelian
  add-associative right_complementable right_zeroed commutative associative
  well-unital distributive almost_left_invertible non degenerated non empty
  doubleLoopStr, P be non empty Subset of Polynom-Ring(n,L), f,g be Element of
  Polynom-Ring(n,L);
  set PR = Polynom-Ring(n,L);
  defpred P[Nat] means for f,g being Element of Polynom-Ring(n,L), p being
  LeftLinearCombination of P st Sum p = g - f & len p = $1 holds f,g
  are_convertible_wrt PolyRedRel(P,T);
  now
    let k be Nat;
    assume
A1: P[k];
    now
      let f,g be Element of Polynom-Ring(n,L), p be LeftLinearCombination of P;
      assume that
A2:   Sum p = g - f and
A3:   len p = k + 1;
      now
        set h = f + p/.(k+1);
        set q = p|(Seg k);
        reconsider q as FinSequence by FINSEQ_1:15;
        dom p = Seg(k+1) by A3,FINSEQ_1:def 3;
        then consider u being Element of PR,a being Element of P such that
A4:     p/.(k+1) = u*a by FINSEQ_1:4,IDEAL_1:def 9;
        reconsider u9 = u, a9 = a as Element of PR;
        reconsider u9,a9 as Polynomial of n,L by POLYNOM1:def 11;
A5:     p/.(k+1) = u9 *' a9 by A4,POLYNOM1:def 11;
        k <= k+1 by NAT_1:11;
        then
A6:     len q = k by A3,FINSEQ_1:17;
        reconsider q as LeftLinearCombination of P by IDEAL_1:42;
A7:     Sum p = Sum q + p/.(k+1) by A3,Lm6;
        then Sum p - p/.(k+1) = (Sum q + p/.(k+1)) + -(p/.(k+1))
          .= Sum q + (p/.(k+1) + -(p/.(k+1))) by RLVECT_1:def 3
          .= Sum q + 0.PR by RLVECT_1:5
          .= Sum q by RLVECT_1:4;
        then Sum q = (g - f) + -(p/.(k+1)) by A2
          .= (g + -f) + -(p/.(k+1))
          .= g + (-f + -(p/.(k+1))) by RLVECT_1:def 3
          .= g + -h by RLVECT_1:31
          .= g - h;
        then
A8:     h,g are_convertible_wrt PolyRedRel(P,T) by A1,A6;
        now
          per cases;
          case
            a <> 0_(n,L) & u <> 0_(n,L);
            then f,h are_convertible_wrt PolyRedRel(P,T) by A4,Lm20;
            hence f,g are_convertible_wrt PolyRedRel(P,T) by A8,REWRITE1:30;
          end;
          case
A9:         a = 0_(n,L) or u = 0_(n,L);
            reconsider sumq = Sum q as Polynomial of n,L by POLYNOM1:def 11;
            now
              per cases by A9;
              case
                a = 0_(n,L);
                hence p/.(k+1) = 0_(n,L) by A5,POLYNOM1:28;
              end;
              case
                u = 0_(n,L);
                hence p/.(k+1) = 0_(n,L) by A5,Th5;
              end;
            end;
            then Sum p = sumq + 0_(n,L) by A7,POLYNOM1:def 11
              .= Sum q by POLYNOM1:23;
            hence f,g are_convertible_wrt PolyRedRel(P,T) by A1,A2,A6;
          end;
        end;
        hence f,g are_convertible_wrt PolyRedRel(P,T);
      end;
      hence f,g are_convertible_wrt PolyRedRel(P,T);
    end;
    hence P[k+1];
  end;
  then
A10: for k being Nat holds P[k] implies P[k+1];
A11: P[0]
  proof
    let f,g be Element of Polynom-Ring(n,L), p be LeftLinearCombination of P;
    assume that
A12: Sum p = g - f and
A13: len p = 0;
    p = <*>(the carrier of PR) by A13;
    then Sum p = 0.PR by RLVECT_1:43;
    then f = g by A12,RLVECT_1:21;
    hence thesis by REWRITE1:26;
  end;
A14: for k being Nat holds P[k] from NAT_1:sch 2(A11,A10);
  assume f,g are_congruent_mod P-Ideal;
  then g,f are_congruent_mod P-Ideal by Th53;
  then g - f in P-Ideal;
  then g - f in P-LeftIdeal by IDEAL_1:63;
  then consider p being LeftLinearCombination of P such that
A15: Sum p = g - f by IDEAL_1:61;
  ex k being Nat st len p = k;
  hence thesis by A14,A15;
end;
