:: POLYRED semantic presentation

registration
let c1 be Ordinal;
let c2 be non trivial ZeroStr ;
cluster non-zero Relation of Bags a1,the carrier of a2;
existence
ex b1 being Monomial of c1,c2 st b1 is non-zero
proof end;
end;

registration
cluster non trivial doubleLoopStr ;
existence
not for b1 being Field holds b1 is trivial
proof end;
end;

Lemma1: for b1 being set
for b2 being Subset of b1
for b3 being Order of b1 st b3 is_linear-order holds
b3 linearly_orders b2
proof end;

Lemma2: for b1 being Ordinal
for b2, b3, b4 being bag of b1 st b2 <=' b3 holds
b2 + b4 <=' b3 + b4
proof end;

Lemma3: for b1 being Ordinal
for b2, b3 being bag of b1 st b2 <=' b3 & b3 <=' b2 holds
b2 = b3
proof end;

Lemma4: for b1 being Ordinal
for b2, b3 being bag of b1 holds
( not b2 < b3 iff b3 <=' b2 )
proof end;

Lemma5: for b1 being Ordinal
for b2 being non trivial ZeroStr
for b3 being finite-Support non-zero Series of b1,b2 ex b4 being bag of b1 st
( b3 . b4 <> 0. b2 & ( for b5 being bag of b1 st b4 < b5 holds
b3 . b5 = 0. b2 ) )
proof end;

Lemma6: for b1 being non empty Abelian add-associative right_zeroed right_complementable LoopStr
for b2, b3 being FinSequence of the carrier of b1
for b4 being Nat st len b2 = b4 + 1 & b3 = b2 | (Seg b4) holds
Sum b2 = (Sum b3) + (b2 /. (len b2))
proof end;

registration
let c1 be Ordinal;
let c2 be unital add-associative right_zeroed right_complementable distributive domRing-like left_zeroed non trivial doubleLoopStr ;
let c3, c4 be finite-Support non-zero Series of c1,c2;
cluster a3 *' a4 -> non-zero ;
coherence
c3 *' c4 is non-zero
proof end;
end;

theorem Th1: :: POLYRED:1
for b1 being set
for b2 being non empty Abelian add-associative right_zeroed right_complementable LoopStr
for b3, b4 being Series of b1,b2 holds - (b3 + b4) = (- b3) + (- b4)
proof end;

theorem Th2: :: POLYRED:2
for b1 being set
for b2 being non empty left_zeroed LoopStr
for b3 being Series of b1,b2 holds (0_ b1,b2) + b3 = b3
proof end;

theorem Th3: :: POLYRED:3
for b1 being set
for b2 being non empty add-associative right_zeroed right_complementable LoopStr
for b3 being Series of b1,b2 holds
( (- b3) + b3 = 0_ b1,b2 & b3 + (- b3) = 0_ b1,b2 )
proof end;

theorem Th4: :: POLYRED:4
for b1 being set
for b2 being non empty add-associative right_zeroed right_complementable LoopStr
for b3 being Series of b1,b2 holds b3 - (0_ b1,b2) = b3
proof end;

theorem Th5: :: POLYRED:5
for b1 being Ordinal
for b2 being non empty add-associative right_zeroed right_complementable left-distributive add-left-cancelable doubleLoopStr
for b3 being Series of b1,b2 holds (0_ b1,b2) *' b3 = 0_ b1,b2
proof end;

Lemma12: for b1 being Ordinal
for b2 being unital associative commutative Abelian add-associative right_zeroed right_complementable distributive non trivial doubleLoopStr
for b3 being Polynomial of b1,b2
for b4 being Element of (Polynom-Ring b1,b2) st b3 = b4 holds
- b3 = - b4
proof end;

theorem Th6: :: POLYRED:6
for b1 being Ordinal
for b2 being unital associative commutative Abelian add-associative right_zeroed right_complementable distributive non trivial doubleLoopStr
for b3, b4 being Polynomial of b1,b2 holds
( - (b3 *' b4) = (- b3) *' b4 & - (b3 *' b4) = b3 *' (- b4) )
proof end;

Lemma14: for b1 being Ordinal
for b2 being non empty add-associative right_zeroed right_complementable LoopStr
for b3 being Polynomial of b1,b2
for b4 being Monomial of b1,b2
for b5 being bag of b1 st b5 <> term b4 holds
b4 . b5 = 0. b2
proof end;

theorem Th7: :: POLYRED:7
for b1 being Ordinal
for b2 being non empty add-associative right_zeroed right_complementable distributive doubleLoopStr
for b3 being Polynomial of b1,b2
for b4 being Monomial of b1,b2
for b5 being bag of b1 holds (b4 *' b3) . ((term b4) + b5) = (b4 . (term b4)) * (b3 . b5)
proof end;

theorem Th8: :: POLYRED:8
for b1 being set
for b2 being non empty right_zeroed left-distributive add-left-cancelable doubleLoopStr
for b3 being Series of b1,b2 holds (0. b2) * b3 = 0_ b1,b2
proof end;

theorem Th9: :: POLYRED:9
for b1 being set
for b2 being non empty add-associative right_zeroed right_complementable distributive doubleLoopStr
for b3 being Series of b1,b2
for b4 being Element of b2 holds
( - (b4 * b3) = (- b4) * b3 & - (b4 * b3) = b4 * (- b3) )
proof end;

theorem Th10: :: POLYRED:10
for b1 being set
for b2 being non empty left-distributive doubleLoopStr
for b3 being Series of b1,b2
for b4, b5 being Element of b2 holds (b4 * b3) + (b5 * b3) = (b4 + b5) * b3
proof end;

theorem Th11: :: POLYRED:11
for b1 being set
for b2 being non empty associative multLoopStr_0
for b3 being Series of b1,b2
for b4, b5 being Element of b2 holds (b4 * b5) * b3 = b4 * (b5 * b3)
proof end;

theorem Th12: :: POLYRED:12
for b1 being Ordinal
for b2 being non empty unital associative commutative add-associative right_zeroed right_complementable distributive doubleLoopStr
for b3, b4 being Series of b1,b2
for b5 being Element of b2 holds b5 * (b3 *' b4) = b3 *' (b5 * b4)
proof end;

definition
let c1 be Ordinal;
let c2 be bag of c1;
let c3 be non empty ZeroStr ;
let c4 be Series of c1,c3;
func c2 *' c4 -> Series of a1,a3 means :Def1: :: POLYRED:def 1
for b1 being bag of a1 st a2 divides b1 holds
( a5 . b1 = a4 . (b1 -' a2) & ( for b2 being bag of a1 st not a2 divides b2 holds
a5 . b2 = 0. a3 ) );
existence
ex b1 being Series of c1,c3 st
for b2 being bag of c1 st c2 divides b2 holds
( b1 . b2 = c4 . (b2 -' c2) & ( for b3 being bag of c1 st not c2 divides b3 holds
b1 . b3 = 0. c3 ) )
proof end;
uniqueness
for b1, b2 being Series of c1,c3 st ( for b3 being bag of c1 st c2 divides b3 holds
( b1 . b3 = c4 . (b3 -' c2) & ( for b4 being bag of c1 st not c2 divides b4 holds
b1 . b4 = 0. c3 ) ) ) & ( for b3 being bag of c1 st c2 divides b3 holds
( b2 . b3 = c4 . (b3 -' c2) & ( for b4 being bag of c1 st not c2 divides b4 holds
b2 . b4 = 0. c3 ) ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def1 defines *' POLYRED:def 1 :
for b1 being Ordinal
for b2 being bag of b1
for b3 being non empty ZeroStr
for b4, b5 being Series of b1,b3 holds
( b5 = b2 *' b4 iff for b6 being bag of b1 st b2 divides b6 holds
( b5 . b6 = b4 . (b6 -' b2) & ( for b7 being bag of b1 st not b2 divides b7 holds
b5 . b7 = 0. b3 ) ) );

Lemma22: for b1 being Ordinal
for b2, b3 being bag of b1
for b4 being non empty ZeroStr
for b5 being Series of b1,b4 holds (b2 *' b5) . (b3 + b2) = b5 . b3
proof end;

Lemma23: for b1 being Ordinal
for b2 being non empty ZeroStr
for b3 being Polynomial of b1,b2
for b4 being bag of b1 holds Support (b4 *' b3) c= { (b4 + b5) where B is Element of Bags b1 : b5 in Support b3 }
proof end;

registration
let c1 be Ordinal;
let c2 be bag of c1;
let c3 be non empty ZeroStr ;
let c4 be finite-Support Series of c1,c3;
cluster a2 *' a4 -> finite-Support ;
coherence
c2 *' c4 is finite-Support
proof end;
end;

theorem Th13: :: POLYRED:13
for b1 being Ordinal
for b2, b3 being bag of b1
for b4 being non empty ZeroStr
for b5 being Series of b1,b4 holds (b2 *' b5) . (b3 + b2) = b5 . b3 by Lemma22;

theorem Th14: :: POLYRED:14
for b1 being Ordinal
for b2 being non empty ZeroStr
for b3 being Polynomial of b1,b2
for b4 being bag of b1 holds Support (b4 *' b3) c= { (b4 + b5) where B is Element of Bags b1 : b5 in Support b3 } by Lemma23;

theorem Th15: :: POLYRED:15
for b1 being Ordinal
for b2 being connected admissible TermOrder of b1
for b3 being non trivial ZeroStr
for b4 being non-zero Polynomial of b1,b3
for b5 being bag of b1 holds HT (b5 *' b4),b2 = b5 + (HT b4,b2)
proof end;

theorem Th16: :: POLYRED:16
for b1 being Ordinal
for b2 being connected admissible TermOrder of b1
for b3 being non empty ZeroStr
for b4 being Polynomial of b1,b3
for b5, b6 being bag of b1 st b6 in Support (b5 *' b4) holds
b6 <= b5 + (HT b4,b2),b2
proof end;

theorem Th17: :: POLYRED:17
for b1 being Ordinal
for b2 being connected TermOrder of b1
for b3 being non empty ZeroStr
for b4 being Series of b1,b3 holds (EmptyBag b1) *' b4 = b4
proof end;

theorem Th18: :: POLYRED:18
for b1 being Ordinal
for b2 being connected TermOrder of b1
for b3 being non empty ZeroStr
for b4 being Series of b1,b3
for b5, b6 being bag of b1 holds (b5 + b6) *' b4 = b5 *' (b6 *' b4)
proof end;

theorem Th19: :: POLYRED:19
for b1 being Ordinal
for b2 being add-associative right_zeroed right_complementable distributive non trivial doubleLoopStr
for b3 being Polynomial of b1,b2
for b4 being Element of b2 holds Support (b4 * b3) c= Support b3
proof end;

theorem Th20: :: POLYRED:20
for b1 being Ordinal
for b2 being domRing-like non trivial doubleLoopStr
for b3 being Polynomial of b1,b2
for b4 being non-zero Element of b2 holds Support b3 c= Support (b4 * b3)
proof end;

theorem Th21: :: POLYRED:21
for b1 being Ordinal
for b2 being connected TermOrder of b1
for b3 being add-associative right_zeroed right_complementable distributive domRing-like non trivial doubleLoopStr
for b4 being Polynomial of b1,b3
for b5 being non-zero Element of b3 holds HT (b5 * b4),b2 = HT b4,b2
proof end;

theorem Th22: :: POLYRED:22
for b1 being Ordinal
for b2 being add-associative right_zeroed right_complementable distributive non trivial doubleLoopStr
for b3 being Series of b1,b2
for b4 being bag of b1
for b5 being Element of b2 holds b5 * (b4 *' b3) = (Monom b5,b4) *' b3
proof end;

theorem Th23: :: POLYRED:23
for b1 being Ordinal
for b2 being connected admissible TermOrder of b1
for b3 being unital add-associative right_zeroed right_complementable distributive domRing-like non trivial doubleLoopStr
for b4 being non-zero Polynomial of b1,b3
for b5 being Polynomial of b1,b3
for b6 being non-zero Monomial of b1,b3 st HT b4,b2 in Support b5 holds
HT (b6 *' b4),b2 in Support (b6 *' b5)
proof end;

registration
let c1 be Ordinal;
let c2 be connected TermOrder of c1;
cluster RelStr(# (Bags a1),a2 #) -> connected ;
coherence
RelStr(# (Bags c1),c2 #) is connected
proof end;
end;

registration
let c1 be Nat;
let c2 be admissible TermOrder of c1;
cluster RelStr(# (Bags a1),a2 #) -> well_founded ;
coherence
RelStr(# (Bags c1),c2 #) is well_founded
proof end;
end;

Lemma30: for b1 being Ordinal
for b2 being connected TermOrder of b1
for b3 being non empty ZeroStr
for b4 being Polynomial of b1,b3 holds Support b4 in Fin the carrier of RelStr(# (Bags b1),b2 #)
proof end;

definition
let c1 be Ordinal;
let c2 be connected TermOrder of c1;
let c3 be non empty ZeroStr ;
let c4, c5 be Polynomial of c1,c3;
pred c4 <= c5,c2 means :Def2: :: POLYRED:def 2
[(Support a4),(Support a5)] in FinOrd RelStr(# (Bags a1),a2 #);
end;

:: deftheorem Def2 defines <= POLYRED:def 2 :
for b1 being Ordinal
for b2 being connected TermOrder of b1
for b3 being non empty ZeroStr
for b4, b5 being Polynomial of b1,b3 holds
( b4 <= b5,b2 iff [(Support b4),(Support b5)] in FinOrd RelStr(# (Bags b1),b2 #) );

definition
let c1 be Ordinal;
let c2 be connected TermOrder of c1;
let c3 be non empty ZeroStr ;
let c4, c5 be Polynomial of c1,c3;
pred c4 < c5,c2 means :Def3: :: POLYRED:def 3
( a4 <= a5,a2 & Support a4 <> Support a5 );
end;

:: deftheorem Def3 defines < POLYRED:def 3 :
for b1 being Ordinal
for b2 being connected TermOrder of b1
for b3 being non empty ZeroStr
for b4, b5 being Polynomial of b1,b3 holds
( b4 < b5,b2 iff ( b4 <= b5,b2 & Support b4 <> Support b5 ) );

definition
let c1 be Ordinal;
let c2 be connected TermOrder of c1;
let c3 be non empty ZeroStr ;
let c4 be Polynomial of c1,c3;
func Support c4,c2 -> Element of Fin the carrier of RelStr(# (Bags a1),a2 #) equals :: POLYRED:def 4
Support a4;
coherence
Support c4 is Element of Fin the carrier of RelStr(# (Bags c1),c2 #)
by Lemma30;
end;

:: deftheorem Def4 defines Support POLYRED:def 4 :
for b1 being Ordinal
for b2 being connected TermOrder of b1
for b3 being non empty ZeroStr
for b4 being Polynomial of b1,b3 holds Support b4,b2 = Support b4;

theorem Th24: :: POLYRED:24
for b1 being Ordinal
for b2 being connected TermOrder of b1
for b3 being non trivial ZeroStr
for b4 being non-zero Polynomial of b1,b3 holds PosetMax (Support b4,b2) = HT b4,b2
proof end;

theorem Th25: :: POLYRED:25
for b1 being Ordinal
for b2 being connected TermOrder of b1
for b3 being non empty LoopStr
for b4 being Polynomial of b1,b3 holds b4 <= b4,b2
proof end;

Lemma35: for b1 being Ordinal
for b2 being connected TermOrder of b1
for b3 being non empty ZeroStr
for b4 being Polynomial of b1,b3 holds 0_ b1,b3 <= b4,b2
proof end;

theorem Th26: :: POLYRED:26
for b1 being Ordinal
for b2 being connected TermOrder of b1
for b3 being non empty LoopStr
for b4, b5 being Polynomial of b1,b3 holds
( ( b4 <= b5,b2 & b5 <= b4,b2 ) iff Support b4 = Support b5 )
proof end;

theorem Th27: :: POLYRED:27
for b1 being Ordinal
for b2 being connected TermOrder of b1
for b3 being non empty LoopStr
for b4, b5, b6 being Polynomial of b1,b3 st b4 <= b5,b2 & b5 <= b6,b2 holds
b4 <= b6,b2
proof end;

theorem Th28: :: POLYRED:28
for b1 being Ordinal
for b2 being connected TermOrder of b1
for b3 being non empty LoopStr
for b4, b5 being Polynomial of b1,b3 holds
( b4 <= b5,b2 or b5 <= b4,b2 )
proof end;

theorem Th29: :: POLYRED:29
for b1 being Ordinal
for b2 being connected TermOrder of b1
for b3 being non empty LoopStr
for b4, b5 being Polynomial of b1,b3 holds
( b4 <= b5,b2 iff not b5 < b4,b2 )
proof end;

Lemma40: for b1 being Ordinal
for b2 being connected TermOrder of b1
for b3 being add-associative right_zeroed right_complementable non trivial LoopStr
for b4 being Polynomial of b1,b3
for b5 being bag of b1 st [(HT b4,b2),b5] in b2 & b5 <> HT b4,b2 holds
b4 . b5 = 0. b3
proof end;

Lemma41: for b1 being Ordinal
for b2 being connected admissible TermOrder of b1
for b3 being add-associative right_zeroed right_complementable non trivial LoopStr
for b4 being Polynomial of b1,b3 st HT b4,b2 = EmptyBag b1 holds
Red b4,b2 = 0_ b1,b3
proof end;

Lemma42: for b1 being Ordinal
for b2 being connected admissible TermOrder of b1
for b3 being add-associative right_zeroed right_complementable non trivial LoopStr
for b4, b5 being Polynomial of b1,b3 holds
( b4 < b5,b2 iff ( ( b4 = 0_ b1,b3 & b5 <> 0_ b1,b3 ) or HT b4,b2 < HT b5,b2,b2 or ( HT b4,b2 = HT b5,b2 & Red b4,b2 < Red b5,b2,b2 ) ) )
proof end;

theorem Th30: :: POLYRED:30
for b1 being Ordinal
for b2 being connected TermOrder of b1
for b3 being non empty ZeroStr
for b4 being Polynomial of b1,b3 holds 0_ b1,b3 <= b4,b2 by Lemma35;

Lemma43: for b1 being Ordinal
for b2 being connected admissible TermOrder of b1
for b3 being add-associative right_zeroed right_complementable non trivial LoopStr
for b4, b5 being Polynomial of b1,b3 st b5 <> 0_ b1,b3 & HT b4,b2 = HT b5,b2 & Red b4,b2 <= Red b5,b2,b2 holds
b4 <= b5,b2
proof end;

theorem Th31: :: POLYRED:31
for b1 being Nat
for b2 being connected admissible TermOrder of b1
for b3 being unital add-associative right_zeroed right_complementable distributive non trivial doubleLoopStr
for b4 being non empty Subset of (Polynom-Ring b1,b3) ex b5 being Polynomial of b1,b3 st
( b5 in b4 & ( for b6 being Polynomial of b1,b3 st b6 in b4 holds
b5 <= b6,b2 ) )
proof end;

theorem Th32: :: POLYRED:32
for b1 being Ordinal
for b2 being connected admissible TermOrder of b1
for b3 being add-associative right_zeroed right_complementable non trivial LoopStr
for b4, b5 being Polynomial of b1,b3 holds
( b4 < b5,b2 iff ( ( b4 = 0_ b1,b3 & b5 <> 0_ b1,b3 ) or HT b4,b2 < HT b5,b2,b2 or ( HT b4,b2 = HT b5,b2 & Red b4,b2 < Red b5,b2,b2 ) ) ) by Lemma42;

theorem Th33: :: POLYRED:33
for b1 being Ordinal
for b2 being connected admissible TermOrder of b1
for b3 being add-associative right_zeroed right_complementable non trivial LoopStr
for b4 being non-zero Polynomial of b1,b3 holds Red b4,b2 < HM b4,b2,b2
proof end;

theorem Th34: :: POLYRED:34
for b1 being Ordinal
for b2 being connected TermOrder of b1
for b3 being add-associative right_zeroed right_complementable non trivial LoopStr
for b4 being Polynomial of b1,b3 holds HM b4,b2 <= b4,b2
proof end;

theorem Th35: :: POLYRED:35
for b1 being Ordinal
for b2 being connected admissible TermOrder of b1
for b3 being add-associative right_zeroed right_complementable non trivial LoopStr
for b4 being non-zero Polynomial of b1,b3 holds Red b4,b2 < b4,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, c6 be Polynomial of c1,c3;
let c7 be bag of c1;
pred c4 reduces_to c6,c5,c7,c2 means :Def5: :: POLYRED:def 5
( a4 <> 0_ a1,a3 & a5 <> 0_ a1,a3 & a7 in Support a4 & ex b1 being bag of a1 st
( b1 + (HT a5,a2) = a7 & a6 = a4 - (((a4 . a7) / (HC a5,a2)) * (b1 *' a5)) ) );
end;

:: deftheorem Def5 defines reduces_to POLYRED: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, b5, b6 being Polynomial of b1,b3
for b7 being bag of b1 holds
( b4 reduces_to b6,b5,b7,b2 iff ( b4 <> 0_ b1,b3 & b5 <> 0_ b1,b3 & b7 in Support b4 & ex b8 being bag of b1 st
( b8 + (HT b5,b2) = b7 & b6 = b4 - (((b4 . b7) / (HC b5,b2)) * (b8 *' b5)) ) ) );

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, c6 be Polynomial of c1,c3;
pred c4 reduces_to c6,c5,c2 means :Def6: :: POLYRED:def 6
ex b1 being bag of a1 st a4 reduces_to a6,a5,b1,a2;
end;

:: deftheorem Def6 defines reduces_to POLYRED:def 6 :
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 holds
( b4 reduces_to b6,b5,b2 iff ex b7 being bag of b1 st b4 reduces_to b6,b5,b7,b2 );

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;
let c6 be Subset of (Polynom-Ring c1,c3);
pred c4 reduces_to c5,c6,c2 means :Def7: :: POLYRED:def 7
ex b1 being Polynomial of a1,a3 st
( b1 in a6 & a4 reduces_to a5,b1,a2 );
end;

:: deftheorem Def7 defines reduces_to POLYRED:def 7 :
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) holds
( b4 reduces_to b5,b6,b2 iff ex b7 being Polynomial of b1,b3 st
( b7 in b6 & b4 reduces_to b5,b7,b2 ) );

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;
pred c4 is_reducible_wrt c5,c2 means :Def8: :: POLYRED:def 8
ex b1 being Polynomial of a1,a3 st a4 reduces_to b1,a5,a2;
end;

:: deftheorem Def8 defines is_reducible_wrt POLYRED:def 8 :
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
( b4 is_reducible_wrt b5,b2 iff ex b6 being Polynomial of b1,b3 st b4 reduces_to b6,b5,b2 );

notation
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;
antonym c4 is_irreducible_wrt c5,c2 for c4 is_reducible_wrt c5,c2;
antonym c4 is_in_normalform_wrt c5,c2 for c4 is_reducible_wrt c5,c2;
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 Polynomial of c1,c3;
let c5 be Subset of (Polynom-Ring c1,c3);
pred c4 is_reducible_wrt c5,c2 means :: POLYRED:def 9
ex b1 being Polynomial of a1,a3 st a4 reduces_to b1,a5,a2;
end;

:: deftheorem Def9 defines is_reducible_wrt POLYRED:def 9 :
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 Subset of (Polynom-Ring b1,b3) holds
( b4 is_reducible_wrt b5,b2 iff ex b6 being Polynomial of b1,b3 st b4 reduces_to b6,b5,b2 );

notation
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 Polynomial of c1,c3;
let c5 be Subset of (Polynom-Ring c1,c3);
antonym c4 is_irreducible_wrt c5,c2 for c4 is_reducible_wrt c5,c2;
antonym c4 is_in_normalform_wrt c5,c2 for c4 is_reducible_wrt c5,c2;
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, c6 be Polynomial of c1,c3;
pred c4 top_reduces_to c6,c5,c2 means :: POLYRED:def 10
a4 reduces_to a6,a5, HT a4,a2,a2;
end;

:: deftheorem Def10 defines top_reduces_to POLYRED:def 10 :
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 holds
( b4 top_reduces_to b6,b5,b2 iff b4 reduces_to b6,b5, HT b4,b2,b2 );

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;
pred c4 is_top_reducible_wrt c5,c2 means :: POLYRED:def 11
ex b1 being Polynomial of a1,a3 st a4 top_reduces_to b1,a5,a2;
end;

:: deftheorem Def11 defines is_top_reducible_wrt POLYRED:def 11 :
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
( b4 is_top_reducible_wrt b5,b2 iff ex b6 being Polynomial of b1,b3 st b4 top_reduces_to b6,b5,b2 );

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 Polynomial of c1,c3;
let c5 be Subset of (Polynom-Ring c1,c3);
pred c4 is_top_reducible_wrt c5,c2 means :: POLYRED:def 12
ex b1 being Polynomial of a1,a3 st
( b1 in a5 & a4 is_top_reducible_wrt b1,a2 );
end;

:: deftheorem Def12 defines is_top_reducible_wrt POLYRED:def 12 :
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 Subset of (Polynom-Ring b1,b3) holds
( b4 is_top_reducible_wrt b5,b2 iff ex b6 being Polynomial of b1,b3 st
( b6 in b5 & b4 is_top_reducible_wrt b6,b2 ) );

theorem Th36: :: POLYRED:36
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 non-zero Polynomial of b1,b3 holds
( b4 is_reducible_wrt b5,b2 iff ex b6 being bag of b1 st
( b6 in Support b4 & HT b5,b2 divides b6 ) )
proof end;

Lemma52: 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
for b7 being bag of b1 st b4 reduces_to b6,b5,b7,b2 holds
not b7 in Support b6
proof end;

theorem Th37: :: POLYRED:37
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 0_ b1,b3 is_irreducible_wrt b4,b2
proof end;

theorem Th38: :: POLYRED:38
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 being non-zero Monomial of b1,b3 st b4 reduces_to b4 - (b6 *' b5),b5,b2 holds
HT (b6 *' b5),b2 in Support b4
proof end;

theorem Th39: :: POLYRED:39
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 degenerated doubleLoopStr
for b4, b5, b6 being Polynomial of b1,b3
for b7 being bag of b1 st b4 reduces_to b6,b5,b7,b2 holds
not b7 in Support b6 by Lemma52;

theorem Th40: :: POLYRED:40
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, b6 being Polynomial of b1,b3
for b7, b8 being bag of b1 st b7 < b8,b2 & b4 reduces_to b6,b5,b7,b2 holds
( b8 in Support b6 iff b8 in Support b4 )
proof end;

theorem Th41: :: POLYRED:41
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, b6 being Polynomial of b1,b3
for b7, b8 being bag of b1 st b7 < b8,b2 & b4 reduces_to b6,b5,b7,b2 holds
b4 . b8 = b6 . b8
proof end;

theorem Th42: :: POLYRED:42
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, b6 being Polynomial of b1,b3 st b4 reduces_to b6,b5,b2 holds
for b7 being bag of b1 st b7 in Support b6 holds
b7 <= HT b4,b2,b2
proof end;

theorem Th43: :: POLYRED: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, b5, b6 being Polynomial of b1,b3 st b4 reduces_to b6,b5,b2 holds
b6 < b4,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 PolyRedRel c4,c2 -> Relation of the carrier of (Polynom-Ring a1,a3) \ {(0_ a1,a3)},the carrier of (Polynom-Ring a1,a3) means :Def13: :: POLYRED:def 13
for b1, b2 being Polynomial of a1,a3 holds
( [b1,b2] in a5 iff b1 reduces_to b2,a4,a2 );
existence
ex b1 being Relation of the carrier of (Polynom-Ring c1,c3) \ {(0_ c1,c3)},the carrier of (Polynom-Ring c1,c3) st
for b2, b3 being Polynomial of c1,c3 holds
( [b2,b3] in b1 iff b2 reduces_to b3,c4,c2 )
proof end;
uniqueness
for b1, b2 being Relation of the carrier of (Polynom-Ring c1,c3) \ {(0_ c1,c3)},the carrier of (Polynom-Ring c1,c3) st ( for b3, b4 being Polynomial of c1,c3 holds
( [b3,b4] in b1 iff b3 reduces_to b4,c4,c2 ) ) & ( for b3, b4 being Polynomial of c1,c3 holds
( [b3,b4] in b2 iff b3 reduces_to b4,c4,c2 ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def13 defines PolyRedRel POLYRED:def 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)
for b5 being Relation of the carrier of (Polynom-Ring b1,b3) \ {(0_ b1,b3)},the carrier of (Polynom-Ring b1,b3) holds
( b5 = PolyRedRel b4,b2 iff for b6, b7 being Polynomial of b1,b3 holds
( [b6,b7] in b5 iff b6 reduces_to b7,b4,b2 ) );

Lemma59: 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 b5,b6,b2 holds
( b4 <> 0_ b1,b3 & b6 <> 0_ b1,b3 )
proof end;

theorem Th44: :: POLYRED:44
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 being Subset of (Polynom-Ring b1,b3) st PolyRedRel b6,b2 reduces b4,b5 holds
( b5 <= b4,b2 & ( b5 = 0_ b1,b3 or HT b5,b2 <= HT b4,b2,b2 ) )
proof end;

registration
let c1 be Nat;
let c2 be connected admissible TermOrder of c1;
let c3 be non empty unital associative commutative Abelian add-associative right_zeroed right_complementable distributive Field-like non degenerated doubleLoopStr ;
let c4 be Subset of (Polynom-Ring c1,c3);
cluster PolyRedRel a4,a2 -> strongly-normalizing ;
coherence
PolyRedRel c4,c2 is strongly-normalizing
proof end;
end;

theorem Th45: :: POLYRED:45
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 left_zeroed non trivial doubleLoopStr
for b4 being Subset of (Polynom-Ring b1,b3)
for b5, b6 being Polynomial of b1,b3 st b5 in b4 holds
PolyRedRel b4,b2 reduces b6 *' b5, 0_ b1,b3
proof end;

theorem Th46: :: POLYRED:46
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 Subset of (Polynom-Ring b1,b3)
for b5, b6 being Polynomial of b1,b3
for b7 being non-zero Monomial of b1,b3 st b5 reduces_to b6,b4,b2 holds
b7 *' b5 reduces_to b7 *' b6,b4,b2
proof end;

theorem Th47: :: POLYRED:47
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 Subset of (Polynom-Ring b1,b3)
for b5, b6 being Polynomial of b1,b3
for b7 being Monomial of b1,b3 st PolyRedRel b4,b2 reduces b5,b6 holds
PolyRedRel b4,b2 reduces b7 *' b5,b7 *' b6
proof end;

theorem Th48: :: POLYRED:48
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 Subset of (Polynom-Ring b1,b3)
for b5 being Polynomial of b1,b3
for b6 being Monomial of b1,b3 st PolyRedRel b4,b2 reduces b5, 0_ b1,b3 holds
PolyRedRel b4,b2 reduces b6 *' b5, 0_ b1,b3
proof end;

theorem Th49: :: POLYRED:49
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, b7, b8 being Polynomial of b1,b3 st b5 - b6 = b7 & PolyRedRel b4,b2 reduces b7,b8 holds
ex b9, b10 being Polynomial of b1,b3 st
( b9 - b10 = b8 & PolyRedRel b4,b2 reduces b5,b9 & PolyRedRel b4,b2 reduces b6,b10 )
proof end;

theorem Th50: :: POLYRED:50
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 PolyRedRel b4,b2 reduces b5 - b6, 0_ b1,b3 holds
b5,b6 are_convergent_wrt PolyRedRel b4,b2
proof end;

theorem Th51: :: POLYRED:51
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 PolyRedRel b4,b2 reduces b5 - b6, 0_ b1,b3 holds
b5,b6 are_convertible_wrt PolyRedRel b4,b2
proof end;

definition
let c1 be non empty LoopStr ;
let c2 be Subset of c1;
let c3, c4 be Element of c1;
pred c3,c4 are_congruent_mod c2 means :Def14: :: POLYRED:def 14
a3 - a4 in a2;
end;

:: deftheorem Def14 defines are_congruent_mod POLYRED:def 14 :
for b1 being non empty LoopStr
for b2 being Subset of b1
for b3, b4 being Element of b1 holds
( b3,b4 are_congruent_mod b2 iff b3 - b4 in b2 );

theorem Th52: :: POLYRED:52
for b1 being non empty add-associative right_zeroed right_complementable right-distributive left_zeroed doubleLoopStr
for b2 being non empty right-ideal Subset of b1
for b3 being Element of b1 holds b3,b3 are_congruent_mod b2
proof end;

theorem Th53: :: POLYRED:53
for b1 being non empty add-associative right_zeroed right_complementable right-distributive right_unital doubleLoopStr
for b2 being non empty right-ideal Subset of b1
for b3, b4 being Element of b1 st b3,b4 are_congruent_mod b2 holds
b4,b3 are_congruent_mod b2
proof end;

theorem Th54: :: POLYRED:54
for b1 being non empty add-associative right_zeroed right_complementable LoopStr
for b2 being non empty add-closed Subset of b1
for b3, b4, b5 being Element of b1 st b3,b4 are_congruent_mod b2 & b4,b5 are_congruent_mod b2 holds
b3,b5 are_congruent_mod b2
proof end;

theorem Th55: :: POLYRED:55
for b1 being unital associative Abelian add-associative right_zeroed right_complementable distributive non trivial doubleLoopStr
for b2 being non empty add-closed Subset of b1
for b3, b4, b5, b6 being Element of b1 st b3,b4 are_congruent_mod b2 & b5,b6 are_congruent_mod b2 holds
b3 + b5,b4 + b6 are_congruent_mod b2
proof end;

theorem Th56: :: POLYRED:56
for b1 being non empty commutative add-associative right_zeroed right_complementable distributive doubleLoopStr
for b2 being non empty add-closed right-ideal Subset of b1
for b3, b4, b5, b6 being Element of b1 st b3,b4 are_congruent_mod b2 & b5,b6 are_congruent_mod b2 holds
b3 * b5,b4 * b6 are_congruent_mod b2
proof end;

Lemma69: 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 being non-zero Polynomial of b1,b3
for b6 being Polynomial of b1,b3
for b7, b8 being Element of (Polynom-Ring b1,b3) st b5 = b7 & b6 = b8 & b5 reduces_to b6,b4,b2 holds
b7,b8 are_congruent_mod b4 -Ideal
proof end;

theorem Th57: :: POLYRED:57
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 Element of (Polynom-Ring b1,b3) st b5,b6 are_convertible_wrt PolyRedRel b4,b2 holds
b5,b6 are_congruent_mod b4 -Ideal
proof end;

Lemma71: 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)
for b5, b6, b7 being Element of (Polynom-Ring b1,b3) st b6 in b4 & b6 <> 0_ b1,b3 & b7 <> 0_ b1,b3 holds
b5,b5 + (b7 * b6) are_convertible_wrt PolyRedRel b4,b2
proof end;

theorem Th58: :: POLYRED:58
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)
for b5, b6 being Element of (Polynom-Ring b1,b3) st b5,b6 are_congruent_mod b4 -Ideal holds
b5,b6 are_convertible_wrt PolyRedRel b4,b2
proof end;

theorem Th59: :: POLYRED:59
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 PolyRedRel b4,b2 reduces b5,b6 holds
b5 - b6 in b4 -Ideal
proof end;

theorem Th60: :: POLYRED:60
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 being Polynomial of b1,b3 st PolyRedRel b4,b2 reduces b5, 0_ b1,b3 holds
b5 in b4 -Ideal
proof end;