
theorem
  for n being Element of NAT, T being connected admissible 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, G,P being non empty Subset of
  Polynom-Ring(n,L) st G is_Groebner_basis_of P,T holds PolyRedRel(G,T) is
  Completion of PolyRedRel(P,T)
proof
  let n be Element of NAT, T be connected admissible 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, G,P be non empty Subset of Polynom-Ring(n,L);
  set R = PolyRedRel(P,T);
  assume
A1: G is_Groebner_basis_of P,T;
  then PolyRedRel(G,T) is locally-confluent;
  then reconsider RG = PolyRedRel(G,T) as complete Relation;
  for a,b being object holds a,b are_convertible_wrt R iff a,b
  are_convergent_wrt RG
  proof
    let a,b be object;
A2: G-Ideal = P by A1;
A3: now
      assume
A4:   a,b are_convertible_wrt R;
      now
        per cases;
        case
          a = b;
          hence a,b are_convergent_wrt RG by REWRITE1:38;
        end;
        case
A5:       a <> b;
          R \/ R~ reduces a,b by A4,REWRITE1:def 4;
          then consider p being RedSequence of R \/ R~ such that
A6:       p.1 = a and
A7:       p.len p = b by REWRITE1:def 3;
          reconsider l = len p - 1 as Element of NAT by INT_1:5,NAT_1:14;
A8:       1 <= len(p) by NAT_1:14;
          set h = p.l, g = p.(1+1);
          1 <= l + 1 by NAT_1:12;
          then l + 1 in Seg(len p) by FINSEQ_1:1;
          then
A9:       l + 1 in dom p by FINSEQ_1:def 3;
          now
            per cases;
            case
              len p = 1;
              hence
              a is Polynomial of n,L & b is Polynomial of n,L by A5,A6,A7;
            end;
            case
A10:          len p <> 1;
              then 0 + 1 < l + 1 by A8,XXREAL_0:1;
              then
A11:          1 <= l by NAT_1:13;
              l <= l + 1 by NAT_1:13;
              then l in Seg(len p) by A11,FINSEQ_1:1;
              then l in dom p by FINSEQ_1:def 3;
              then
A12:          [h,b] in R \/ R~ by A7,A9,REWRITE1:def 2;
A13:          now
                per cases by A12,XBOOLE_0:def 3;
                case
                  [h,b] in R;
                  then consider h9,b9 being object such that
A14:              [h,b] = [h9,b9] and
                  h9 in NonZero Polynom-Ring(n,L) and
A15:              b9 in (the carrier of Polynom-Ring(n,L)) by RELSET_1:2;
                  b = b9 by A14,XTUPLE_0:1;
                  hence b is Polynomial of n,L by A15,POLYNOM1:def 11;
                end;
                case
                  [h,b] in R~;
                  then [b,h] in R by RELAT_1:def 7;
                  then consider h9,b9 being object such that
A16:              [b,h] = [h9,b9] and
A17:              h9 in NonZero Polynom-Ring(n,L) and
                  b9 in (the carrier of Polynom-Ring(n,L)) by RELSET_1:2;
                  b = h9 by A16,XTUPLE_0:1;
                  hence b is Polynomial of n,L by A17,POLYNOM1:def 11;
                end;
              end;
              1 < len p by A8,A10,XXREAL_0:1;
              then 1 + 1 <= len p by NAT_1:13;
              then 1 + 1 in Seg(len p) by FINSEQ_1:1;
              then
A18:          1 + 1 in dom p by FINSEQ_1:def 3;
              1 in Seg(len p) by A8,FINSEQ_1:1;
              then 1 in dom p by FINSEQ_1:def 3;
              then
A19:          [a,g] in R \/ R~ by A6,A18,REWRITE1:def 2;
              now
                per cases by A19,XBOOLE_0:def 3;
                case
                  [a,g] in R;
                  then consider h9,b9 being object such that
A20:              [a,g] = [h9,b9] and
A21:              h9 in NonZero Polynom-Ring(n,L) and
                  b9 in (the carrier of Polynom-Ring(n,L)) by RELSET_1:2;
                  a = h9 by A20,XTUPLE_0:1;
                  hence a is Polynomial of n,L by A21,POLYNOM1:def 11;
                end;
                case
                  [a,g] in R~;
                  then [g,a] in R by RELAT_1:def 7;
                  then consider h9,b9 being object such that
A22:              [g,a] = [h9,b9] and
                  h9 in NonZero Polynom-Ring(n,L) and
A23:              b9 in (the carrier of Polynom-Ring(n,L)) by RELSET_1:2;
                  a = b9 by A22,XTUPLE_0:1;
                  hence a is Polynomial of n,L by A23,POLYNOM1:def 11;
                end;
              end;
              hence a is Polynomial of n, L & b is Polynomial of n,L by A13;
            end;
          end;
          then reconsider a9 = a, b9 = b as Element of Polynom-Ring(n,L) by
POLYNOM1:def 11;
          reconsider a9,b9 as Element of Polynom-Ring(n,L);
          G-Ideal = P-Ideal by A2,IDEAL_1:44;
          then a9,b9 are_congruent_mod G-Ideal by A4,POLYRED:57;
          then a9,b9 are_convertible_wrt RG by POLYRED:58;
          hence a,b are_convergent_wrt RG by REWRITE1:def 23;
        end;
      end;
      hence a,b are_convergent_wrt RG;
    end;
    now
      assume
A24:  a,b are_convergent_wrt RG;
      now
        per cases;
        case
          a = b;
          hence a,b are_convertible_wrt R by REWRITE1:26;
        end;
        case
A25:      a <> b;
          consider c being object such that
A26:      RG reduces a,c and
A27:      RG reduces b,c by A24,REWRITE1:def 7;
          a is Polynomial of n,L & b is Polynomial of n,L
          proof
            now
              per cases;
              case
                a = c;
                hence thesis by A25,A27,Lm6;
              end;
              case
A28:            a <> c;
                now
                  per cases;
                  case
                    b = c;
                    hence thesis by A25,A26,Lm6;
                  end;
                  case
                    b <> c;
                    hence b is Polynomial of n,L by A27,Lm6;
                  end;
                end;
                hence thesis by A26,A28,Lm6;
              end;
            end;
            hence thesis;
          end;
          then reconsider
          a9 = a, b9 = b as Element of the carrier of Polynom-Ring(
          n,L) by POLYNOM1:def 11;
          reconsider a9,b9 as Element of Polynom-Ring(n,L);
          G-Ideal = P-Ideal & a9,b9 are_convertible_wrt RG by A2,A24,IDEAL_1:44
,REWRITE1:37;
          then a9,b9 are_congruent_mod P-Ideal by POLYRED:57;
          hence a,b are_convertible_wrt R by POLYRED:58;
        end;
      end;
      hence a,b are_convertible_wrt R;
    end;
    hence thesis by A3;
  end;
  hence thesis by REWRITE1:def 28;
end;
