:: GROEB_1 semantic presentation

definition
let c1 be Ordinal;
let c2 be unital add-associative right_zeroed right_complementable distributive non trivial doubleLoopStr ;
let c3 be Polynomial of c1,c2;
redefine func { as {c3} -> non empty finite Subset of (Polynom-Ring a1,a2);
coherence
{c3} is non empty finite Subset of (Polynom-Ring c1,c2)
proof end;
end;

theorem Th1: :: GROEB_1:1
for b1 being Ordinal
for b2 being connected TermOrder of b1
for b3 being unital associative commutative add-associative right_zeroed right_complementable distributive Field-like non trivial doubleLoopStr
for b4, b5, b6 being Polynomial of b1,b3 st b4 reduces_to b6,b5,b2 holds
ex b7 being Monomial of b1,b3 st b6 = b4 - (b7 *' b5)
proof end;

theorem Th2: :: GROEB_1:2
for b1 being Ordinal
for b2 being connected admissible TermOrder of b1
for b3 being non empty unital associative commutative Abelian add-associative right_zeroed right_complementable distributive Field-like non degenerated doubleLoopStr
for b4, b5, b6 being Polynomial of b1,b3 st b4 reduces_to b6,b5,b2 holds
ex b7 being Monomial of b1,b3 st
( b6 = b4 - (b7 *' b5) & not HT (b7 *' b5),b2 in Support b6 & HT (b7 *' b5),b2 <= HT b4,b2,b2 )
proof end;

Lemma2: for b1 being non empty unital associative add-associative right_zeroed right_complementable distributive add-cancelable left_zeroed doubleLoopStr
for b2 being Subset of b1
for b3 being Element of b1 st b3 in b2 holds
b3 in b2 -Ideal
proof end;

Lemma3: for b1 being Ordinal
for b2 being connected admissible TermOrder of b1
for b3 being non empty unital associative commutative add-associative right_zeroed right_complementable distributive Field-like non degenerated doubleLoopStr
for b4, b5 being Polynomial of b1,b3
for b6, b7 being Element of (Polynom-Ring b1,b3) st b6 = b4 & b7 = b5 holds
b6 - b7 = b4 - b5
proof end;

Lemma4: for b1 being Ordinal
for b2 being connected TermOrder of b1
for b3 being unital associative commutative add-associative right_zeroed right_complementable distributive Field-like non trivial doubleLoopStr
for b4 being Polynomial of b1,b3 holds b4 is_irreducible_wrt 0_ b1,b3,b2
proof end;

theorem Th3: :: GROEB_1:3
for b1 being Ordinal
for b2 being connected TermOrder of b1
for b3 being unital associative commutative add-associative right_zeroed right_complementable distributive Field-like non trivial doubleLoopStr
for b4, b5 being Polynomial of b1,b3
for b6, b7 being Subset of (Polynom-Ring b1,b3) st b6 c= b7 & b4 reduces_to b5,b6,b2 holds
b4 reduces_to b5,b7,b2
proof end;

theorem Th4: :: GROEB_1:4
for b1 being Ordinal
for b2 being connected TermOrder of b1
for b3 being unital associative commutative add-associative right_zeroed right_complementable distributive Field-like non trivial doubleLoopStr
for b4, b5 being Subset of (Polynom-Ring b1,b3) st b4 c= b5 holds
PolyRedRel b4,b2 c= PolyRedRel b5,b2
proof end;

theorem Th5: :: GROEB_1:5
for b1 being Ordinal
for b2 being non empty add-associative right_zeroed right_complementable doubleLoopStr
for b3 being Polynomial of b1,b2 holds Support (- b3) = Support b3
proof end;

theorem Th6: :: GROEB_1:6
for b1 being Ordinal
for b2 being connected TermOrder of b1
for b3 being non empty unital add-associative right_zeroed right_complementable distributive non trivial doubleLoopStr
for b4 being Polynomial of b1,b3 holds HT (- b4),b2 = HT b4,b2
proof end;

theorem Th7: :: GROEB_1:7
for b1 being Ordinal
for b2 being connected admissible TermOrder of b1
for b3 being non empty unital add-associative right_zeroed right_complementable distributive non trivial doubleLoopStr
for b4, b5 being Polynomial of b1,b3 holds HT (b4 - b5),b2 <= max (HT b4,b2),(HT b5,b2),b2,b2
proof end;

theorem Th8: :: GROEB_1:8
for b1 being Ordinal
for b2 being connected admissible TermOrder of b1
for b3 being unital associative commutative add-associative right_zeroed right_complementable distributive Field-like non trivial doubleLoopStr
for b4, b5 being Polynomial of b1,b3 st Support b5 c= Support b4 holds
b5 <= b4,b2
proof end;

theorem Th9: :: GROEB_1:9
for b1 being Ordinal
for b2 being connected admissible TermOrder of b1
for b3 being non empty unital associative commutative add-associative right_zeroed right_complementable distributive Field-like non degenerated doubleLoopStr
for b4, b5 being non-zero Polynomial of b1,b3 st b4 is_reducible_wrt b5,b2 holds
HT b5,b2 <= HT b4,b2,b2
proof end;

theorem Th10: :: GROEB_1:10
for b1 being Nat
for b2 being connected admissible TermOrder of b1
for b3 being unital associative commutative Abelian add-associative right_zeroed right_complementable distributive Field-like non trivial doubleLoopStr
for b4 being Polynomial of b1,b3 holds PolyRedRel {b4},b2 is locally-confluent
proof end;

theorem Th11: :: GROEB_1:11
for b1 being Nat
for b2 being connected admissible TermOrder of b1
for b3 being non empty unital associative commutative Abelian add-associative right_zeroed right_complementable distributive Field-like non degenerated doubleLoopStr
for b4 being Subset of (Polynom-Ring b1,b3) st ex b5 being Polynomial of b1,b3 st
( b5 in b4 & b4 -Ideal = {b5} -Ideal ) holds
PolyRedRel b4,b2 is locally-confluent
proof end;

definition
let c1 be Ordinal;
let c2 be connected TermOrder of c1;
let c3 be non empty unital add-associative right_zeroed right_complementable distributive non trivial doubleLoopStr ;
let c4 be Subset of (Polynom-Ring c1,c3);
func HT c4,c2 -> Subset of (Bags a1) equals :: GROEB_1:def 1
{ (HT b1,a2) where B is Polynomial of a1,a3 : ( b1 in a4 & b1 <> 0_ a1,a3 ) } ;
coherence
{ (HT b1,c2) where B is Polynomial of c1,c3 : ( b1 in c4 & b1 <> 0_ c1,c3 ) } is Subset of (Bags c1)
proof end;
end;

:: deftheorem Def1 defines HT GROEB_1:def 1 :
for b1 being Ordinal
for b2 being connected TermOrder of b1
for b3 being non empty unital add-associative right_zeroed right_complementable distributive non trivial doubleLoopStr
for b4 being Subset of (Polynom-Ring b1,b3) holds HT b4,b2 = { (HT b5,b2) where B is Polynomial of b1,b3 : ( b5 in b4 & b5 <> 0_ b1,b3 ) } ;

definition
let c1 be Ordinal;
let c2 be Subset of (Bags c1);
func multiples c2 -> Subset of (Bags a1) equals :: GROEB_1:def 2
{ b1 where B is Element of Bags a1 : ex b1 being bag of a1 st
( b2 in a2 & b2 divides b1 )
}
;
coherence
{ b1 where B is Element of Bags c1 : ex b1 being bag of c1 st
( b2 in c2 & b2 divides b1 )
}
is Subset of (Bags c1)
proof end;
end;

:: deftheorem Def2 defines multiples GROEB_1:def 2 :
for b1 being Ordinal
for b2 being Subset of (Bags b1) holds multiples b2 = { b3 where B is Element of Bags b1 : ex b1 being bag of b1 st
( b4 in b2 & b4 divides b3 )
}
;

theorem Th12: :: GROEB_1:12
for b1 being Nat
for b2 being connected admissible TermOrder of b1
for b3 being non empty unital associative commutative Abelian add-associative right_zeroed right_complementable distributive Field-like non degenerated doubleLoopStr
for b4 being Subset of (Polynom-Ring b1,b3) st PolyRedRel b4,b2 is locally-confluent holds
PolyRedRel b4,b2 is confluent
proof end;

theorem Th13: :: GROEB_1:13
for b1 being Ordinal
for b2 being connected TermOrder of b1
for b3 being unital associative commutative add-associative right_zeroed right_complementable distributive Field-like non trivial doubleLoopStr
for b4 being Subset of (Polynom-Ring b1,b3) st PolyRedRel b4,b2 is confluent holds
PolyRedRel b4,b2 is with_UN_property
proof end;

theorem Th14: :: GROEB_1:14
for b1 being Nat
for b2 being connected admissible TermOrder of b1
for b3 being non empty unital associative commutative Abelian add-associative right_zeroed right_complementable distributive Field-like non degenerated doubleLoopStr
for b4 being Subset of (Polynom-Ring b1,b3) st PolyRedRel b4,b2 is with_UN_property holds
PolyRedRel b4,b2 is with_Church-Rosser_property
proof end;

Lemma16: for b1 being Ordinal
for b2 being connected TermOrder of b1
for b3 being unital associative commutative add-associative right_zeroed right_complementable distributive Field-like non trivial doubleLoopStr
for b4 being Polynomial of b1,b3
for b5 being set
for b6 being Subset of (Polynom-Ring b1,b3) st PolyRedRel b6,b2 reduces b4,b5 holds
b5 is Polynomial of b1,b3
proof end;

Lemma17: for b1 being Ordinal
for b2 being connected TermOrder of b1
for b3 being unital associative commutative add-associative right_zeroed right_complementable distributive Field-like non trivial doubleLoopStr
for b4, b5 being Polynomial of b1,b3
for b6 being Subset of (Polynom-Ring b1,b3) st PolyRedRel b6,b2 reduces b4,b5 & b5 <> b4 holds
ex b7 being Polynomial of b1,b3 st
( b4 reduces_to b7,b6,b2 & PolyRedRel b6,b2 reduces b7,b5 )
proof end;

theorem Th15: :: GROEB_1:15
for b1 being Nat
for b2 being connected admissible TermOrder of b1
for b3 being non empty unital associative commutative Abelian add-associative right_zeroed right_complementable distributive Field-like non degenerated doubleLoopStr
for b4 being non empty Subset of (Polynom-Ring b1,b3) st PolyRedRel b4,b2 is with_Church-Rosser_property holds
for b5 being Polynomial of b1,b3 st b5 in b4 -Ideal holds
PolyRedRel b4,b2 reduces b5, 0_ b1,b3
proof end;

theorem Th16: :: GROEB_1:16
for b1 being Ordinal
for b2 being connected TermOrder of b1
for b3 being unital associative commutative add-associative right_zeroed right_complementable distributive Field-like non trivial doubleLoopStr
for b4 being Subset of (Polynom-Ring b1,b3) st ( for b5 being Polynomial of b1,b3 st b5 in b4 -Ideal holds
PolyRedRel b4,b2 reduces b5, 0_ b1,b3 ) holds
for b5 being non-zero Polynomial of b1,b3 st b5 in b4 -Ideal holds
b5 is_reducible_wrt b4,b2
proof end;

theorem Th17: :: GROEB_1:17
for b1 being Nat
for b2 being connected admissible TermOrder of b1
for b3 being non empty unital associative commutative Abelian add-associative right_zeroed right_complementable distributive Field-like non degenerated doubleLoopStr
for b4 being Subset of (Polynom-Ring b1,b3) st ( for b5 being non-zero Polynomial of b1,b3 st b5 in b4 -Ideal holds
b5 is_reducible_wrt b4,b2 ) holds
for b5 being non-zero Polynomial of b1,b3 st b5 in b4 -Ideal holds
b5 is_top_reducible_wrt b4,b2
proof end;

theorem Th18: :: GROEB_1:18
for b1 being Ordinal
for b2 being connected TermOrder of b1
for b3 being unital associative commutative add-associative right_zeroed right_complementable distributive Field-like non trivial doubleLoopStr
for b4 being Subset of (Polynom-Ring b1,b3) st ( for b5 being non-zero Polynomial of b1,b3 st b5 in b4 -Ideal holds
b5 is_top_reducible_wrt b4,b2 ) holds
for b5 being bag of b1 st b5 in HT (b4 -Ideal ),b2 holds
ex b6 being bag of b1 st
( b6 in HT b4,b2 & b6 divides b5 )
proof end;

theorem Th19: :: GROEB_1:19
for b1 being Ordinal
for b2 being connected TermOrder of b1
for b3 being unital associative commutative add-associative right_zeroed right_complementable distributive Field-like non trivial doubleLoopStr
for b4 being Subset of (Polynom-Ring b1,b3) st ( for b5 being bag of b1 st b5 in HT (b4 -Ideal ),b2 holds
ex b6 being bag of b1 st
( b6 in HT b4,b2 & b6 divides b5 ) ) holds
HT (b4 -Ideal ),b2 c= multiples (HT b4,b2)
proof end;

theorem Th20: :: GROEB_1:20
for b1 being Nat
for b2 being connected admissible TermOrder of b1
for b3 being non empty unital associative commutative Abelian add-associative right_zeroed right_complementable distributive Field-like non degenerated doubleLoopStr
for b4 being Subset of (Polynom-Ring b1,b3) st HT (b4 -Ideal ),b2 c= multiples (HT b4,b2) holds
PolyRedRel b4,b2 is locally-confluent
proof end;

definition
let c1 be Ordinal;
let c2 be connected TermOrder of c1;
let c3 be unital associative commutative add-associative right_zeroed right_complementable distributive Field-like non trivial doubleLoopStr ;
let c4 be Subset of (Polynom-Ring c1,c3);
pred c4 is_Groebner_basis_wrt c2 means :Def3: :: GROEB_1:def 3
PolyRedRel a4,a2 is locally-confluent;
end;

:: deftheorem Def3 defines is_Groebner_basis_wrt GROEB_1:def 3 :
for b1 being Ordinal
for b2 being connected TermOrder of b1
for b3 being unital associative commutative add-associative right_zeroed right_complementable distributive Field-like non trivial doubleLoopStr
for b4 being Subset of (Polynom-Ring b1,b3) holds
( b4 is_Groebner_basis_wrt b2 iff PolyRedRel b4,b2 is locally-confluent );

definition
let c1 be Ordinal;
let c2 be connected TermOrder of c1;
let c3 be unital associative commutative add-associative right_zeroed right_complementable distributive Field-like non trivial doubleLoopStr ;
let c4, c5 be Subset of (Polynom-Ring c1,c3);
pred c4 is_Groebner_basis_of c5,c2 means :Def4: :: GROEB_1:def 4
( a4 -Ideal = a5 & PolyRedRel a4,a2 is locally-confluent );
end;

:: deftheorem Def4 defines is_Groebner_basis_of GROEB_1:def 4 :
for b1 being Ordinal
for b2 being connected TermOrder of b1
for b3 being unital associative commutative add-associative right_zeroed right_complementable distributive Field-like non trivial doubleLoopStr
for b4, b5 being Subset of (Polynom-Ring b1,b3) holds
( b4 is_Groebner_basis_of b5,b2 iff ( b4 -Ideal = b5 & PolyRedRel b4,b2 is locally-confluent ) );

Lemma24: for b1 being Ordinal
for b2 being connected TermOrder of b1
for b3 being unital associative commutative add-associative right_zeroed right_complementable distributive Field-like non trivial doubleLoopStr
for b4 being Subset of (Polynom-Ring b1,b3)
for b5, b6 being set st b5 <> b6 & PolyRedRel b4,b2 reduces b5,b6 holds
( b5 is Polynomial of b1,b3 & b6 is Polynomial of b1,b3 )
proof end;

theorem Th21: :: GROEB_1:21
for b1 being Nat
for b2 being connected admissible TermOrder of b1
for b3 being non empty unital associative commutative Abelian add-associative right_zeroed right_complementable distributive Field-like non degenerated doubleLoopStr
for b4, b5 being non empty Subset of (Polynom-Ring b1,b3) st b4 is_Groebner_basis_of b5,b2 holds
PolyRedRel b4,b2 is Completion of PolyRedRel b5,b2
proof end;

theorem Th22: :: GROEB_1:22
for b1 being Nat
for b2 being connected admissible TermOrder of b1
for b3 being non empty unital associative commutative Abelian add-associative right_zeroed right_complementable distributive Field-like non degenerated doubleLoopStr
for b4, b5 being Element of (Polynom-Ring b1,b3)
for b6 being non empty Subset of (Polynom-Ring b1,b3) st b6 is_Groebner_basis_wrt b2 holds
( b4,b5 are_congruent_mod b6 -Ideal iff nf b4,(PolyRedRel b6,b2) = nf b5,(PolyRedRel b6,b2) )
proof end;

theorem Th23: :: GROEB_1:23
for b1 being Nat
for b2 being connected admissible TermOrder of b1
for b3 being non empty unital associative commutative Abelian add-associative right_zeroed right_complementable distributive Field-like non degenerated doubleLoopStr
for b4 being Polynomial of b1,b3
for b5 being non empty Subset of (Polynom-Ring b1,b3) st b5 is_Groebner_basis_wrt b2 holds
( b4 in b5 -Ideal iff PolyRedRel b5,b2 reduces b4, 0_ b1,b3 )
proof end;

Lemma25: for b1 being Ordinal
for b2 being connected TermOrder of b1
for b3 being unital associative commutative Abelian add-associative right_zeroed right_complementable distributive Field-like non trivial doubleLoopStr
for b4 being LeftIdeal of (Polynom-Ring b1,b3)
for b5 being non empty Subset of (Polynom-Ring b1,b3) st b5 c= b4 & ( for b6 being Polynomial of b1,b3 st b6 in b4 holds
PolyRedRel b5,b2 reduces b6, 0_ b1,b3 ) holds
b5 -Ideal = b4
proof end;

theorem Th24: :: GROEB_1:24
for b1 being Nat
for b2 being connected admissible TermOrder of b1
for b3 being non empty unital associative commutative Abelian add-associative right_zeroed right_complementable distributive Field-like non degenerated doubleLoopStr
for b4 being Subset of (Polynom-Ring b1,b3)
for b5 being non empty Subset of (Polynom-Ring b1,b3) st b5 is_Groebner_basis_of b4,b2 holds
for b6 being Polynomial of b1,b3 st b6 in b4 holds
PolyRedRel b5,b2 reduces b6, 0_ b1,b3
proof end;

theorem Th25: :: GROEB_1:25
for b1 being Ordinal
for b2 being connected TermOrder of b1
for b3 being unital associative commutative add-associative right_zeroed right_complementable distributive Field-like non trivial doubleLoopStr
for b4, b5 being Subset of (Polynom-Ring b1,b3) st ( for b6 being Polynomial of b1,b3 st b6 in b5 holds
PolyRedRel b4,b2 reduces b6, 0_ b1,b3 ) holds
for b6 being non-zero Polynomial of b1,b3 st b6 in b5 holds
b6 is_reducible_wrt b4,b2
proof end;

theorem Th26: :: GROEB_1:26
for b1 being Nat
for b2 being connected admissible TermOrder of b1
for b3 being non empty unital associative commutative Abelian add-associative right_zeroed right_complementable distributive Field-like non degenerated doubleLoopStr
for b4 being add-closed left-ideal Subset of (Polynom-Ring b1,b3)
for b5 being Subset of (Polynom-Ring b1,b3) st b5 c= b4 & ( for b6 being non-zero Polynomial of b1,b3 st b6 in b4 holds
b6 is_reducible_wrt b5,b2 ) holds
for b6 being non-zero Polynomial of b1,b3 st b6 in b4 holds
b6 is_top_reducible_wrt b5,b2
proof end;

theorem Th27: :: GROEB_1:27
for b1 being Ordinal
for b2 being connected TermOrder of b1
for b3 being unital associative commutative add-associative right_zeroed right_complementable distributive Field-like non trivial doubleLoopStr
for b4, b5 being Subset of (Polynom-Ring b1,b3) st ( for b6 being non-zero Polynomial of b1,b3 st b6 in b5 holds
b6 is_top_reducible_wrt b4,b2 ) holds
for b6 being bag of b1 st b6 in HT b5,b2 holds
ex b7 being bag of b1 st
( b7 in HT b4,b2 & b7 divides b6 )
proof end;

theorem Th28: :: GROEB_1:28
for b1 being Ordinal
for b2 being connected TermOrder of b1
for b3 being unital associative commutative add-associative right_zeroed right_complementable distributive Field-like non trivial doubleLoopStr
for b4, b5 being Subset of (Polynom-Ring b1,b3) st ( for b6 being bag of b1 st b6 in HT b5,b2 holds
ex b7 being bag of b1 st
( b7 in HT b4,b2 & b7 divides b6 ) ) holds
HT b5,b2 c= multiples (HT b4,b2)
proof end;

theorem Th29: :: GROEB_1:29
for b1 being Nat
for b2 being connected admissible TermOrder of b1
for b3 being non empty unital associative commutative Abelian add-associative right_zeroed right_complementable distributive Field-like non degenerated doubleLoopStr
for b4 being non empty add-closed left-ideal Subset of (Polynom-Ring b1,b3)
for b5 being non empty Subset of (Polynom-Ring b1,b3) st b5 c= b4 & HT b4,b2 c= multiples (HT b5,b2) holds
b5 is_Groebner_basis_of b4,b2
proof end;

theorem Th30: :: GROEB_1:30
for b1 being Nat
for b2 being connected admissible TermOrder of b1
for b3 being unital associative commutative Abelian add-associative right_zeroed right_complementable distributive Field-like non trivial doubleLoopStr holds {(0_ b1,b3)} is_Groebner_basis_of {(0_ b1,b3)},b2
proof end;

theorem Th31: :: GROEB_1:31
for b1 being Nat
for b2 being connected admissible TermOrder of b1
for b3 being unital associative commutative Abelian add-associative right_zeroed right_complementable distributive Field-like non trivial doubleLoopStr
for b4 being Polynomial of b1,b3 holds {b4} is_Groebner_basis_of {b4} -Ideal ,b2
proof end;

theorem Th32: :: GROEB_1:32
for b1 being connected admissible TermOrder of {}
for b2 being non empty unital associative commutative Abelian add-associative right_zeroed right_complementable distributive Field-like non degenerated doubleLoopStr
for b3 being non empty add-closed left-ideal Subset of (Polynom-Ring {} ,b2)
for b4 being non empty Subset of (Polynom-Ring {} ,b2) st b4 c= b3 & b4 <> {(0_ {} ,b2)} holds
b4 is_Groebner_basis_of b3,b1
proof end;

theorem Th33: :: GROEB_1:33
for b1 being non empty Ordinal
for b2 being connected admissible TermOrder of b1
for b3 being non empty unital associative commutative add-associative right_zeroed right_complementable distributive Field-like non degenerated doubleLoopStr holds
not for b4 being Subset of (Polynom-Ring b1,b3) holds b4 is_Groebner_basis_wrt b2
proof end;

Lemma33: for b1 being Ordinal
for b2, b3, b4 being bag of b1 st b2 divides b3 & b3 divides b4 holds
b2 divides b4
proof end;

definition
let c1 be Ordinal;
func DivOrder c1 -> Order of Bags a1 means :Def5: :: GROEB_1:def 5
for b1, b2 being bag of a1 holds
( [b1,b2] in a2 iff b1 divides b2 );
existence
ex b1 being Order of Bags c1 st
for b2, b3 being bag of c1 holds
( [b2,b3] in b1 iff b2 divides b3 )
proof end;
uniqueness
for b1, b2 being Order of Bags c1 st ( for b3, b4 being bag of c1 holds
( [b3,b4] in b1 iff b3 divides b4 ) ) & ( for b3, b4 being bag of c1 holds
( [b3,b4] in b2 iff b3 divides b4 ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def5 defines DivOrder GROEB_1:def 5 :
for b1 being Ordinal
for b2 being Order of Bags b1 holds
( b2 = DivOrder b1 iff for b3, b4 being bag of b1 holds
( [b3,b4] in b2 iff b3 divides b4 ) );

registration
let c1 be Nat;
cluster RelStr(# (Bags a1),(DivOrder a1) #) -> Dickson ;
coherence
RelStr(# (Bags c1),(DivOrder c1) #) is Dickson
proof end;
end;

theorem Th34: :: GROEB_1:34
for b1 being Nat
for b2 being Subset of RelStr(# (Bags b1),(DivOrder b1) #) ex b3 being finite Subset of (Bags b1) st b3 is_Dickson-basis_of b2, RelStr(# (Bags b1),(DivOrder b1) #)
proof end;

theorem Th35: :: GROEB_1:35
for b1 being Nat
for b2 being connected admissible TermOrder of b1
for b3 being non empty unital associative commutative Abelian add-associative right_zeroed right_complementable distributive Field-like non degenerated doubleLoopStr
for b4 being non empty add-closed left-ideal Subset of (Polynom-Ring b1,b3) ex b5 being finite Subset of (Polynom-Ring b1,b3) st b5 is_Groebner_basis_of b4,b2
proof end;

Lemma37: for b1 being non empty unital associative add-associative right_zeroed right_complementable distributive left_zeroed doubleLoopStr
for b2, b3 being non empty Subset of b1 st 0. b1 in b2 & b3 = b2 \ {(0. b1)} holds
for b4 being LinearCombination of b2
for b5 being set st b5 = Sum b4 holds
ex b6 being LinearCombination of b3 st b5 = Sum b6
proof end;

theorem Th36: :: GROEB_1:36
for b1 being Nat
for b2 being connected admissible TermOrder of b1
for b3 being non empty unital associative commutative Abelian add-associative right_zeroed right_complementable distributive Field-like non degenerated doubleLoopStr
for b4 being non empty add-closed left-ideal Subset of (Polynom-Ring b1,b3) st b4 <> {(0_ b1,b3)} holds
ex b5 being finite Subset of (Polynom-Ring b1,b3) st
( b5 is_Groebner_basis_of b4,b2 & not 0_ b1,b3 in b5 )
proof end;

definition
let c1 be Ordinal;
let c2 be connected TermOrder of c1;
let c3 be non empty multLoopStr_0 ;
let c4 be Polynomial of c1,c3;
pred c4 is_monic_wrt c2 means :Def6: :: GROEB_1:def 6
HC a4,a2 = 1. a3;
end;

:: deftheorem Def6 defines is_monic_wrt GROEB_1:def 6 :
for b1 being Ordinal
for b2 being connected TermOrder of b1
for b3 being non empty multLoopStr_0
for b4 being Polynomial of b1,b3 holds
( b4 is_monic_wrt b2 iff HC b4,b2 = 1. b3 );

definition
let c1 be Ordinal;
let c2 be connected TermOrder of c1;
let c3 be non empty unital associative commutative add-associative right_zeroed right_complementable distributive Field-like non trivial doubleLoopStr ;
let c4 be Subset of (Polynom-Ring c1,c3);
pred c4 is_reduced_wrt c2 means :Def7: :: GROEB_1:def 7
for b1 being Polynomial of a1,a3 st b1 in a4 holds
( b1 is_monic_wrt a2 & b1 is_irreducible_wrt a4 \ {b1},a2 );
end;

:: deftheorem Def7 defines is_reduced_wrt GROEB_1:def 7 :
for b1 being Ordinal
for b2 being connected TermOrder of b1
for b3 being non empty unital associative commutative add-associative right_zeroed right_complementable distributive Field-like non trivial doubleLoopStr
for b4 being Subset of (Polynom-Ring b1,b3) holds
( b4 is_reduced_wrt b2 iff for b5 being Polynomial of b1,b3 st b5 in b4 holds
( b5 is_monic_wrt b2 & b5 is_irreducible_wrt b4 \ {b5},b2 ) );

notation
let c1 be Ordinal;
let c2 be connected TermOrder of c1;
let c3 be non empty unital associative commutative add-associative right_zeroed right_complementable distributive Field-like non trivial doubleLoopStr ;
let c4 be Subset of (Polynom-Ring c1,c3);
synonym c4 is_autoreduced_wrt c2 for c4 is_reduced_wrt c2;
end;

theorem Th37: :: GROEB_1:37
for b1 being Ordinal
for b2 being connected admissible TermOrder of b1
for b3 being non empty unital associative commutative Abelian add-associative right_zeroed right_complementable distributive Field-like non degenerated doubleLoopStr
for b4 being add-closed left-ideal Subset of (Polynom-Ring b1,b3)
for b5 being Monomial of b1,b3
for b6, b7 being Polynomial of b1,b3 st b6 in b4 & b7 in b4 & HM b6,b2 = b5 & HM b7,b2 = b5 & ( for b8 being Polynomial of b1,b3 holds
( not b8 in b4 or not b8 < b6,b2 or not HM b8,b2 = b5 ) ) & ( for b8 being Polynomial of b1,b3 holds
( not b8 in b4 or not b8 < b7,b2 or not HM b8,b2 = b5 ) ) holds
b6 = b7
proof end;

Lemma41: for b1 being Nat
for b2 being connected admissible TermOrder of b1
for b3 being non empty unital associative commutative Abelian add-associative right_zeroed right_complementable distributive Field-like non degenerated doubleLoopStr
for b4 being Polynomial of b1,b3
for b5 being non empty add-closed left-ideal Subset of (Polynom-Ring b1,b3) st b4 in b5 & b4 <> 0_ b1,b3 holds
ex b6 being Polynomial of b1,b3 st
( b6 in b5 & HM b6,b2 = Monom (1. b3),(HT b4,b2) & b6 <> 0_ b1,b3 )
proof end;

theorem Th38: :: GROEB_1:38
for b1 being Nat
for b2 being connected admissible TermOrder of b1
for b3 being non empty unital associative commutative Abelian add-associative right_zeroed right_complementable distributive Field-like non degenerated doubleLoopStr
for b4 being non empty add-closed left-ideal Subset of (Polynom-Ring b1,b3)
for b5 being Subset of (Polynom-Ring b1,b3)
for b6 being Polynomial of b1,b3
for b7 being non-zero Polynomial of b1,b3 st b6 in b5 & b7 in b5 & b6 <> b7 & HT b7,b2 divides HT b6,b2 & b5 is_Groebner_basis_of b4,b2 holds
b5 \ {b6} is_Groebner_basis_of b4,b2
proof end;

theorem Th39: :: GROEB_1:39
for b1 being Nat
for b2 being connected admissible TermOrder of b1
for b3 being non empty unital associative commutative Abelian add-associative right_zeroed right_complementable distributive Field-like non degenerated doubleLoopStr
for b4 being non empty add-closed left-ideal Subset of (Polynom-Ring b1,b3) st b4 <> {(0_ b1,b3)} holds
ex b5 being finite Subset of (Polynom-Ring b1,b3) st
( b5 is_Groebner_basis_of b4,b2 & b5 is_reduced_wrt b2 )
proof end;

theorem Th40: :: GROEB_1:40
for b1 being Nat
for b2 being connected admissible TermOrder of b1
for b3 being non empty unital associative commutative Abelian add-associative right_zeroed right_complementable distributive Field-like non degenerated doubleLoopStr
for b4 being non empty add-closed left-ideal Subset of (Polynom-Ring b1,b3)
for b5, b6 being non empty finite Subset of (Polynom-Ring b1,b3) st b5 is_Groebner_basis_of b4,b2 & b5 is_reduced_wrt b2 & b6 is_Groebner_basis_of b4,b2 & b6 is_reduced_wrt b2 holds
b5 = b6
proof end;