:: POLYNOM1 semantic presentation

Lemma1: for b1, b2 being Nat holds multnat . b1,b2 = b1 * b2
by BINOP_2:def 24;

theorem Th1: :: POLYNOM1:1
canceled;

theorem Th2: :: POLYNOM1:2
for b1 being set
for b2 being non empty set
for b3 being BinOp of b2
for b4 being Function of b1,b2
for b5 being Element of b2 holds dom (b3 [:] b4,b5) = b1
proof end;

theorem Th3: :: POLYNOM1:3
for b1, b2, b3 being Nat holds (b1 -' b2) -' b3 = b1 -' (b2 + b3)
proof end;

theorem Th4: :: POLYNOM1:4
for b1 being set
for b2 being Relation st field b2 c= b1 holds
b2 is Relation of b1
proof end;

theorem Th5: :: POLYNOM1:5
for b1 being non empty LoopStr
for b2, b3 being FinSequence of the carrier of b1 st dom b2 = dom b3 holds
dom (b2 + b3) = dom b2
proof end;

theorem Th6: :: POLYNOM1:6
for b1 being Function
for b2, b3 being set holds rng (b1 +* b2,b3) c= (rng b1) \/ {b3}
proof end;

definition
let c1, c2 be set ;
let c3 be Function of c1,c2;
let c4 be set ;
let c5 be Element of c2;
redefine func +* as c3 +* c4,c5 -> Function of a1,a2;
coherence
c3 +* c4,c5 is Function of c1,c2
proof end;
end;

definition
let c1 be set ;
let c2 be ManySortedSet of c1;
let c3, c4 be set ;
redefine func +* as c2 +* c3,c4 -> ManySortedSet of a1;
coherence
c2 +* c3,c4 is ManySortedSet of c1
proof end;
end;

theorem Th7: :: POLYNOM1:7
for b1 being one-to-one Function holds Card b1 = Card (rng b1)
proof end;

registration
let c1 be non empty set ;
let c2, c3 be BinOp of c1;
let c4, c5 be Element of c1;
cluster doubleLoopStr(# a1,a2,a3,a4,a5 #) -> non empty ;
coherence
not doubleLoopStr(# c1,c2,c3,c4,c5 #) is empty
by STRUCT_0:def 1;
end;

definition
let c1, c2 be set ;
let c3 be FinSequence-DOMAIN of c1;
let c4 be PartFunc of c2,c3;
let c5 be set ;
redefine func /. as c4 /. c5 -> Element of a3;
coherence
c4 /. c5 is Element of c3
;
end;

registration
let c1 be set ;
cluster being_linear-order well-ordering Relation of a1,a1;
existence
ex b1 being Order of c1 st
( b1 is being_linear-order & b1 is well-ordering )
proof end;
end;

theorem Th8: :: POLYNOM1:8
for b1 being non empty set
for b2 being non empty finite Subset of b1
for b3 being Order of b1
for b4 being Element of b1 st b4 in b2 & b3 linearly_orders b2 & ( for b5 being Element of b1 st b5 in b2 holds
[b4,b5] in b3 ) holds
(SgmX b3,b2) /. 1 = b4
proof end;

theorem Th9: :: POLYNOM1:9
for b1 being non empty set
for b2 being non empty finite Subset of b1
for b3 being Order of b1
for b4 being Element of b1 st b4 in b2 & b3 linearly_orders b2 & ( for b5 being Element of b1 st b5 in b2 holds
[b5,b4] in b3 ) holds
(SgmX b3,b2) /. (len (SgmX b3,b2)) = b4
proof end;

registration
let c1 be non empty set ;
let c2 be non empty finite Subset of c1;
let c3 be being_linear-order Order of c1;
cluster SgmX a3,a2 -> one-to-one non empty ;
coherence
( not SgmX c3,c2 is empty & SgmX c3,c2 is one-to-one )
proof end;
end;

registration
cluster {} -> FinSequence-yielding ;
coherence
{} is FinSequence-yielding
proof end;
end;

registration
cluster FinSequence-yielding set ;
existence
ex b1 being FinSequence st b1 is FinSequence-yielding
proof end;
end;

definition
let c1, c2 be FinSequence-yielding FinSequence;
redefine func ^^ as c1 ^^ c2 -> FinSequence-yielding FinSequence;
coherence
c1 ^^ c2 is FinSequence-yielding FinSequence
proof end;
end;

registration
let c1 be Nat;
let c2 be FinSequence;
cluster a1 |-> a2 -> FinSequence-yielding ;
coherence
c1 |-> c2 is FinSequence-yielding
proof end;
end;

registration
let c1 be FinSequence-yielding FinSequence;
let c2 be set ;
cluster a1 . a2 -> FinSequence-like ;
coherence
c1 . c2 is FinSequence-like
proof end;
end;

registration
let c1 be FinSequence;
cluster Card a1 -> FinSequence-like ;
coherence
Card c1 is FinSequence-like
proof end;
end;

registration
cluster Cardinal-yielding set ;
existence
ex b1 being FinSequence st b1 is Cardinal-yielding
proof end;
end;

theorem Th10: :: POLYNOM1:10
for b1 being Function holds
( b1 is Cardinal-yielding iff for b2 being set st b2 in rng b1 holds
b2 is Cardinal )
proof end;

registration
let c1, c2 be Cardinal-yielding FinSequence;
cluster a1 ^ a2 -> Cardinal-yielding ;
coherence
c1 ^ c2 is Cardinal-yielding
proof end;
end;

registration
cluster -> Cardinal-yielding FinSequence of NAT ;
coherence
for b1 being FinSequence of NAT holds b1 is Cardinal-yielding
proof end;
end;

registration
cluster Cardinal-yielding FinSequence of NAT ;
existence
ex b1 being FinSequence of NAT st b1 is Cardinal-yielding
proof end;
end;

definition
let c1 be set ;
let c2 be FinSequence of c1 * ;
redefine func Card as Card c2 -> Cardinal-yielding FinSequence of NAT ;
coherence
Card c2 is Cardinal-yielding FinSequence of NAT
proof end;
end;

registration
let c1 be FinSequence of NAT ;
let c2 be Nat;
cluster a1 | a2 -> Cardinal-yielding ;
coherence
c1 | c2 is Cardinal-yielding
;
end;

theorem Th11: :: POLYNOM1:11
for b1 being Function
for b2 being set holds Card (b1 | b2) = (Card b1) | b2
proof end;

registration
let c1 be empty Function;
cluster Card a1 -> empty ;
coherence
Card c1 is empty
proof end;
end;

theorem Th12: :: POLYNOM1:12
for b1 being set holds Card <*b1*> = <*(Card b1)*>
proof end;

theorem Th13: :: POLYNOM1:13
for b1, b2 being FinSequence holds Card (b1 ^ b2) = (Card b1) ^ (Card b2)
proof end;

registration
let c1 be set ;
cluster <*> a1 -> FinSequence-yielding ;
coherence
<*> c1 is FinSequence-yielding
;
end;

registration
let c1 be FinSequence;
cluster <*a1*> -> FinSequence-yielding ;
coherence
<*c1*> is FinSequence-yielding
proof end;
end;

theorem Th14: :: POLYNOM1:14
for b1 being Function holds
( b1 is FinSequence-yielding iff for b2 being set st b2 in rng b1 holds
b2 is FinSequence )
proof end;

registration
let c1, c2 be FinSequence-yielding FinSequence;
cluster a1 ^ a2 -> FinSequence-yielding ;
coherence
c1 ^ c2 is FinSequence-yielding
proof end;
end;

theorem Th15: :: POLYNOM1:15
for b1 being non empty LoopStr
for b2 being FinSequence of the carrier of b1 * holds dom (Sum b2) = dom b2
proof end;

theorem Th16: :: POLYNOM1:16
for b1 being non empty LoopStr
for b2 being FinSequence of the carrier of b1 * holds Sum (<*> (the carrier of b1 * )) = <*> the carrier of b1
proof end;

theorem Th17: :: POLYNOM1:17
for b1 being non empty LoopStr
for b2 being Element of the carrier of b1 * holds <*(Sum b2)*> = Sum <*b2*>
proof end;

theorem Th18: :: POLYNOM1:18
for b1 being non empty LoopStr
for b2, b3 being FinSequence of the carrier of b1 * holds Sum (b2 ^ b3) = (Sum b2) ^ (Sum b3)
proof end;

definition
let c1 be non empty HGrStr ;
let c2 be FinSequence of the carrier of c1;
let c3 be Element of c1;
canceled;
redefine func * as c3 * c2 -> FinSequence of the carrier of a1 means :Def2: :: POLYNOM1:def 2
( dom a4 = dom a2 & ( for b1 being set st b1 in dom a2 holds
a4 /. b1 = a3 * (a2 /. b1) ) );
compatibility
for b1 being FinSequence of the carrier of c1 holds
( b1 = c3 * c2 iff ( dom b1 = dom c2 & ( for b2 being set st b2 in dom c2 holds
b1 /. b2 = c3 * (c2 /. b2) ) ) )
proof end;
correctness
coherence
c3 * c2 is FinSequence of the carrier of c1
;
;
end;

:: deftheorem Def1 POLYNOM1:def 1 :
canceled;

:: deftheorem Def2 defines * POLYNOM1:def 2 :
for b1 being non empty HGrStr
for b2 being FinSequence of the carrier of b1
for b3 being Element of b1
for b4 being FinSequence of the carrier of b1 holds
( b4 = b3 * b2 iff ( dom b4 = dom b2 & ( for b5 being set st b5 in dom b2 holds
b4 /. b5 = b3 * (b2 /. b5) ) ) );

definition
let c1 be non empty HGrStr ;
let c2 be FinSequence of the carrier of c1;
let c3 be Element of c1;
func c2 * c3 -> FinSequence of the carrier of a1 means :Def3: :: POLYNOM1:def 3
( dom a4 = dom a2 & ( for b1 being set st b1 in dom a2 holds
a4 /. b1 = (a2 /. b1) * a3 ) );
existence
ex b1 being FinSequence of the carrier of c1 st
( dom b1 = dom c2 & ( for b2 being set st b2 in dom c2 holds
b1 /. b2 = (c2 /. b2) * c3 ) )
proof end;
uniqueness
for b1, b2 being FinSequence of the carrier of c1 st dom b1 = dom c2 & ( for b3 being set st b3 in dom c2 holds
b1 /. b3 = (c2 /. b3) * c3 ) & dom b2 = dom c2 & ( for b3 being set st b3 in dom c2 holds
b2 /. b3 = (c2 /. b3) * c3 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def3 defines * POLYNOM1:def 3 :
for b1 being non empty HGrStr
for b2 being FinSequence of the carrier of b1
for b3 being Element of b1
for b4 being FinSequence of the carrier of b1 holds
( b4 = b2 * b3 iff ( dom b4 = dom b2 & ( for b5 being set st b5 in dom b2 holds
b4 /. b5 = (b2 /. b5) * b3 ) ) );

theorem Th19: :: POLYNOM1:19
for b1 being non empty HGrStr
for b2 being Element of b1 holds b2 * (<*> the carrier of b1) = <*> the carrier of b1
proof end;

theorem Th20: :: POLYNOM1:20
for b1 being non empty HGrStr
for b2 being Element of b1 holds (<*> the carrier of b1) * b2 = <*> the carrier of b1
proof end;

theorem Th21: :: POLYNOM1:21
for b1 being non empty HGrStr
for b2, b3 being Element of b1 holds b2 * <*b3*> = <*(b2 * b3)*>
proof end;

theorem Th22: :: POLYNOM1:22
for b1 being non empty HGrStr
for b2, b3 being Element of b1 holds <*b3*> * b2 = <*(b3 * b2)*>
proof end;

theorem Th23: :: POLYNOM1:23
for b1 being non empty HGrStr
for b2 being Element of b1
for b3, b4 being FinSequence of the carrier of b1 holds b2 * (b3 ^ b4) = (b2 * b3) ^ (b2 * b4)
proof end;

theorem Th24: :: POLYNOM1:24
for b1 being non empty HGrStr
for b2 being Element of b1
for b3, b4 being FinSequence of the carrier of b1 holds (b3 ^ b4) * b2 = (b3 * b2) ^ (b4 * b2)
proof end;

registration
cluster non empty non degenerated -> non empty non trivial multLoopStr_0 ;
coherence
for b1 being non empty multLoopStr_0 st not b1 is degenerated holds
not b1 is trivial
proof end;
end;

registration
cluster non empty unital strict multLoopStr_0 ;
existence
ex b1 being non empty strict multLoopStr_0 st b1 is unital
proof end;
end;

registration
cluster non empty Abelian add-associative right_zeroed right_complementable unital associative commutative strict distributive Field-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 Field-like & b1 is unital & not b1 is trivial )
proof end;
end;

theorem Th25: :: POLYNOM1:25
canceled;

theorem Th26: :: POLYNOM1:26
canceled;

theorem Th27: :: POLYNOM1:27
for b1 being non empty add-associative right_zeroed right_complementable unital right-distributive doubleLoopStr st 0. b1 = 1. b1 holds
b1 is trivial
proof end;

theorem Th28: :: POLYNOM1:28
for b1 being non empty add-associative right_zeroed right_complementable unital distributive doubleLoopStr
for b2 being Element of b1
for b3 being FinSequence of the carrier of b1 holds Sum (b2 * b3) = b2 * (Sum b3)
proof end;

theorem Th29: :: POLYNOM1:29
for b1 being non empty add-associative right_zeroed right_complementable unital distributive doubleLoopStr
for b2 being Element of b1
for b3 being FinSequence of the carrier of b1 holds Sum (b3 * b2) = (Sum b3) * b2
proof end;

registration
let c1 be set ;
let c2 be empty FinSequence of c1 * ;
cluster FlattenSeq a2 -> empty ;
coherence
FlattenSeq c2 is empty
proof end;
end;

theorem Th30: :: POLYNOM1:30
for b1 being set
for b2 being FinSequence of b1 * holds len (FlattenSeq b2) = Sum (Card b2)
proof end;

theorem Th31: :: POLYNOM1:31
for b1, b2 being set
for b3 being FinSequence of b1 *
for b4 being FinSequence of b2 * st Card b3 = Card b4 holds
len (FlattenSeq b3) = len (FlattenSeq b4)
proof end;

theorem Th32: :: POLYNOM1:32
for b1 being set
for b2 being FinSequence of b1 *
for b3 being set st b3 in dom (FlattenSeq b2) holds
ex b4, b5 being Nat st
( b4 in dom b2 & b5 in dom (b2 . b4) & b3 = (Sum (Card (b2 | (b4 -' 1)))) + b5 & (b2 . b4) . b5 = (FlattenSeq b2) . b3 )
proof end;

theorem Th33: :: POLYNOM1:33
for b1 being set
for b2 being FinSequence of b1 *
for b3, b4 being Nat st b3 in dom b2 & b4 in dom (b2 . b3) holds
( (Sum (Card (b2 | (b3 -' 1)))) + b4 in dom (FlattenSeq b2) & (b2 . b3) . b4 = (FlattenSeq b2) . ((Sum (Card (b2 | (b3 -' 1)))) + b4) )
proof end;

theorem Th34: :: POLYNOM1:34
for b1 being non empty add-associative right_zeroed right_complementable LoopStr
for b2 being FinSequence of the carrier of b1 * holds Sum (FlattenSeq b2) = Sum (Sum b2)
proof end;

theorem Th35: :: POLYNOM1:35
for b1, b2 being non empty set
for b3 being FinSequence of b1 *
for b4 being Function of b1,b2 holds ((dom b3) --> b4) ** b3 is FinSequence of b2 *
proof end;

theorem Th36: :: POLYNOM1:36
for b1, b2 being non empty set
for b3 being FinSequence of b1 *
for b4 being Function of b1,b2 ex b5 being FinSequence of b2 * st
( b5 = ((dom b3) --> b4) ** b3 & b4 * (FlattenSeq b3) = FlattenSeq b5 )
proof end;

registration
cluster natural-yielding -> real-yielding set ;
correctness
coherence
for b1 being Function st b1 is natural-yielding holds
b1 is real-yielding
;
proof end;
end;

registration
cluster {} -> real-yielding FinSequence-yielding natural-yielding ;
coherence
{} is natural-yielding
proof end;
end;

registration
cluster real-yielding natural-yielding set ;
existence
ex b1 being Function st b1 is natural-yielding
proof end;
end;

definition
let c1 be natural-yielding Function;
let c2 be set ;
redefine func . as c1 . c2 -> Nat;
coherence
c1 . c2 is Nat
proof end;
end;

registration
let c1 be natural-yielding Function;
let c2 be set ;
let c3 be Nat;
cluster a1 +* a2,a3 -> real-yielding natural-yielding ;
coherence
c1 +* c2,c3 is natural-yielding
proof end;
end;

registration
let c1 be real-yielding Function;
let c2 be set ;
let c3 be Nat;
cluster a1 +* a2,a3 -> real-yielding ;
coherence
c1 +* c2,c3 is real-yielding
proof end;
end;

registration
let c1 be set ;
cluster -> natural-yielding Relation of a1, NAT ;
coherence
for b1 being Function of c1, NAT holds b1 is natural-yielding
proof end;
end;

registration
let c1 be set ;
cluster real-yielding natural-yielding ManySortedSet of a1;
existence
ex b1 being ManySortedSet of c1 st b1 is natural-yielding
proof end;
end;

registration
let c1 be set ;
cluster real-yielding ManySortedSet of a1;
existence
ex b1 being ManySortedSet of c1 st b1 is real-yielding
proof end;
end;

registration
let c1 be set ;
cluster real-yielding ManySortedSet of a1;
existence
ex b1 being ManySortedSet of c1 st b1 is real-yielding
proof end;
end;

definition
let c1 be set ;
let c2, c3 be real-yielding ManySortedSet of c1;
canceled;
func c2 + c3 -> ManySortedSet of a1 means :Def5: :: POLYNOM1:def 5
for b1 being set holds a4 . b1 = (a2 . b1) + (a3 . b1);
existence
ex b1 being ManySortedSet of c1 st
for b2 being set holds b1 . b2 = (c2 . b2) + (c3 . b2)
proof end;
uniqueness
for b1, b2 being ManySortedSet of c1 st ( for b3 being set holds b1 . b3 = (c2 . b3) + (c3 . b3) ) & ( for b3 being set holds b2 . b3 = (c2 . b3) + (c3 . b3) ) holds
b1 = b2
proof end;
commutativity
for b1 being ManySortedSet of c1
for b2, b3 being real-yielding ManySortedSet of c1 st ( for b4 being set holds b1 . b4 = (b2 . b4) + (b3 . b4) ) holds
for b4 being set holds b1 . b4 = (b3 . b4) + (b2 . b4)
;
end;

:: deftheorem Def4 POLYNOM1:def 4 :
canceled;

:: deftheorem Def5 defines + POLYNOM1:def 5 :
for b1 being set
for b2, b3 being real-yielding ManySortedSet of b1
for b4 being ManySortedSet of b1 holds
( b4 = b2 + b3 iff for b5 being set holds b4 . b5 = (b2 . b5) + (b3 . b5) );

definition
let c1 be set ;
let c2, c3 be natural-yielding ManySortedSet of c1;
func c2 -' c3 -> ManySortedSet of a1 means :Def6: :: POLYNOM1:def 6
for b1 being set holds a4 . b1 = (a2 . b1) -' (a3 . b1);
existence
ex b1 being ManySortedSet of c1 st
for b2 being set holds b1 . b2 = (c2 . b2) -' (c3 . b2)
proof end;
uniqueness
for b1, b2 being ManySortedSet of c1 st ( for b3 being set holds b1 . b3 = (c2 . b3) -' (c3 . b3) ) & ( for b3 being set holds b2 . b3 = (c2 . b3) -' (c3 . b3) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def6 defines -' POLYNOM1:def 6 :
for b1 being set
for b2, b3 being natural-yielding ManySortedSet of b1
for b4 being ManySortedSet of b1 holds
( b4 = b2 -' b3 iff for b5 being set holds b4 . b5 = (b2 . b5) -' (b3 . b5) );

theorem Th37: :: POLYNOM1:37
for b1 being set
for b2, b3, b4 being real-yielding ManySortedSet of b1 st ( for b5 being set st b5 in b1 holds
b2 . b5 = (b3 . b5) + (b4 . b5) ) holds
b2 = b3 + b4
proof end;

theorem Th38: :: POLYNOM1:38
for b1 being set
for b2, b3, b4 being natural-yielding ManySortedSet of b1 st ( for b5 being set st b5 in b1 holds
b2 . b5 = (b3 . b5) -' (b4 . b5) ) holds
b2 = b3 -' b4
proof end;

registration
let c1 be set ;
let c2, c3 be real-yielding ManySortedSet of c1;
cluster a2 + a3 -> real-yielding ;
coherence
c2 + c3 is real-yielding
proof end;
end;

registration
let c1 be set ;
let c2, c3 be natural-yielding ManySortedSet of c1;
cluster a2 + a3 -> real-yielding natural-yielding ;
coherence
c2 + c3 is natural-yielding
proof end;
cluster a2 -' a3 -> real-yielding natural-yielding ;
coherence
c2 -' c3 is natural-yielding
proof end;
end;

theorem Th39: :: POLYNOM1:39
for b1 being set
for b2, b3, b4 being real-yielding ManySortedSet of b1 holds (b2 + b3) + b4 = b2 + (b3 + b4)
proof end;

theorem Th40: :: POLYNOM1:40
for b1 being set
for b2, b3, b4 being natural-yielding ManySortedSet of b1 holds (b2 -' b3) -' b4 = b2 -' (b3 + b4)
proof end;

definition
let c1 be Function;
func support c1 -> set means :Def7: :: POLYNOM1:def 7
for b1 being set holds
( b1 in a2 iff a1 . b1 <> 0 );
existence
ex b1 being set st
for b2 being set holds
( b2 in b1 iff c1 . b2 <> 0 )
proof end;
uniqueness
for b1, b2 being set st ( for b3 being set holds
( b3 in b1 iff c1 . b3 <> 0 ) ) & ( for b3 being set holds
( b3 in b2 iff c1 . b3 <> 0 ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def7 defines support POLYNOM1:def 7 :
for b1 being Function
for b2 being set holds
( b2 = support b1 iff for b3 being set holds
( b3 in b2 iff b1 . b3 <> 0 ) );

theorem Th41: :: POLYNOM1:41
for b1 being Function holds support b1 c= dom b1
proof end;

definition
let c1 be Function;
attr a1 is finite-support means :Def8: :: POLYNOM1:def 8
support a1 is finite;
end;

:: deftheorem Def8 defines finite-support POLYNOM1:def 8 :
for b1 being Function holds
( b1 is finite-support iff support b1 is finite );

notation
let c1 be Function;
synonym c1 has_finite-support for finite-support c1;
end;

registration
cluster {} -> real-yielding FinSequence-yielding natural-yielding finite-support ;
coherence
{} is finite-support
proof end;
end;

registration
cluster finite -> finite-support set ;
coherence
for b1 being Function st b1 is finite holds
b1 is finite-support
proof end;
end;

registration
cluster non empty real-yielding natural-yielding finite-support set ;
existence
ex b1 being Function st
( b1 is natural-yielding & b1 is finite-support & not b1 is empty )
proof end;
end;

registration
let c1 be finite-support Function;
cluster support a1 -> finite ;
coherence
support c1 is finite
by Def8;
end;

registration
let c1 be set ;
cluster real-yielding natural-yielding finite-support Relation of a1, NAT ;
existence
ex b1 being Function of c1, NAT st b1 is finite-support
proof end;
end;

registration
let c1 be finite-support Function;
let c2, c3 be set ;
cluster a1 +* a2,a3 -> finite-support ;
coherence
c1 +* c2,c3 is finite-support
proof end;
end;

registration
let c1 be set ;
cluster real-yielding natural-yielding finite-support ManySortedSet of a1;
existence
ex b1 being ManySortedSet of c1 st
( b1 is natural-yielding & b1 is finite-support )
proof end;
end;

theorem Th42: :: POLYNOM1:42
for b1 being set
for b2, b3 being natural-yielding ManySortedSet of b1 holds support (b2 + b3) = (support b2) \/ (support b3)
proof end;

theorem Th43: :: POLYNOM1:43
for b1 being set
for b2, b3 being natural-yielding ManySortedSet of b1 holds support (b2 -' b3) c= support b2
proof end;

definition
let c1 be non empty set ;
let c2 be ZeroStr ;
let c3 be Function of c1,c2;
func Support c3 -> Subset of a1 means :Def9: :: POLYNOM1:def 9
for b1 being Element of a1 holds
( b1 in a4 iff a3 . b1 <> 0. a2 );
existence
ex b1 being Subset of c1 st
for b2 being Element of c1 holds
( b2 in b1 iff c3 . b2 <> 0. c2 )
proof end;
uniqueness
for b1, b2 being Subset of c1 st ( for b3 being Element of c1 holds
( b3 in b1 iff c3 . b3 <> 0. c2 ) ) & ( for b3 being Element of c1 holds
( b3 in b2 iff c3 . b3 <> 0. c2 ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def9 defines Support POLYNOM1:def 9 :
for b1 being non empty set
for b2 being ZeroStr
for b3 being Function of b1,b2
for b4 being Subset of b1 holds
( b4 = Support b3 iff for b5 being Element of b1 holds
( b5 in b4 iff b3 . b5 <> 0. b2 ) );

definition
let c1 be non empty set ;
let c2 be ZeroStr ;
let c3 be Function of c1,c2;
attr a3 is finite-Support means :Def10: :: POLYNOM1:def 10
Support a3 is finite;
end;

:: deftheorem Def10 defines finite-Support POLYNOM1:def 10 :
for b1 being non empty set
for b2 being ZeroStr
for b3 being Function of b1,b2 holds
( b3 is finite-Support iff Support b3 is finite );

notation
let c1 be non empty set ;
let c2 be ZeroStr ;
let c3 be Function of c1,c2;
synonym c3 has_finite-Support for finite-Support c3;
end;

definition
let c1 be set ;
mode bag of a1 is natural-yielding finite-support ManySortedSet of a1;
end;

registration
let c1 be finite set ;
cluster -> finite-support ManySortedSet of a1;
coherence
for b1 being ManySortedSet of c1 holds b1 is finite-support
proof end;
end;

registration
let c1 be set ;
let c2, c3 be bag of c1;
cluster a2 + a3 -> real-yielding natural-yielding finite-support ;
coherence
c2 + c3 is finite-support
proof end;
cluster a2 -' a3 -> real-yielding natural-yielding finite-support ;
coherence
c2 -' c3 is finite-support
proof end;
end;

theorem Th44: :: POLYNOM1:44
for b1 being set holds b1 --> 0 is bag of b1
proof end;

definition
let c1 be Ordinal;
let c2, c3 be bag of c1;
pred c2 < c3 means :Def11: :: POLYNOM1:def 11
ex b1 being Ordinal st
( a2 . b1 < a3 . b1 & ( for b2 being Ordinal st b2 in b1 holds
a2 . b2 = a3 . b2 ) );
asymmetry
for b1, b2 being bag of c1 st ex b3 being Ordinal st
( b1 . b3 < b2 . b3 & ( for b4 being Ordinal st b4 in b3 holds
b1 . b4 = b2 . b4 ) ) holds
for b3 being Ordinal holds
( not b2 . b3 < b1 . b3 or ex b4 being Ordinal st
( b4 in b3 & not b2 . b4 = b1 . b4 ) )
proof end;
end;

:: deftheorem Def11 defines < POLYNOM1:def 11 :
for b1 being Ordinal
for b2, b3 being bag of b1 holds
( b2 < b3 iff ex b4 being Ordinal st
( b2 . b4 < b3 . b4 & ( for b5 being Ordinal st b5 in b4 holds
b2 . b5 = b3 . b5 ) ) );

theorem Th45: :: POLYNOM1:45
for b1 being Ordinal
for b2, b3, b4 being bag of b1 st b2 < b3 & b3 < b4 holds
b2 < b4
proof end;

definition
let c1 be Ordinal;
let c2, c3 be bag of c1;
pred c2 <=' c3 means :Def12: :: POLYNOM1:def 12
( a2 < a3 or a2 = a3 );
reflexivity
for b1 being bag of c1 holds
( b1 < b1 or b1 = b1 )
;
end;

:: deftheorem Def12 defines <=' POLYNOM1:def 12 :
for b1 being Ordinal
for b2, b3 being bag of b1 holds
( b2 <=' b3 iff ( b2 < b3 or b2 = b3 ) );

theorem Th46: :: POLYNOM1:46
for b1 being Ordinal
for b2, b3, b4 being bag of b1 st b2 <=' b3 & b3 <=' b4 holds
b2 <=' b4
proof end;

theorem Th47: :: POLYNOM1:47
for b1 being Ordinal
for b2, b3, b4 being bag of b1 st b2 < b3 & b3 <=' b4 holds
b2 < b4
proof end;

theorem Th48: :: POLYNOM1:48
for b1 being Ordinal
for b2, b3, b4 being bag of b1 st b2 <=' b3 & b3 < b4 holds
b2 < b4
proof end;

theorem Th49: :: POLYNOM1:49
for b1 being Ordinal
for b2, b3 being bag of b1 holds
( b2 <=' b3 or b3 <=' b2 )
proof end;

definition
let c1 be set ;
let c2, c3 be bag of c1;
pred c2 divides c3 means :Def13: :: POLYNOM1:def 13
for b1 being set holds a2 . b1 <= a3 . b1;
reflexivity
for b1 being bag of c1
for b2 being set holds b1 . b2 <= b1 . b2
;
end;

:: deftheorem Def13 defines divides POLYNOM1:def 13 :
for b1 being set
for b2, b3 being bag of b1 holds
( b2 divides b3 iff for b4 being set holds b2 . b4 <= b3 . b4 );

theorem Th50: :: POLYNOM1:50
for b1 being set
for b2, b3 being bag of b1 st ( for b4 being set st b4 in b1 holds
b2 . b4 <= b3 . b4 ) holds
b2 divides b3
proof end;

theorem Th51: :: POLYNOM1:51
for b1 being Ordinal
for b2, b3 being bag of b1 st b2 divides b3 holds
(b3 -' b2) + b2 = b3
proof end;

theorem Th52: :: POLYNOM1:52
for b1 being set
for b2, b3 being bag of b1 holds (b3 + b2) -' b2 = b3
proof end;

theorem Th53: :: POLYNOM1:53
for b1 being Ordinal
for b2, b3 being bag of b1 st b2 divides b3 holds
b2 <=' b3
proof end;

theorem Th54: :: POLYNOM1:54
for b1 being set
for b2, b3, b4 being bag of b1 st b2 = b3 + b4 holds
b3 divides b2
proof end;

definition
let c1 be set ;
func Bags c1 -> set means :Def14: :: POLYNOM1:def 14
for b1 being set holds
( b1 in a2 iff b1 is bag of a1 );
existence
ex b1 being set st
for b2 being set holds
( b2 in b1 iff b2 is bag of c1 )
proof end;
uniqueness
for b1, b2 being set st ( for b3 being set holds
( b3 in b1 iff b3 is bag of c1 ) ) & ( for b3 being set holds
( b3 in b2 iff b3 is bag of c1 ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def14 defines Bags POLYNOM1:def 14 :
for b1 being set
for b2 being set holds
( b2 = Bags b1 iff for b3 being set holds
( b3 in b2 iff b3 is bag of b1 ) );

definition
let c1 be set ;
redefine func Bags as Bags c1 -> Subset of (Bags a1);
coherence
Bags c1 is Subset of (Bags c1)
proof end;
end;

theorem Th55: :: POLYNOM1:55
Bags {} = {{} }
proof end;

registration
let c1 be set ;
cluster Bags a1 -> non empty ;
coherence
not Bags c1 is empty
proof end;
end;

definition
let c1 be set ;
let c2 be non empty Subset of (Bags c1);
redefine mode Element as Element of c2 -> bag of a1;
coherence
for b1 being Element of c2 holds b1 is bag of c1
proof end;
end;

definition
let c1 be set ;
let c2 be non empty 1-sorted ;
let c3 be Function of Bags c1,c2;
let c4 be bag of c1;
redefine func . as c3 . c4 -> Element of a2;
coherence
c3 . c4 is Element of c2
proof end;
end;

definition
let c1 be set ;
func EmptyBag c1 -> Element of Bags a1 equals :: POLYNOM1:def 15
a1 --> 0;
coherence
c1 --> 0 is Element of Bags c1
proof end;
end;

:: deftheorem Def15 defines EmptyBag POLYNOM1:def 15 :
for b1 being set holds EmptyBag b1 = b1 --> 0;

theorem Th56: :: POLYNOM1:56
for b1, b2 being set holds (EmptyBag b1) . b2 = 0
proof end;

theorem Th57: :: POLYNOM1:57
for b1 being set
for b2 being bag of b1 holds b2 + (EmptyBag b1) = b2
proof end;

theorem Th58: :: POLYNOM1:58
for b1 being set
for b2 being bag of b1 holds b2 -' (EmptyBag b1) = b2
proof end;

theorem Th59: :: POLYNOM1:59
for b1 being set
for b2 being bag of b1 holds (EmptyBag b1) -' b2 = EmptyBag b1
proof end;

theorem Th60: :: POLYNOM1:60
for b1 being set
for b2 being bag of b1 holds b2 -' b2 = EmptyBag b1
proof end;

theorem Th61: :: POLYNOM1:61
for b1 being set
for b2, b3 being bag of b1 st b2 divides b3 & b3 -' b2 = EmptyBag b1 holds
b3 = b2
proof end;

theorem Th62: :: POLYNOM1:62
for b1 being set
for b2 being bag of b1 st b2 divides EmptyBag b1 holds
EmptyBag b1 = b2
proof end;

theorem Th63: :: POLYNOM1:63
for b1 being set
for b2 being bag of b1 holds EmptyBag b1 divides b2
proof end;

theorem Th64: :: POLYNOM1:64
for b1 being Ordinal
for b2 being bag of b1 holds EmptyBag b1 <=' b2
proof end;

definition
let c1 be Ordinal;
func BagOrder c1 -> Order of Bags a1 means :Def16: :: POLYNOM1:def 16
for b1, b2 being bag of a1 holds
( [b1,b2] in a2 iff b1 <=' b2 );
existence
ex b1 being Order of Bags c1 st
for b2, b3 being bag of c1 holds
( [b2,b3] in b1 iff b2 <=' 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 <=' b4 ) ) & ( for b3, b4 being bag of c1 holds
( [b3,b4] in b2 iff b3 <=' b4 ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def16 defines BagOrder POLYNOM1:def 16 :
for b1 being Ordinal
for b2 being Order of Bags b1 holds
( b2 = BagOrder b1 iff for b3, b4 being bag of b1 holds
( [b3,b4] in b2 iff b3 <=' b4 ) );

Lemma69: for b1 being Ordinal holds BagOrder b1 is_reflexive_in Bags b1
proof end;

Lemma70: for b1 being Ordinal holds BagOrder b1 is_antisymmetric_in Bags b1
proof end;

Lemma71: for b1 being Ordinal holds BagOrder b1 is_transitive_in Bags b1
proof end;

Lemma72: for b1 being Ordinal holds BagOrder b1 linearly_orders Bags b1
proof end;

registration
let c1 be Ordinal;
cluster BagOrder a1 -> being_linear-order ;
coherence
BagOrder c1 is being_linear-order
proof end;
end;

definition
let c1 be set ;
let c2 be Function of c1, NAT ;
func NatMinor c2 -> Subset of (Funcs a1,NAT ) means :Def17: :: POLYNOM1:def 17
for b1 being natural-yielding ManySortedSet of a1 holds
( b1 in a3 iff for b2 being set st b2 in a1 holds
b1 . b2 <= a2 . b2 );
existence
ex b1 being Subset of (Funcs c1,NAT ) st
for b2 being natural-yielding ManySortedSet of c1 holds
( b2 in b1 iff for b3 being set st b3 in c1 holds
b2 . b3 <= c2 . b3 )
proof end;
uniqueness
for b1, b2 being Subset of (Funcs c1,NAT ) st ( for b3 being natural-yielding ManySortedSet of c1 holds
( b3 in b1 iff for b4 being set st b4 in c1 holds
b3 . b4 <= c2 . b4 ) ) & ( for b3 being natural-yielding ManySortedSet of c1 holds
( b3 in b2 iff for b4 being set st b4 in c1 holds
b3 . b4 <= c2 . b4 ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def17 defines NatMinor POLYNOM1:def 17 :
for b1 being set
for b2 being Function of b1, NAT
for b3 being Subset of (Funcs b1,NAT ) holds
( b3 = NatMinor b2 iff for b4 being natural-yielding ManySortedSet of b1 holds
( b4 in b3 iff for b5 being set st b5 in b1 holds
b4 . b5 <= b2 . b5 ) );

theorem Th65: :: POLYNOM1:65
for b1 being set
for b2 being Function of b1, NAT holds b2 in NatMinor b2
proof end;

registration
let c1 be set ;
let c2 be Function of c1, NAT ;
cluster NatMinor a2 -> non empty functional ;
coherence
( not NatMinor c2 is empty & NatMinor c2 is functional )
proof end;
end;

registration
let c1 be set ;
let c2 be Function of c1, NAT ;
cluster -> real-yielding natural-yielding Element of NatMinor a2;
coherence
for b1 being Element of NatMinor c2 holds b1 is natural-yielding
proof end;
end;

theorem Th66: :: POLYNOM1:66
for b1 being set
for b2 being finite-support Function of b1, NAT holds NatMinor b2 c= Bags b1
proof end;

definition
let c1 be set ;
let c2 be finite-support Function of c1, NAT ;
redefine func support as support c2 -> Element of Fin a1;
coherence
support c2 is Element of Fin c1
proof end;
end;

theorem Th67: :: POLYNOM1:67
for b1 being non empty set
for b2 being finite-support Function of b1, NAT holds Card (NatMinor b2) = multnat $$ (support b2),(addnat [:] b2,1)
proof end;

registration
let c1 be set ;
let c2 be finite-support Function of c1, NAT ;
cluster NatMinor a2 -> non empty finite functional ;
coherence
NatMinor c2 is finite
proof end;
end;

definition
let c1 be Ordinal;
let c2 be bag of c1;
func divisors c2 -> FinSequence of Bags a1 means :Def18: :: POLYNOM1:def 18
ex b1 being non empty finite Subset of (Bags a1) st
( a3 = SgmX (BagOrder a1),b1 & ( for b2 being bag of a1 holds
( b2 in b1 iff b2 divides a2 ) ) );
existence
ex b1 being FinSequence of Bags c1ex b2 being non empty finite Subset of (Bags c1) st
( b1 = SgmX (BagOrder c1),b2 & ( for b3 being bag of c1 holds
( b3 in b2 iff b3 divides c2 ) ) )
proof end;
uniqueness
for b1, b2 being FinSequence of Bags c1 st ex b3 being non empty finite Subset of (Bags c1) st
( b1 = SgmX (BagOrder c1),b3 & ( for b4 being bag of c1 holds
( b4 in b3 iff b4 divides c2 ) ) ) & ex b3 being non empty finite Subset of (Bags c1) st
( b2 = SgmX (BagOrder c1),b3 & ( for b4 being bag of c1 holds
( b4 in b3 iff b4 divides c2 ) ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def18 defines divisors POLYNOM1:def 18 :
for b1 being Ordinal
for b2 being bag of b1
for b3 being FinSequence of Bags b1 holds
( b3 = divisors b2 iff ex b4 being non empty finite Subset of (Bags b1) st
( b3 = SgmX (BagOrder b1),b4 & ( for b5 being bag of b1 holds
( b5 in b4 iff b5 divides b2 ) ) ) );

registration
let c1 be Ordinal;
let c2 be bag of c1;
cluster divisors a2 -> one-to-one non empty finite-support ;
coherence
( not divisors c2 is empty & divisors c2 is one-to-one )
proof end;
end;

theorem Th68: :: POLYNOM1:68
for b1 being Ordinal
for b2 being Nat
for b3 being bag of b1 st b2 in dom (divisors b3) holds
(divisors b3) /. b2 divides b3
proof end;

theorem Th69: :: POLYNOM1:69
for b1 being Ordinal
for b2 being bag of b1 holds
( (divisors b2) /. 1 = EmptyBag b1 & (divisors b2) /. (len (divisors b2)) = b2 )
proof end;

theorem Th70: :: POLYNOM1:70
for b1 being Ordinal
for b2 being Nat
for b3, b4, b5 being bag of b1 st b2 > 1 & b2 < len (divisors b3) holds
( (divisors b3) /. b2 <> EmptyBag b1 & (divisors b3) /. b2 <> b3 )
proof end;

theorem Th71: :: POLYNOM1:71
for b1 being Ordinal holds divisors (EmptyBag b1) = <*(EmptyBag b1)*>
proof end;

definition
let c1 be Ordinal;
let c2 be bag of c1;
func decomp c2 -> FinSequence of 2 -tuples_on (Bags a1) means :Def19: :: POLYNOM1:def 19
( dom a3 = dom (divisors a2) & ( for b1 being Nat
for b2 being bag of a1 st b1 in dom a3 & b2 = (divisors a2) /. b1 holds
a3 /. b1 = <*b2,(a2 -' b2)*> ) );
existence
ex b1 being FinSequence of 2 -tuples_on (Bags c1) st
( dom b1 = dom (divisors c2) & ( for b2 being Nat
for b3 being bag of c1 st b2 in dom b1 & b3 = (divisors c2) /. b2 holds
b1 /. b2 = <*b3,(c2 -' b3)*> ) )
proof end;
uniqueness
for b1, b2 being FinSequence of 2 -tuples_on (Bags c1) st dom b1 = dom (divisors c2) & ( for b3 being Nat
for b4 being bag of c1 st b3 in dom b1 & b4 = (divisors c2) /. b3 holds
b1 /. b3 = <*b4,(c2 -' b4)*> ) & dom b2 = dom (divisors c2) & ( for b3 being Nat
for b4 being bag of c1 st b3 in dom b2 & b4 = (divisors c2) /. b3 holds
b2 /. b3 = <*b4,(c2 -' b4)*> ) holds
b1 = b2
proof end;
end;

:: deftheorem Def19 defines decomp POLYNOM1:def 19 :
for b1 being Ordinal
for b2 being bag of b1
for b3 being FinSequence of 2 -tuples_on (Bags b1) holds
( b3 = decomp b2 iff ( dom b3 = dom (divisors b2) & ( for b4 being Nat
for b5 being bag of b1 st b4 in dom b3 & b5 = (divisors b2) /. b4 holds
b3 /. b4 = <*b5,(b2 -' b5)*> ) ) );

theorem Th72: :: POLYNOM1:72
for b1 being Ordinal
for b2 being Nat
for b3 being bag of b1 st b2 in dom (decomp b3) holds
ex b4, b5 being bag of b1 st
( (decomp b3) /. b2 = <*b4,b5*> & b3 = b4 + b5 )
proof end;

theorem Th73: :: POLYNOM1:73
for b1 being Ordinal
for b2, b3, b4 being bag of b1 st b2 = b3 + b4 holds
ex b5 being Nat st
( b5 in dom (decomp b2) & (decomp b2) /. b5 = <*b3,b4*> )
proof end;

theorem Th74: :: POLYNOM1:74
for b1 being Ordinal
for b2 being Nat
for b3, b4, b5 being bag of b1 st b2 in dom (decomp b3) & (decomp b3) /. b2 = <*b4,b5*> holds
b4 = (divisors b3) /. b2
proof end;

registration
let c1 be Ordinal;
let c2 be bag of c1;
cluster decomp a2 -> one-to-one non empty FinSequence-yielding finite-support ;
coherence
( not decomp c2 is empty & decomp c2 is one-to-one & decomp c2 is FinSequence-yielding )
proof end;
end;

registration
let c1 be Ordinal;
let c2 be Element of Bags c1;
cluster decomp a2 -> one-to-one non empty FinSequence-yielding finite-support ;
coherence
( not decomp c2 is empty & decomp c2 is one-to-one & decomp c2 is FinSequence-yielding )
;
end;

theorem Th75: :: POLYNOM1:75
for b1 being Ordinal
for b2 being bag of b1 holds
( (decomp b2) /. 1 = <*(EmptyBag b1),b2*> & (decomp b2) /. (len (decomp b2)) = <*b2,(EmptyBag b1)*> )
proof end;

theorem Th76: :: POLYNOM1:76
for b1 being Ordinal
for b2 being Nat
for b3, b4, b5 being bag of b1 st b2 > 1 & b2 < len (decomp b3) & (decomp b3) /. b2 = <*b4,b5*> holds
( b4 <> EmptyBag b1 & b5 <> EmptyBag b1 )
proof end;

theorem Th77: :: POLYNOM1:77
for b1 being Ordinal holds decomp (EmptyBag b1) = <*<*(EmptyBag b1),(EmptyBag b1)*>*>
proof end;

theorem Th78: :: POLYNOM1:78
for b1 being Ordinal
for b2 being bag of b1
for b3, b4 being FinSequence of (3 -tuples_on (Bags b1)) * st dom b3 = dom (decomp b2) & dom b4 = dom (decomp b2) & ( for b5 being Nat st b5 in dom b3 holds
b3 . b5 = (decomp (((decomp b2) /. b5) /. 1)) ^^ ((len (decomp (((decomp b2) /. b5) /. 1))) |-> <*(((decomp b2) /. b5) /. 2)*>) ) & ( for b5 being Nat st b5 in dom b4 holds
b4 . b5 = ((len (decomp (((decomp b2) /. b5) /. 2))) |-> <*(((decomp b2) /. b5) /. 1)*>) ^^ (decomp (((decomp b2) /. b5) /. 2)) ) holds
ex b5 being Permutation of dom (FlattenSeq b3) st FlattenSeq b4 = (FlattenSeq b3) * b5
proof end;

definition
let c1 be set ;
let c2 be 1-sorted ;
mode Series of a1,a2 is Function of Bags a1,a2;
end;

definition
let c1 be set ;
let c2 be non empty LoopStr ;
let c3, c4 be Series of c1,c2;
canceled;
func c3 + c4 -> Series of a1,a2 means :Def21: :: POLYNOM1:def 21
for b1 being bag of a1 holds a5 . b1 = (a3 . b1) + (a4 . b1);
existence
ex b1 being Series of c1,c2 st
for b2 being bag of c1 holds b1 . b2 = (c3 . b2) + (c4 . b2)
proof end;
uniqueness
for b1, b2 being Series of c1,c2 st ( for b3 being bag of c1 holds b1 . b3 = (c3 . b3) + (c4 . b3) ) & ( for b3 being bag of c1 holds b2 . b3 = (c3 . b3) + (c4 . b3) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def20 POLYNOM1:def 20 :
canceled;

:: deftheorem Def21 defines + POLYNOM1:def 21 :
for b1 being set
for b2 being non empty LoopStr
for b3, b4, b5 being Series of b1,b2 holds
( b5 = b3 + b4 iff for b6 being bag of b1 holds b5 . b6 = (b3 . b6) + (b4 . b6) );

theorem Th79: :: POLYNOM1:79
for b1 being set
for b2 being non empty right_zeroed LoopStr
for b3, b4 being Series of b1,b2 holds Support (b3 + b4) c= (Support b3) \/ (Support b4)
proof end;

definition
let c1 be set ;
let c2 be non empty Abelian right_zeroed LoopStr ;
let c3, c4 be Series of c1,c2;
redefine func + as c3 + c4 -> Series of a1,a2;
commutativity
for b1, b2 being Series of c1,c2 holds b1 + b2 = b2 + b1
proof end;
end;

theorem Th80: :: POLYNOM1:80
for b1 being set
for b2 being non empty add-associative right_zeroed doubleLoopStr
for b3, b4, b5 being Series of b1,b2 holds (b3 + b4) + b5 = b3 + (b4 + b5)
proof end;

definition
let c1 be set ;
let c2 be non empty add-associative right_zeroed right_complementable LoopStr ;
let c3 be Series of c1,c2;
func - c3 -> Series of a1,a2 means :Def22: :: POLYNOM1:def 22
for b1 being bag of a1 holds a4 . b1 = - (a3 . b1);
existence
ex b1 being Series of c1,c2 st
for b2 being bag of c1 holds b1 . b2 = - (c3 . b2)
proof end;
uniqueness
for b1, b2 being Series of c1,c2 st ( for b3 being bag of c1 holds b1 . b3 = - (c3 . b3) ) & ( for b3 being bag of c1 holds b2 . b3 = - (c3 . b3) ) holds
b1 = b2
proof end;
involutiveness
for b1, b2 being Series of c1,c2 st ( for b3 being bag of c1 holds b1 . b3 = - (b2 . b3) ) holds
for b3 being bag of c1 holds b2 . b3 = - (b1 . b3)
proof end;
end;

:: deftheorem Def22 defines - POLYNOM1:def 22 :
for b1 being set
for b2 being non empty add-associative right_zeroed right_complementable LoopStr
for b3, b4 being Series of b1,b2 holds
( b4 = - b3 iff for b5 being bag of b1 holds b4 . b5 = - (b3 . b5) );

definition
let c1 be set ;
let c2 be non empty add-associative right_zeroed right_complementable LoopStr ;
let c3, c4 be Series of c1,c2;
func c3 - c4 -> Series of a1,a2 equals :: POLYNOM1:def 23
a3 + (- a4);
coherence
c3 + (- c4) is Series of c1,c2
;
end;

:: deftheorem Def23 defines - POLYNOM1:def 23 :
for b1 being set
for b2 being non empty add-associative right_zeroed right_complementable LoopStr
for b3, b4 being Series of b1,b2 holds b3 - b4 = b3 + (- b4);

definition
let c1 be set ;
let c2 be non empty ZeroStr ;
func 0_ c1,c2 -> Series of a1,a2 equals :: POLYNOM1:def 24
(Bags a1) --> (0. a2);
coherence
(Bags c1) --> (0. c2) is Series of c1,c2
by FUNCOP_1:57;
end;

:: deftheorem Def24 defines 0_ POLYNOM1:def 24 :
for b1 being set
for b2 being non empty ZeroStr holds 0_ b1,b2 = (Bags b1) --> (0. b2);

theorem Th81: :: POLYNOM1:81
for b1 being set
for b2 being non empty ZeroStr
for b3 being bag of b1 holds (0_ b1,b2) . b3 = 0. b2
proof end;

theorem Th82: :: POLYNOM1:82
for b1 being set
for b2 being non empty right_zeroed LoopStr
for b3 being Series of b1,b2 holds b3 + (0_ b1,b2) = b3
proof end;

definition
let c1 be set ;
let c2 be non empty unital multLoopStr_0 ;
func 1_ c1,c2 -> Series of a1,a2 equals :: POLYNOM1:def 25
(0_ a1,a2) +* (EmptyBag a1),(1. a2);
coherence
(0_ c1,c2) +* (EmptyBag c1),(1. c2) is Series of c1,c2
;
end;

:: deftheorem Def25 defines 1_ POLYNOM1:def 25 :
for b1 being set
for b2 being non empty unital multLoopStr_0 holds 1_ b1,b2 = (0_ b1,b2) +* (EmptyBag b1),(1. b2);

theorem Th83: :: POLYNOM1:83
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
proof end;

theorem Th84: :: POLYNOM1:84
for b1 being set
for b2 being non empty unital multLoopStr_0 holds
( (1_ b1,b2) . (EmptyBag b1) = 1. b2 & ( for b3 being bag of b1 st b3 <> EmptyBag b1 holds
(1_ b1,b2) . b3 = 0. b2 ) )
proof end;

definition
let c1 be Ordinal;
let c2 be non empty add-associative right_zeroed right_complementable doubleLoopStr ;
let c3, c4 be Series of c1,c2;
func c3 *' c4 -> Series of a1,a2 means :Def26: :: POLYNOM1:def 26
for b1 being bag of a1 ex b2 being FinSequence of the carrier of a2 st
( a5 . b1 = Sum b2 & len b2 = len (decomp b1) & ( for b3 being Nat st b3 in dom b2 holds
ex b4, b5 being bag of a1 st
( (decomp b1) /. b3 = <*b4,b5*> & b2 /. b3 = (a3 . b4) * (a4 . b5) ) ) );
existence
ex b1 being Series of c1,c2 st
for b2 being bag of c1 ex b3 being FinSequence of the carrier of c2 st
( b1 . b2 = Sum b3 & len b3 = len (decomp b2) & ( for b4 being Nat st b4 in dom b3 holds
ex b5, b6 being bag of c1 st
( (decomp b2) /. b4 = <*b5,b6*> & b3 /. b4 = (c3 . b5) * (c4 . b6) ) ) )
proof end;
uniqueness
for b1, b2 being Series of c1,c2 st ( for b3 being bag of c1 ex b4 being FinSequence of the carrier of c2 st
( b1 . b3 = Sum b4 & len b4 = len (decomp b3) & ( for b5 being Nat st b5 in dom b4 holds
ex b6, b7 being bag of c1 st
( (decomp b3) /. b5 = <*b6,b7*> & b4 /. b5 = (c3 . b6) * (c4 . b7) ) ) ) ) & ( for b3 being bag of c1 ex b4 being FinSequence of the carrier of c2 st
( b2 . b3 = Sum b4 & len b4 = len (decomp b3) & ( for b5 being Nat st b5 in dom b4 holds
ex b6, b7 being bag of c1 st
( (decomp b3) /. b5 = <*b6,b7*> & b4 /. b5 = (c3 . b6) * (c4 . b7) ) ) ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def26 defines *' POLYNOM1:def 26 :
for b1 being Ordinal
for b2 being non empty add-associative right_zeroed right_complementable doubleLoopStr
for b3, b4, b5 being Series of b1,b2 holds
( b5 = b3 *' b4 iff for b6 being bag of b1 ex b7 being FinSequence of the carrier of b2 st
( b5 . b6 = Sum b7 & len b7 = len (decomp b6) & ( for b8 being Nat st b8 in dom b7 holds
ex b9, b10 being bag of b1 st
( (decomp b6) /. b8 = <*b9,b10*> & b7 /. b8 = (b3 . b9) * (b4 . b10) ) ) ) );

theorem Th85: :: POLYNOM1:85
for b1 being Ordinal
for b2 being non empty Abelian add-associative right_zeroed right_complementable associative distributive doubleLoopStr
for b3, b4, b5 being Series of b1,b2 holds b3 *' (b4 + b5) = (b3 *' b4) + (b3 *' b5)
proof end;

theorem Th86: :: POLYNOM1:86
for b1 being Ordinal
for b2 being non empty Abelian add-associative right_zeroed right_complementable unital associative distributive doubleLoopStr
for b3, b4, b5 being Series of b1,b2 holds (b3 *' b4) *' b5 = b3 *' (b4 *' b5)
proof end;

definition
let c1 be Ordinal;
let c2 be non empty Abelian add-associative right_zeroed right_complementable commutative doubleLoopStr ;
let c3, c4 be Series of c1,c2;
redefine func *' as c3 *' c4 -> Series of a1,a2;
commutativity
for b1, b2 being Series of c1,c2 holds b1 *' b2 = b2 *' b1
proof end;
end;

theorem Th87: :: POLYNOM1:87
for b1 being Ordinal
for b2 being non empty add-associative right_zeroed right_complementable unital distributive doubleLoopStr
for b3 being Series of b1,b2 holds b3 *' (0_ b1,b2) = 0_ b1,b2
proof end;

theorem Th88: :: POLYNOM1:88
for b1 being Ordinal
for b2 being non empty add-associative right_zeroed right_complementable unital distributive non trivial doubleLoopStr
for b3 being Series of b1,b2 holds b3 *' (1_ b1,b2) = b3
proof end;

theorem Th89: :: POLYNOM1:89
for b1 being Ordinal
for b2 being non empty add-associative right_zeroed right_complementable unital distributive non trivial doubleLoopStr
for b3 being Series of b1,b2 holds (1_ b1,b2) *' b3 = b3
proof end;

registration
let c1 be set ;
let c2 be non empty ZeroStr ;
cluster finite-Support Relation of Bags a1,the carrier of a2;
existence
ex b1 being Series of c1,c2 st b1 is finite-Support
proof end;
end;

definition
let c1 be Ordinal;
let c2 be non empty ZeroStr ;
mode Polynomial of a1,a2 is finite-Support Series of a1,a2;
end;

registration
let c1 be Ordinal;
let c2 be non empty right_zeroed LoopStr ;
let c3, c4 be Polynomial of c1,c2;
cluster a3 + a4 -> finite-Support ;
coherence
c3 + c4 is finite-Support
proof end;
end;

registration
let c1 be Ordinal;
let c2 be non empty add-associative right_zeroed right_complementable LoopStr ;
let c3 be Polynomial of c1,c2;
cluster - a3 -> finite-Support ;
coherence
- c3 is finite-Support
proof end;
end;

registration
let c1 be Nat;
let c2 be non empty add-associative right_zeroed right_complementable LoopStr ;
let c3, c4 be Polynomial of c1,c2;
cluster a3 - a4 -> finite-Support ;
coherence
c3 - c4 is finite-Support
;
end;

registration
let c1 be Ordinal;
let c2 be non empty ZeroStr ;
cluster 0_ a1,a2 -> finite-Support ;
coherence
0_ c1,c2 is finite-Support
proof end;
end;

registration
let c1 be Ordinal;
let c2 be non empty add-associative right_zeroed right_complementable unital right-distributive non trivial doubleLoopStr ;
cluster 1_ a1,a2 -> finite-Support ;
coherence
1_ c1,c2 is finite-Support
proof end;
end;

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

definition
let c1 be Ordinal;
let c2 be non empty add-associative right_zeroed right_complementable unital distributive non trivial doubleLoopStr ;
func Polynom-Ring c1,c2 -> non empty strict doubleLoopStr means :Def27: :: POLYNOM1:def 27
( ( for b1 being set holds
( b1 in the carrier of a3 iff b1 is Polynomial of a1,a2 ) ) & ( for b1, b2 being Element of a3
for b3, b4 being Polynomial of a1,a2 st b1 = b3 & b2 = b4 holds
b1 + b2 = b3 + b4 ) & ( for b1, b2 being Element of a3
for b3, b4 being Polynomial of a1,a2 st b1 = b3 & b2 = b4 holds
b1 * b2 = b3 *' b4 ) & 0. a3 = 0_ a1,a2 & 1_ a3 = 1_ a1,a2 );
existence
ex b1 being non empty strict doubleLoopStr st
( ( for b2 being set holds
( b2 in the carrier of b1 iff b2 is Polynomial of c1,c2 ) ) & ( for b2, b3 being Element of b1
for b4, b5 being Polynomial of c1,c2 st b2 = b4 & b3 = b5 holds
b2 + b3 = b4 + b5 ) & ( for b2, b3 being Element of b1
for b4, b5 being Polynomial of c1,c2 st b2 = b4 & b3 = b5 holds
b2 * b3 = b4 *' b5 ) & 0. b1 = 0_ c1,c2 & 1_ b1 = 1_ c1,c2 )
proof end;
uniqueness
for b1, b2 being non empty strict doubleLoopStr st ( for b3 being set holds
( b3 in the carrier of b1 iff b3 is Polynomial of c1,c2 ) ) & ( for b3, b4 being Element of b1
for b5, b6 being Polynomial of c1,c2 st b3 = b5 & b4 = b6 holds
b3 + b4 = b5 + b6 ) & ( for b3, b4 being Element of b1
for b5, b6 being Polynomial of c1,c2 st b3 = b5 & b4 = b6 holds
b3 * b4 = b5 *' b6 ) & 0. b1 = 0_ c1,c2 & 1_ b1 = 1_ c1,c2 & ( for b3 being set holds
( b3 in the carrier of b2 iff b3 is Polynomial of c1,c2 ) ) & ( for b3, b4 being Element of b2
for b5, b6 being Polynomial of c1,c2 st b3 = b5 & b4 = b6 holds
b3 + b4 = b5 + b6 ) & ( for b3, b4 being Element of b2
for b5, b6 being Polynomial of c1,c2 st b3 = b5 & b4 = b6 holds
b3 * b4 = b5 *' b6 ) & 0. b2 = 0_ c1,c2 & 1_ b2 = 1_ c1,c2 holds
b1 = b2
proof end;
end;

:: deftheorem Def27 defines Polynom-Ring POLYNOM1:def 27 :
for b1 being Ordinal
for b2 being non empty add-associative right_zeroed right_complementable unital distributive non trivial doubleLoopStr
for b3 being non empty strict doubleLoopStr holds
( b3 = Polynom-Ring b1,b2 iff ( ( for b4 being set holds
( b4 in the carrier of b3 iff b4 is Polynomial of b1,b2 ) ) & ( for b4, b5 being Element of b3
for b6, b7 being Polynomial of b1,b2 st b4 = b6 & b5 = b7 holds
b4 + b5 = b6 + b7 ) & ( for b4, b5 being Element of b3
for b6, b7 being Polynomial of b1,b2 st b4 = b6 & b5 = b7 holds
b4 * b5 = b6 *' b7 ) & 0. b3 = 0_ b1,b2 & 1_ b3 = 1_ b1,b2 ) );

registration
let c1 be Ordinal;
let c2 be non empty Abelian add-associative right_zeroed right_complementable unital distributive non trivial doubleLoopStr ;
cluster Polynom-Ring a1,a2 -> non empty Abelian strict ;
coherence
Polynom-Ring c1,c2 is Abelian
proof end;
end;

registration
let c1 be Ordinal;
let c2 be non empty add-associative right_zeroed right_complementable unital distributive non trivial doubleLoopStr ;
cluster Polynom-Ring a1,a2 -> non empty add-associative strict ;
coherence
Polynom-Ring c1,c2 is add-associative
proof end;
end;

registration
let c1 be Ordinal;
let c2 be non empty add-associative right_zeroed right_complementable unital distributive non trivial doubleLoopStr ;
cluster Polynom-Ring a1,a2 -> non empty add-associative right_zeroed strict ;
coherence
Polynom-Ring c1,c2 is right_zeroed
proof end;
end;

registration
let c1 be Ordinal;
let c2 be non empty add-associative right_zeroed right_complementable unital distributive non trivial doubleLoopStr ;
cluster Polynom-Ring a1,a2 -> non empty add-associative right_zeroed right_complementable strict ;
coherence
Polynom-Ring c1,c2 is right_complementable
proof end;
end;

registration
let c1 be Ordinal;
let c2 be non empty Abelian add-associative right_zeroed right_complementable unital commutative distributive non trivial doubleLoopStr ;
cluster Polynom-Ring a1,a2 -> non empty Abelian add-associative right_zeroed right_complementable commutative strict ;
coherence
Polynom-Ring c1,c2 is commutative
proof end;
end;

registration
let c1 be Ordinal;
let c2 be non empty Abelian add-associative right_zeroed right_complementable unital associative distributive non trivial doubleLoopStr ;
cluster Polynom-Ring a1,a2 -> non empty Abelian add-associative right_zeroed right_complementable associative strict ;
coherence
Polynom-Ring c1,c2 is associative
proof end;
end;

E104: now
let c1 be Ordinal;
let c2 be non empty Abelian add-associative right_zeroed right_complementable unital associative distributive non trivial doubleLoopStr ;
set c3 = Polynom-Ring c1,c2;
let c4, c5 be Element of (Polynom-Ring c1,c2);
assume E105: c5 = 1_ (Polynom-Ring c1,c2) ;
reconsider c6 = c4 as Polynomial of c1,c2 by Def27;
E106: 1_ (Polynom-Ring c1,c2) = 1_ c1,c2 by Def27;
hence c4 * c5 = c6 *' (1_ c1,c2) by E105, Def27
.= c4 by Th88 ;

thus c5 * c4 = (1_ c1,c2) *' c6 by E106, E105, Def27
.= c4 by Th89 ;
end;

registration
let c1 be Ordinal;
let c2 be non empty Abelian add-associative right_zeroed right_complementable unital associative distributive non trivial doubleLoopStr ;
cluster Polynom-Ring a1,a2 -> non empty Abelian add-associative right_zeroed right_complementable unital associative strict right-distributive ;
coherence
( Polynom-Ring c1,c2 is unital & Polynom-Ring c1,c2 is right-distributive )
proof end;
end;

theorem Th90: :: POLYNOM1:90
for b1 being Ordinal
for b2 being non empty Abelian add-associative right_zeroed right_complementable unital associative distributive non trivial doubleLoopStr holds 1. (Polynom-Ring b1,b2) = 1_ b1,b2
proof end;

theorem Th91: :: POLYNOM1:91
for b1 being set
for b2, b3 being real-yielding ManySortedSet of b1 holds support (b2 + b3) c= (support b2) \/ (support b3)
proof end;