:: POLYNOM4 semantic presentation

Lemma1: for b1 being Nat holds 0 -' b1 = 0
by NAT_2:10;

theorem Th1: :: POLYNOM4:1
canceled;

theorem Th2: :: POLYNOM4:2
canceled;

theorem Th3: :: POLYNOM4:3
for b1 being non empty set
for b2 being FinSequence of b1
for b3 being Nat st 1 <= b3 & b3 <= len b2 holds
b2 = ((b2 | (b3 -' 1)) ^ <*(b2 . b3)*>) ^ (b2 /^ b3)
proof end;

Lemma3: for b1 being non empty right-distributive left_zeroed add-right-cancelable doubleLoopStr
for b2 being Element of b1 holds b2 * (0. b1) = 0. b1
proof end;

registration
cluster non empty associative commutative right-distributive left_unital Field-like left_zeroed add-right-cancelable -> non empty associative commutative right-distributive left_unital domRing-like left_zeroed add-right-cancelable doubleLoopStr ;
coherence
for b1 being non empty associative commutative right-distributive left_unital left_zeroed add-right-cancelable doubleLoopStr st b1 is Field-like holds
b1 is domRing-like
proof end;
end;

registration
cluster non empty Abelian add-associative right_zeroed right_complementable unital associative commutative strict distributive Field-like non degenerated domRing-like non trivial doubleLoopStr ;
existence
ex b1 being non empty doubleLoopStr st
( b1 is strict & b1 is Abelian & b1 is add-associative & b1 is right_zeroed & b1 is right_complementable & b1 is associative & b1 is commutative & b1 is distributive & b1 is unital & b1 is domRing-like & b1 is Field-like & not b1 is degenerated & not b1 is trivial )
proof end;
end;

theorem Th4: :: POLYNOM4:4
canceled;

theorem Th5: :: POLYNOM4:5
for b1 being non empty add-associative right_zeroed right_complementable left-distributive doubleLoopStr
for b2 being sequence of b1 holds (0_. b1) *' b2 = 0_. b1
proof end;

theorem Th6: :: POLYNOM4:6
for b1 being non empty ZeroStr holds len (0_. b1) = 0
proof end;

theorem Th7: :: POLYNOM4:7
for b1 being non empty non degenerated multLoopStr_0 holds len (1_. b1) = 1
proof end;

theorem Th8: :: POLYNOM4:8
for b1 being non empty ZeroStr
for b2 being Polynomial of b1 st len b2 = 0 holds
b2 = 0_. b1
proof end;

theorem Th9: :: POLYNOM4:9
for b1 being non empty right_zeroed LoopStr
for b2, b3 being Polynomial of b1
for b4 being Nat st b4 >= len b2 & b4 >= len b3 holds
b4 >= len (b2 + b3)
proof end;

theorem Th10: :: POLYNOM4:10
for b1 being non empty add-associative right_zeroed right_complementable LoopStr
for b2, b3 being Polynomial of b1 st len b2 <> len b3 holds
len (b2 + b3) = max (len b2),(len b3)
proof end;

theorem Th11: :: POLYNOM4:11
for b1 being non empty add-associative right_zeroed right_complementable LoopStr
for b2 being Polynomial of b1 holds len (- b2) = len b2
proof end;

theorem Th12: :: POLYNOM4:12
for b1 being non empty add-associative right_zeroed right_complementable LoopStr
for b2, b3 being Polynomial of b1
for b4 being Nat st b4 >= len b2 & b4 >= len b3 holds
b4 >= len (b2 - b3)
proof end;

theorem Th13: :: POLYNOM4:13
for b1 being non empty add-associative right_zeroed right_complementable associative commutative distributive left_unital doubleLoopStr
for b2, b3 being Polynomial of b1 st (b2 . ((len b2) -' 1)) * (b3 . ((len b3) -' 1)) <> 0. b1 holds
len (b2 *' b3) = ((len b2) + (len b3)) - 1
proof end;

definition
let c1 be non empty ZeroStr ;
let c2 be Polynomial of c1;
func Leading-Monomial c2 -> sequence of a1 means :Def1: :: POLYNOM4:def 1
( a3 . ((len a2) -' 1) = a2 . ((len a2) -' 1) & ( for b1 being Nat st b1 <> (len a2) -' 1 holds
a3 . b1 = 0. a1 ) );
existence
ex b1 being sequence of c1 st
( b1 . ((len c2) -' 1) = c2 . ((len c2) -' 1) & ( for b2 being Nat st b2 <> (len c2) -' 1 holds
b1 . b2 = 0. c1 ) )
proof end;
uniqueness
for b1, b2 being sequence of c1 st b1 . ((len c2) -' 1) = c2 . ((len c2) -' 1) & ( for b3 being Nat st b3 <> (len c2) -' 1 holds
b1 . b3 = 0. c1 ) & b2 . ((len c2) -' 1) = c2 . ((len c2) -' 1) & ( for b3 being Nat st b3 <> (len c2) -' 1 holds
b2 . b3 = 0. c1 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def1 defines Leading-Monomial POLYNOM4:def 1 :
for b1 being non empty ZeroStr
for b2 being Polynomial of b1
for b3 being sequence of b1 holds
( b3 = Leading-Monomial b2 iff ( b3 . ((len b2) -' 1) = b2 . ((len b2) -' 1) & ( for b4 being Nat st b4 <> (len b2) -' 1 holds
b3 . b4 = 0. b1 ) ) );

theorem Th14: :: POLYNOM4:14
for b1 being non empty ZeroStr
for b2 being Polynomial of b1 holds Leading-Monomial b2 = (0_. b1) +* ((len b2) -' 1),(b2 . ((len b2) -' 1))
proof end;

registration
let c1 be non empty ZeroStr ;
let c2 be Polynomial of c1;
cluster Leading-Monomial a2 -> finite-Support ;
coherence
Leading-Monomial c2 is finite-Support
proof end;
end;

theorem Th15: :: POLYNOM4:15
for b1 being non empty ZeroStr
for b2 being Polynomial of b1 st len b2 = 0 holds
Leading-Monomial b2 = 0_. b1
proof end;

theorem Th16: :: POLYNOM4:16
for b1 being non empty ZeroStr holds Leading-Monomial (0_. b1) = 0_. b1
proof end;

theorem Th17: :: POLYNOM4:17
for b1 being non empty non degenerated multLoopStr_0 holds Leading-Monomial (1_. b1) = 1_. b1
proof end;

theorem Th18: :: POLYNOM4:18
for b1 being non empty ZeroStr
for b2 being Polynomial of b1 holds len (Leading-Monomial b2) = len b2
proof end;

theorem Th19: :: POLYNOM4:19
for b1 being non empty add-associative right_zeroed right_complementable LoopStr
for b2 being Polynomial of b1 st len b2 <> 0 holds
ex b3 being Polynomial of b1 st
( len b3 < len b2 & b2 = b3 + (Leading-Monomial b2) & ( for b4 being Nat st b4 < (len b2) - 1 holds
b3 . b4 = b2 . b4 ) )
proof end;

definition
let c1 be non empty unital doubleLoopStr ;
let c2 be Polynomial of c1;
let c3 be Element of c1;
func eval c2,c3 -> Element of a1 means :Def2: :: POLYNOM4:def 2
ex b1 being FinSequence of the carrier of a1 st
( a4 = Sum b1 & len b1 = len a2 & ( for b2 being Nat st b2 in dom b1 holds
b1 . b2 = (a2 . (b2 -' 1)) * ((power a1) . a3,(b2 -' 1)) ) );
existence
ex b1 being Element of c1ex b2 being FinSequence of the carrier of c1 st
( b1 = Sum b2 & len b2 = len c2 & ( for b3 being Nat st b3 in dom b2 holds
b2 . b3 = (c2 . (b3 -' 1)) * ((power c1) . c3,(b3 -' 1)) ) )
proof end;
uniqueness
for b1, b2 being Element of c1 st ex b3 being FinSequence of the carrier of c1 st
( b1 = Sum b3 & len b3 = len c2 & ( for b4 being Nat st b4 in dom b3 holds
b3 . b4 = (c2 . (b4 -' 1)) * ((power c1) . c3,(b4 -' 1)) ) ) & ex b3 being FinSequence of the carrier of c1 st
( b2 = Sum b3 & len b3 = len c2 & ( for b4 being Nat st b4 in dom b3 holds
b3 . b4 = (c2 . (b4 -' 1)) * ((power c1) . c3,(b4 -' 1)) ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def2 defines eval POLYNOM4:def 2 :
for b1 being non empty unital doubleLoopStr
for b2 being Polynomial of b1
for b3, b4 being Element of b1 holds
( b4 = eval b2,b3 iff ex b5 being FinSequence of the carrier of b1 st
( b4 = Sum b5 & len b5 = len b2 & ( for b6 being Nat st b6 in dom b5 holds
b5 . b6 = (b2 . (b6 -' 1)) * ((power b1) . b3,(b6 -' 1)) ) ) );

theorem Th20: :: POLYNOM4:20
for b1 being non empty unital doubleLoopStr
for b2 being Element of b1 holds eval (0_. b1),b2 = 0. b1
proof end;

theorem Th21: :: POLYNOM4:21
for b1 being non empty add-associative right_zeroed right_complementable unital associative non degenerated doubleLoopStr
for b2 being Element of b1 holds eval (1_. b1),b2 = 1. b1
proof end;

Lemma19: for b1 being non empty add-associative right_zeroed right_complementable left-distributive doubleLoopStr
for b2 being Element of b1 holds (0. b1) * b2 = 0. b1
proof end;

theorem Th22: :: POLYNOM4:22
for b1 being non empty Abelian add-associative right_zeroed right_complementable unital left-distributive doubleLoopStr
for b2, b3 being Polynomial of b1
for b4 being Element of b1 holds eval (b2 + b3),b4 = (eval b2,b4) + (eval b3,b4)
proof end;

theorem Th23: :: POLYNOM4:23
for b1 being non empty Abelian add-associative right_zeroed right_complementable unital distributive doubleLoopStr
for b2 being Polynomial of b1
for b3 being Element of b1 holds eval (- b2),b3 = - (eval b2,b3)
proof end;

theorem Th24: :: POLYNOM4:24
for b1 being non empty Abelian add-associative right_zeroed right_complementable unital distributive doubleLoopStr
for b2, b3 being Polynomial of b1
for b4 being Element of b1 holds eval (b2 - b3),b4 = (eval b2,b4) - (eval b3,b4)
proof end;

theorem Th25: :: POLYNOM4:25
for b1 being non empty add-associative right_zeroed right_complementable unital distributive doubleLoopStr
for b2 being Polynomial of b1
for b3 being Element of b1 holds eval (Leading-Monomial b2),b3 = (b2 . ((len b2) -' 1)) * ((power b1) . b3,((len b2) -' 1))
proof end;

Lemma23: for b1 being non empty add-associative right_zeroed right_complementable unital associative distributive doubleLoopStr
for b2, b3 being Polynomial of b1 st len b2 > 0 & len b3 > 0 holds
for b4 being Element of b1 holds eval ((Leading-Monomial b2) *' (Leading-Monomial b3)),b4 = ((b2 . ((len b2) -' 1)) * (b3 . ((len b3) -' 1))) * ((power b1) . b4,(((len b2) + (len b3)) -' 2))
proof end;

Lemma24: for b1 being non empty add-associative right_zeroed right_complementable associative commutative distributive left_unital non trivial doubleLoopStr
for b2, b3 being Polynomial of b1
for b4 being Element of b1 holds eval ((Leading-Monomial b2) *' (Leading-Monomial b3)),b4 = (eval (Leading-Monomial b2),b4) * (eval (Leading-Monomial b3),b4)
proof end;

theorem Th26: :: POLYNOM4:26
for b1 being non empty Abelian add-associative right_zeroed right_complementable associative commutative distributive left_unital non trivial doubleLoopStr
for b2, b3 being Polynomial of b1
for b4 being Element of b1 holds eval ((Leading-Monomial b2) *' b3),b4 = (eval (Leading-Monomial b2),b4) * (eval b3,b4)
proof end;

theorem Th27: :: POLYNOM4:27
for b1 being non empty Abelian add-associative right_zeroed right_complementable associative commutative distributive left_unital non trivial doubleLoopStr
for b2, b3 being Polynomial of b1
for b4 being Element of b1 holds eval (b2 *' b3),b4 = (eval b2,b4) * (eval b3,b4)
proof end;

definition
let c1 be non empty add-associative right_zeroed right_complementable unital distributive doubleLoopStr ;
let c2 be Element of c1;
func Polynom-Evaluation c1,c2 -> Function of (Polynom-Ring a1),a1 means :Def3: :: POLYNOM4:def 3
for b1 being Polynomial of a1 holds a3 . b1 = eval b1,a2;
existence
ex b1 being Function of (Polynom-Ring c1),c1 st
for b2 being Polynomial of c1 holds b1 . b2 = eval b2,c2
proof end;
uniqueness
for b1, b2 being Function of (Polynom-Ring c1),c1 st ( for b3 being Polynomial of c1 holds b1 . b3 = eval b3,c2 ) & ( for b3 being Polynomial of c1 holds b2 . b3 = eval b3,c2 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def3 defines Polynom-Evaluation POLYNOM4:def 3 :
for b1 being non empty add-associative right_zeroed right_complementable unital distributive doubleLoopStr
for b2 being Element of b1
for b3 being Function of (Polynom-Ring b1),b1 holds
( b3 = Polynom-Evaluation b1,b2 iff for b4 being Polynomial of b1 holds b3 . b4 = eval b4,b2 );

registration
let c1 be non empty Abelian add-associative right_zeroed right_complementable unital associative commutative distributive non degenerated doubleLoopStr ;
let c2 be Element of c1;
cluster Polynom-Evaluation a1,a2 -> unity-preserving ;
coherence
Polynom-Evaluation c1,c2 is unity-preserving
proof end;
end;

registration
let c1 be non empty Abelian add-associative right_zeroed right_complementable unital distributive doubleLoopStr ;
let c2 be Element of c1;
cluster Polynom-Evaluation a1,a2 -> additive ;
coherence
Polynom-Evaluation c1,c2 is additive
proof end;
end;

registration
let c1 be non empty Abelian add-associative right_zeroed right_complementable associative commutative distributive left_unital non trivial doubleLoopStr ;
let c2 be Element of c1;
cluster Polynom-Evaluation a1,a2 -> additive multiplicative ;
coherence
Polynom-Evaluation c1,c2 is multiplicative
proof end;
end;

registration
let c1 be non empty Abelian add-associative right_zeroed right_complementable associative commutative distributive left_unital non degenerated doubleLoopStr ;
let c2 be Element of c1;
cluster Polynom-Evaluation a1,a2 -> RingHomomorphism additive unity-preserving multiplicative ;
coherence
Polynom-Evaluation c1,c2 is RingHomomorphism
proof end;
end;