:: GROEB_2 semantic presentation

theorem Th1: :: GROEB_2:1
canceled;

theorem Th2: :: GROEB_2:2
for b1 being non empty LoopStr
for b2 being FinSequence of b1
for b3, b4 being Nat st b4 <= b3 holds
(b2 | b3) | b4 = b2 | b4
proof end;

theorem Th3: :: GROEB_2:3
for b1 being non empty add-associative right_zeroed right_complementable LoopStr
for b2 being FinSequence of b1
for b3 being Nat st ( for b4 being Nat st b4 in dom b2 & b4 > b3 holds
b2 . b4 = 0. b1 ) holds
Sum b2 = Sum (b2 | b3)
proof end;

theorem Th4: :: GROEB_2:4
for b1 being non empty Abelian add-associative right_zeroed LoopStr
for b2 being FinSequence of b1
for b3, b4 being Nat holds Sum (Swap b2,b3,b4) = Sum b2
proof end;

definition
let c1 be set ;
let c2, c3 be bag of c1;
assume E2: c3 divides c2 ;
func c2 / c3 -> bag of a1 means :Def1: :: GROEB_2:def 1
a3 + a4 = a2;
existence
ex b1 being bag of c1 st c3 + b1 = c2
by E2, TERMORD:1;
uniqueness
for b1, b2 being bag of c1 st c3 + b1 = c2 & c3 + b2 = c2 holds
b1 = b2
proof end;
end;

:: deftheorem Def1 defines / GROEB_2:def 1 :
for b1 being set
for b2, b3 being bag of b1 st b3 divides b2 holds
for b4 being bag of b1 holds
( b4 = b2 / b3 iff b3 + b4 = b2 );

definition
let c1 be set ;
let c2, c3 be bag of c1;
func lcm c2,c3 -> bag of a1 means :Def2: :: GROEB_2:def 2
for b1 being set holds a4 . b1 = max (a2 . b1),(a3 . b1);
existence
ex b1 being bag of c1 st
for b2 being set holds b1 . b2 = max (c2 . b2),(c3 . b2)
proof end;
uniqueness
for b1, b2 being bag of c1 st ( for b3 being set holds b1 . b3 = max (c2 . b3),(c3 . b3) ) & ( for b3 being set holds b2 . b3 = max (c2 . b3),(c3 . b3) ) holds
b1 = b2
proof end;
commutativity
for b1, b2, b3 being bag of c1 st ( for b4 being set holds b1 . b4 = max (b2 . b4),(b3 . b4) ) holds
for b4 being set holds b1 . b4 = max (b3 . b4),(b2 . b4)
;
idempotence
for b1 being bag of c1
for b2 being set holds b1 . b2 = max (b1 . b2),(b1 . b2)
;
end;

:: deftheorem Def2 defines lcm GROEB_2:def 2 :
for b1 being set
for b2, b3, b4 being bag of b1 holds
( b4 = lcm b2,b3 iff for b5 being set holds b4 . b5 = max (b2 . b5),(b3 . b5) );

notation
let c1 be set ;
let c2, c3 be bag of c1;
synonym c2 lcm c3 for lcm c2,c3;
end;

definition
let c1 be set ;
let c2, c3 be bag of c1;
pred c2,c3 are_disjoint means :Def3: :: GROEB_2:def 3
for b1 being set holds
( a2 . b1 = 0 or a3 . b1 = 0 );
end;

:: deftheorem Def3 defines are_disjoint GROEB_2:def 3 :
for b1 being set
for b2, b3 being bag of b1 holds
( b2,b3 are_disjoint iff for b4 being set holds
( b2 . b4 = 0 or b3 . b4 = 0 ) );

notation
let c1 be set ;
let c2, c3 be bag of c1;
antonym c2,c3 are_non_disjoint for c2,c3 are_disjoint ;
end;

theorem Th5: :: GROEB_2:5
canceled;

theorem Th6: :: GROEB_2:6
canceled;

theorem Th7: :: GROEB_2:7
for b1 being set
for b2, b3 being bag of b1 holds
( b2 divides lcm b2,b3 & b3 divides lcm b2,b3 )
proof end;

theorem Th8: :: GROEB_2:8
for b1 being set
for b2, b3, b4 being bag of b1 st b2 divides b4 & b3 divides b4 holds
lcm b2,b3 divides b4
proof end;

theorem Th9: :: GROEB_2:9
for b1 being set
for b2, b3 being bag of b1 holds
( b2,b3 are_disjoint iff lcm b2,b3 = b2 + b3 )
proof end;

theorem Th10: :: GROEB_2:10
for b1 being set
for b2 being bag of b1 holds b2 / b2 = EmptyBag b1
proof end;

theorem Th11: :: GROEB_2:11
for b1 being set
for b2, b3 being bag of b1 holds
( b3 divides b2 iff lcm b2,b3 = b2 )
proof end;

theorem Th12: :: GROEB_2:12
for b1 being set
for b2, b3, b4 being bag of b1 st b2 divides lcm b3,b4 holds
lcm b3,b2 divides lcm b3,b4
proof end;

theorem Th13: :: GROEB_2:13
for b1 being set
for b2, b3, b4 being bag of b1 st lcm b3,b2 divides lcm b3,b4 holds
lcm b2,b4 divides lcm b3,b4
proof end;

theorem Th14: :: GROEB_2:14
for b1 being set
for b2, b3, b4 being bag of b1 st lcm b2,b4 divides lcm b3,b4 holds
b2 divides lcm b3,b4
proof end;

theorem Th15: :: GROEB_2:15
for b1 being Nat
for b2 being connected admissible TermOrder of b1
for b3 being non empty Subset of (Bags b1) ex b4 being bag of b1 st
( b4 in b3 & ( for b5 being bag of b1 st b5 in b3 holds
b4 <= b5,b2 ) )
proof end;

registration
let c1 be add-associative right_zeroed right_complementable non trivial LoopStr ;
let c2 be non-zero Element of c1;
cluster - a2 -> non-zero ;
coherence
- c2 is non-zero
proof end;
end;

registration
let c1 be set ;
let c2 be non empty right_zeroed distributive add-cancelable left_zeroed doubleLoopStr ;
let c3 be Monomial of c1,c2;
let c4 be Element of c2;
cluster a4 * a3 -> monomial-like ;
coherence
c4 * c3 is monomial-like
proof end;
end;

registration
let c1 be Ordinal;
let c2 be right_zeroed distributive add-cancelable left_zeroed non trivial domRing-like doubleLoopStr ;
let c3 be non-zero Polynomial of c1,c2;
let c4 be non-zero Element of c2;
cluster a4 * a3 -> non-zero ;
coherence
c4 * c3 is non-zero
proof end;
end;

theorem Th16: :: GROEB_2:16
for b1 being Ordinal
for b2 being non empty right_zeroed right-distributive doubleLoopStr
for b3, b4 being Series of b1,b2
for b5 being bag of b1 holds b5 *' (b3 + b4) = (b5 *' b3) + (b5 *' b4)
proof end;

theorem Th17: :: GROEB_2:17
for b1 being Ordinal
for b2 being non empty add-associative right_zeroed right_complementable LoopStr
for b3 being Series of b1,b2
for b4 being bag of b1 holds b4 *' (- b3) = - (b4 *' b3)
proof end;

theorem Th18: :: GROEB_2:18
for b1 being Ordinal
for b2 being non empty right-distributive left_zeroed add-right-cancelable doubleLoopStr
for b3 being Series of b1,b2
for b4 being bag of b1
for b5 being Element of b2 holds b4 *' (b5 * b3) = b5 * (b4 *' b3)
proof end;

theorem Th19: :: GROEB_2:19
for b1 being Ordinal
for b2 being non empty right-distributive doubleLoopStr
for b3, b4 being Series of b1,b2
for b5 being Element of b2 holds b5 * (b3 + b4) = (b5 * b3) + (b5 * b4)
proof end;

theorem Th20: :: GROEB_2:20
for b1 being set
for b2 being non empty add-associative right_zeroed right_complementable doubleLoopStr
for b3 being Element of b2 holds - (b3 | b1,b2) = (- b3) | b1,b2
proof end;

Lemma14: 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;

theorem Th21: :: GROEB_2: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 being Subset of (Polynom-Ring b1,b3) st not 0_ b1,b3 in b4 & ( for b5, b6 being Polynomial of b1,b3 st b5 <> b6 & b5 in b4 & b6 in b4 holds
for b7, b8 being Monomial of b1,b3 st HM (b7 *' b5),b2 = HM (b8 *' b6),b2 holds
PolyRedRel b4,b2 reduces (b7 *' b5) - (b8 *' b6), 0_ b1,b3 ) holds
b4 is_Groebner_basis_wrt b2
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, c5 be Polynomial of c1,c3;
func S-Poly c4,c5,c2 -> Polynomial of a1,a3 equals :: GROEB_2:def 4
((HC a5,a2) * (((lcm (HT a4,a2),(HT a5,a2)) / (HT a4,a2)) *' a4)) - ((HC a4,a2) * (((lcm (HT a4,a2),(HT a5,a2)) / (HT a5,a2)) *' a5));
coherence
((HC c5,c2) * (((lcm (HT c4,c2),(HT c5,c2)) / (HT c4,c2)) *' c4)) - ((HC c4,c2) * (((lcm (HT c4,c2),(HT c5,c2)) / (HT c5,c2)) *' c5)) is Polynomial of c1,c3
;
end;

:: deftheorem Def4 defines S-Poly GROEB_2: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 Polynomial of b1,b3 holds S-Poly b4,b5,b2 = ((HC b5,b2) * (((lcm (HT b4,b2),(HT b5,b2)) / (HT b4,b2)) *' b4)) - ((HC b4,b2) * (((lcm (HT b4,b2),(HT b5,b2)) / (HT b5,b2)) *' b5));

Lemma16: 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;

Lemma17: for b1 being Ordinal
for b2 being connected TermOrder of b1
for b3 being unital add-associative right_zeroed right_complementable distributive non trivial 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;

theorem Th22: :: GROEB_2:22
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 Subset of (Polynom-Ring b1,b3)
for b5, b6 being Polynomial of b1,b3 st b5 in b4 & b6 in b4 holds
S-Poly b5,b6,b2 in b4 -Ideal
proof end;

theorem Th23: :: GROEB_2:23
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 st b4 = b5 holds
S-Poly b4,b5,b2 = 0_ b1,b3 by POLYNOM1:83;

theorem Th24: :: GROEB_2:24
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 Monomial of b1,b3 holds S-Poly b4,b5,b2 = 0_ b1,b3
proof end;

theorem Th25: :: GROEB_2: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 being Polynomial of b1,b3 holds
( S-Poly b4,(0_ b1,b3),b2 = 0_ b1,b3 & S-Poly (0_ b1,b3),b4,b2 = 0_ b1,b3 )
proof end;

theorem Th26: :: GROEB_2:26
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 holds
( S-Poly b4,b5,b2 = 0_ b1,b3 or HT (S-Poly b4,b5,b2),b2 < lcm (HT b4,b2),(HT b5,b2),b2 )
proof end;

theorem Th27: :: GROEB_2: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 non-zero Polynomial of b1,b3 st HT b5,b2 divides HT b4,b2 holds
(HC b5,b2) * b4 top_reduces_to S-Poly b4,b5,b2,b5,b2
proof end;

theorem Th28: :: GROEB_2:28
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 b4 is_Groebner_basis_wrt b2 holds
for b5, b6, b7 being Polynomial of b1,b3 st b5 in b4 & b6 in b4 & b7 is_a_normal_form_of S-Poly b5,b6,b2, PolyRedRel b4,b2 holds
b7 = 0_ b1,b3
proof end;

theorem Th29: :: GROEB_2: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 Subset of (Polynom-Ring b1,b3) st ( for b5, b6, b7 being Polynomial of b1,b3 st b5 in b4 & b6 in b4 & b7 is_a_normal_form_of S-Poly b5,b6,b2, PolyRedRel b4,b2 holds
b7 = 0_ b1,b3 ) holds
for b5, b6 being Polynomial of b1,b3 st b5 in b4 & b6 in b4 holds
PolyRedRel b4,b2 reduces S-Poly b5,b6,b2, 0_ b1,b3
proof end;

theorem Th30: :: GROEB_2:30
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 not 0_ b1,b3 in b4 & ( for b5, b6 being Polynomial of b1,b3 st b5 in b4 & b6 in b4 holds
PolyRedRel b4,b2 reduces S-Poly b5,b6,b2, 0_ b1,b3 ) holds
b4 is_Groebner_basis_wrt b2
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);
func S-Poly c4,c2 -> Subset of (Polynom-Ring a1,a3) equals :: GROEB_2:def 5
{ (S-Poly b1,b2,a2) where B is Polynomial of a1,a3, B is Polynomial of a1,a3 : ( b1 in a4 & b2 in a4 ) } ;
coherence
{ (S-Poly b1,b2,c2) where B is Polynomial of c1,c3, B is Polynomial of c1,c3 : ( b1 in c4 & b2 in c4 ) } is Subset of (Polynom-Ring c1,c3)
proof end;
end;

:: deftheorem Def5 defines S-Poly GROEB_2:def 5 :
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 S-Poly b4,b2 = { (S-Poly b5,b6,b2) where B is Polynomial of b1,b3, B is Polynomial of b1,b3 : ( b5 in b4 & b6 in b4 ) } ;

registration
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 finite Subset of (Polynom-Ring c1,c3);
cluster S-Poly a4,a2 -> finite ;
coherence
S-Poly c4,c2 is finite
proof end;
end;

theorem Th31: :: GROEB_2:31
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 not 0_ b1,b3 in b4 & ( for b5 being Polynomial of b1,b3 st b5 in b4 holds
b5 is Monomial of b1,b3 ) holds
b4 is_Groebner_basis_wrt b2
proof end;

theorem Th32: :: GROEB_2:32
for b1 being non empty multLoopStr
for b2 being non empty Subset of b1
for b3 being LeftLinearCombination of b2
for b4 being Nat holds b3 | b4 is LeftLinearCombination of b2
proof end;

theorem Th33: :: GROEB_2:33
for b1 being non empty multLoopStr
for b2 being non empty Subset of b1
for b3 being LeftLinearCombination of b2
for b4 being Nat holds b3 /^ b4 is LeftLinearCombination of b2
proof end;

theorem Th34: :: GROEB_2:34
for b1 being non empty multLoopStr
for b2, b3 being non empty Subset of b1
for b4 being LeftLinearCombination of b2 st b2 c= b3 holds
b4 is LeftLinearCombination of b3
proof end;

definition
let c1 be Ordinal;
let c2 be non empty unital add-associative right_zeroed right_complementable distributive non trivial doubleLoopStr ;
let c3 be non empty Subset of (Polynom-Ring c1,c2);
let c4, c5 be LeftLinearCombination of c3;
redefine func ^ as c4 ^ c5 -> LeftLinearCombination of a3;
coherence
c4 ^ c5 is LeftLinearCombination of c3
proof end;
end;

definition
let c1 be Ordinal;
let c2 be non empty unital add-associative right_zeroed right_complementable distributive non trivial doubleLoopStr ;
let c3 be Polynomial of c1,c2;
let c4 be non empty Subset of (Polynom-Ring c1,c2);
let c5 be LeftLinearCombination of c4;
pred c5 is_MonomialRepresentation_of c3 means :Def6: :: GROEB_2:def 6
( Sum a5 = a3 & ( for b1 being Nat st b1 in dom a5 holds
ex b2 being Monomial of a1,a2ex b3 being Polynomial of a1,a2 st
( b3 in a4 & a5 /. b1 = b2 *' b3 ) ) );
end;

:: deftheorem Def6 defines is_MonomialRepresentation_of GROEB_2:def 6 :
for b1 being Ordinal
for b2 being non empty unital add-associative right_zeroed right_complementable distributive non trivial doubleLoopStr
for b3 being Polynomial of b1,b2
for b4 being non empty Subset of (Polynom-Ring b1,b2)
for b5 being LeftLinearCombination of b4 holds
( b5 is_MonomialRepresentation_of b3 iff ( Sum b5 = b3 & ( for b6 being Nat st b6 in dom b5 holds
ex b7 being Monomial of b1,b2ex b8 being Polynomial of b1,b2 st
( b8 in b4 & b5 /. b6 = b7 *' b8 ) ) ) );

theorem Th35: :: GROEB_2:35
for b1 being Ordinal
for b2 being non empty unital add-associative right_zeroed right_complementable distributive non trivial doubleLoopStr
for b3 being Polynomial of b1,b2
for b4 being non empty Subset of (Polynom-Ring b1,b2)
for b5 being LeftLinearCombination of b4 st b5 is_MonomialRepresentation_of b3 holds
Support b3 c= union { (Support (b6 *' b7)) where B is Monomial of b1,b2, B is Polynomial of b1,b2 : ex b1 being Nat st
( b8 in dom b5 & b5 /. b8 = b6 *' b7 )
}
proof end;

theorem Th36: :: GROEB_2:36
for b1 being Ordinal
for b2 being non empty unital add-associative right_zeroed right_complementable distributive non trivial doubleLoopStr
for b3, b4 being Polynomial of b1,b2
for b5 being non empty Subset of (Polynom-Ring b1,b2)
for b6, b7 being LeftLinearCombination of b5 st b6 is_MonomialRepresentation_of b3 & b7 is_MonomialRepresentation_of b4 holds
b6 ^ b7 is_MonomialRepresentation_of b3 + b4
proof end;

Lemma23: 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
for b5 being non empty Subset of (Polynom-Ring b1,b3)
for b6 being LeftLinearCombination of b5 st b6 is_MonomialRepresentation_of b4 holds
for b7 being bag of b1 st ( for b8 being Nat st b8 in dom b6 holds
for b9 being Monomial of b1,b3
for b10 being Polynomial of b1,b3 st b6 . b8 = b9 *' b10 & b10 in b5 holds
(b9 *' b10) . b7 = 0. b3 ) holds
b4 . b7 = 0. b3
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 Polynomial of c1,c3;
let c5 be non empty Subset of (Polynom-Ring c1,c3);
let c6 be LeftLinearCombination of c5;
let c7 be bag of c1;
pred c6 is_Standard_Representation_of c4,c5,c7,c2 means :Def7: :: GROEB_2:def 7
( Sum a6 = a4 & ( for b1 being Nat st b1 in dom a6 holds
ex b2 being non-zero Monomial of a1,a3ex b3 being non-zero Polynomial of a1,a3 st
( b3 in a5 & a6 /. b1 = b2 *' b3 & HT (b2 *' b3),a2 <= a7,a2 ) ) );
end;

:: deftheorem Def7 defines is_Standard_Representation_of GROEB_2:def 7 :
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
for b5 being non empty Subset of (Polynom-Ring b1,b3)
for b6 being LeftLinearCombination of b5
for b7 being bag of b1 holds
( b6 is_Standard_Representation_of b4,b5,b7,b2 iff ( Sum b6 = b4 & ( for b8 being Nat st b8 in dom b6 holds
ex b9 being non-zero Monomial of b1,b3ex b10 being non-zero Polynomial of b1,b3 st
( b10 in b5 & b6 /. b8 = b9 *' b10 & HT (b9 *' b10),b2 <= b7,b2 ) ) ) );

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 Polynomial of c1,c3;
let c5 be non empty Subset of (Polynom-Ring c1,c3);
let c6 be LeftLinearCombination of c5;
pred c6 is_Standard_Representation_of c4,c5,c2 means :Def8: :: GROEB_2:def 8
a6 is_Standard_Representation_of a4,a5, HT a4,a2,a2;
end;

:: deftheorem Def8 defines is_Standard_Representation_of GROEB_2:def 8 :
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
for b5 being non empty Subset of (Polynom-Ring b1,b3)
for b6 being LeftLinearCombination of b5 holds
( b6 is_Standard_Representation_of b4,b5,b2 iff b6 is_Standard_Representation_of b4,b5, HT b4,b2,b2 );

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 Polynomial of c1,c3;
let c5 be non empty Subset of (Polynom-Ring c1,c3);
let c6 be bag of c1;
pred c4 has_a_Standard_Representation_of c5,c6,c2 means :: GROEB_2:def 9
ex b1 being LeftLinearCombination of a5 st b1 is_Standard_Representation_of a4,a5,a6,a2;
end;

:: deftheorem Def9 defines has_a_Standard_Representation_of GROEB_2:def 9 :
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
for b5 being non empty Subset of (Polynom-Ring b1,b3)
for b6 being bag of b1 holds
( b4 has_a_Standard_Representation_of b5,b6,b2 iff ex b7 being LeftLinearCombination of b5 st b7 is_Standard_Representation_of b4,b5,b6,b2 );

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 Polynomial of c1,c3;
let c5 be non empty Subset of (Polynom-Ring c1,c3);
pred c4 has_a_Standard_Representation_of c5,c2 means :Def10: :: GROEB_2:def 10
ex b1 being LeftLinearCombination of a5 st b1 is_Standard_Representation_of a4,a5,a2;
end;

:: deftheorem Def10 defines has_a_Standard_Representation_of GROEB_2:def 10 :
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
for b5 being non empty Subset of (Polynom-Ring b1,b3) holds
( b4 has_a_Standard_Representation_of b5,b2 iff ex b6 being LeftLinearCombination of b5 st b6 is_Standard_Representation_of b4,b5,b2 );

theorem Th37: :: GROEB_2:37
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
for b5 being non empty Subset of (Polynom-Ring b1,b3)
for b6 being LeftLinearCombination of b5
for b7 being bag of b1 st b6 is_Standard_Representation_of b4,b5,b7,b2 holds
b6 is_MonomialRepresentation_of b4
proof end;

Lemma28: 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 being Polynomial of b1,b3
for b6, b7 being Element of (Polynom-Ring b1,b3) st b4 = b6 & b5 = b7 holds
for b8 being non empty Subset of (Polynom-Ring b1,b3) st PolyRedRel b8,b2 reduces b4,b5 holds
ex b9 being LeftLinearCombination of b8 st
( b6 = b7 + (Sum b9) & ( for b10 being Nat st b10 in dom b9 holds
ex b11 being non-zero Monomial of b1,b3ex b12 being non-zero Polynomial of b1,b3 st
( b12 in b8 & b9 . b10 = b11 *' b12 & HT (b11 *' b12),b2 <= HT b4,b2,b2 ) ) )
proof end;

theorem Th38: :: GROEB_2:38
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, b5 being Polynomial of b1,b3
for b6 being non empty Subset of (Polynom-Ring b1,b3)
for b7, b8 being LeftLinearCombination of b6
for b9 being bag of b1 st b7 is_Standard_Representation_of b4,b6,b9,b2 & b8 is_Standard_Representation_of b5,b6,b9,b2 holds
b7 ^ b8 is_Standard_Representation_of b4 + b5,b6,b9,b2
proof end;

theorem Th39: :: GROEB_2:39
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, b5 being Polynomial of b1,b3
for b6 being non empty Subset of (Polynom-Ring b1,b3)
for b7, b8 being LeftLinearCombination of b6
for b9 being bag of b1
for b10 being Nat st b7 is_Standard_Representation_of b4,b6,b9,b2 & b8 = b7 | b10 & b5 = Sum (b7 /^ b10) holds
b8 is_Standard_Representation_of b4 - b5,b6,b9,b2
proof end;

theorem Th40: :: GROEB_2:40
for b1 being Ordinal
for b2 being connected TermOrder of b1
for b3 being non empty unital Abelian add-associative right_zeroed right_complementable distributive non trivial doubleLoopStr
for b4, b5 being Polynomial of b1,b3
for b6 being non empty Subset of (Polynom-Ring b1,b3)
for b7, b8 being LeftLinearCombination of b6
for b9 being bag of b1
for b10 being Nat st b7 is_Standard_Representation_of b4,b6,b9,b2 & b8 = b7 /^ b10 & b5 = Sum (b7 | b10) & b10 <= len b7 holds
b8 is_Standard_Representation_of b4 - b5,b6,b9,b2
proof end;

theorem Th41: :: GROEB_2:41
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 non-zero Polynomial of b1,b3
for b5 being non empty Subset of (Polynom-Ring b1,b3)
for b6 being LeftLinearCombination of b5 st b6 is_MonomialRepresentation_of b4 holds
ex b7 being Natex b8 being non-zero Monomial of b1,b3ex b9 being non-zero Polynomial of b1,b3 st
( b7 in dom b6 & b9 in b5 & b6 . b7 = b8 *' b9 & HT b4,b2 <= HT (b8 *' b9),b2,b2 )
proof end;

theorem Th42: :: GROEB_2:42
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 non-zero Polynomial of b1,b3
for b5 being non empty Subset of (Polynom-Ring b1,b3)
for b6 being LeftLinearCombination of b5 st b6 is_Standard_Representation_of b4,b5,b2 holds
ex b7 being Natex b8 being non-zero Monomial of b1,b3ex b9 being non-zero Polynomial of b1,b3 st
( b9 in b5 & b7 in dom b6 & b6 /. b7 = b8 *' b9 & HT b4,b2 = HT (b8 *' b9),b2 )
proof end;

theorem Th43: :: GROEB_2:43
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 Polynomial of b1,b3
for b5 being non empty Subset of (Polynom-Ring b1,b3) st PolyRedRel b5,b2 reduces b4, 0_ b1,b3 holds
b4 has_a_Standard_Representation_of b5,b2
proof end;

theorem Th44: :: GROEB_2:44
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 being non-zero Polynomial of b1,b3
for b5 being non empty Subset of (Polynom-Ring b1,b3) st b4 has_a_Standard_Representation_of b5,b2 holds
b4 is_top_reducible_wrt b5,b2
proof end;

theorem Th45: :: GROEB_2:45
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) holds
( b4 is_Groebner_basis_wrt b2 iff for b5 being non-zero Polynomial of b1,b3 st b5 in b4 -Ideal holds
b5 has_a_Standard_Representation_of b4,b2 )
proof end;