let n be Ordinal; :: thesis: for L being non empty non trivial right_complementable Abelian add-associative right_zeroed well-unital distributive doubleLoopStr
for p being Polynomial of n,L st ex b being bag of n st Support p = {b} holds
for q being Polynomial of n,L
for x being Function of n,L holds eval (p + q),x = (eval p,x) + (eval q,x)

let L be non empty non trivial right_complementable Abelian add-associative right_zeroed well-unital distributive doubleLoopStr ; :: thesis: for p being Polynomial of n,L st ex b being bag of n st Support p = {b} holds
for q being Polynomial of n,L
for x being Function of n,L holds eval (p + q),x = (eval p,x) + (eval q,x)

let p be Polynomial of n,L; :: thesis: ( ex b being bag of n st Support p = {b} implies for q being Polynomial of n,L
for x being Function of n,L holds eval (p + q),x = (eval p,x) + (eval q,x) )

assume ex b being bag of n st Support p = {b} ; :: thesis: for q being Polynomial of n,L
for x being Function of n,L holds eval (p + q),x = (eval p,x) + (eval q,x)

then consider b being bag of n such that
A1: Support p = {b} ;
b in Support p by A1, TARSKI:def 1;
then A2: p . b <> 0. L by POLYNOM1:def 9;
let q be Polynomial of n,L; :: thesis: for x being Function of n,L holds eval (p + q),x = (eval p,x) + (eval q,x)
let x be Function of n,L; :: thesis: eval (p + q),x = (eval p,x) + (eval q,x)
A3: for b9 being bag of n st b9 <> b holds
(p + q) . b9 = q . b9
proof
let b9 be bag of n; :: thesis: ( b9 <> b implies (p + q) . b9 = q . b9 )
A4: b9 is Element of Bags n by PRE_POLY:def 12;
assume b9 <> b ; :: thesis: (p + q) . b9 = q . b9
then A5: not b9 in Support p by A1, TARSKI:def 1;
thus (p + q) . b9 = (p . b9) + (q . b9) by POLYNOM1:def 21
.= (0. L) + (q . b9) by A5, A4, POLYNOM1:def 9
.= q . b9 by RLVECT_1:def 7 ; :: thesis: verum
end;
set sq = SgmX (BagOrder n),(Support q);
set spq = SgmX (BagOrder n),(Support (p + q));
A6: b is Element of Bags n by PRE_POLY:def 12;
A7: Support (p + q) c= (Support p) \/ (Support q) by POLYNOM1:79;
consider yq being FinSequence of the carrier of L such that
A8: len yq = len (SgmX (BagOrder n),(Support q)) and
A9: eval q,x = Sum yq and
A10: for i being Element of NAT st 1 <= i & i <= len yq holds
yq /. i = ((q * (SgmX (BagOrder n),(Support q))) /. i) * (eval (((SgmX (BagOrder n),(Support q)) /. i) @ ),x) by Def4;
consider ypq being FinSequence of the carrier of L such that
A11: len ypq = len (SgmX (BagOrder n),(Support (p + q))) and
A12: eval (p + q),x = Sum ypq and
A13: for i being Element of NAT st 1 <= i & i <= len ypq holds
ypq /. i = (((p + q) * (SgmX (BagOrder n),(Support (p + q)))) /. i) * (eval (((SgmX (BagOrder n),(Support (p + q))) /. i) @ ),x) by Def4;
A14: BagOrder n linearly_orders Support q by Th20;
now
per cases ( b in Support q or not b in Support q ) ;
case A15: b in Support q ; :: thesis: eval (p + q),x = (eval p,x) + (eval q,x)
now
per cases ( p . b = - (q . b) or p . b <> - (q . b) ) ;
case A16: p . b = - (q . b) ; :: thesis: eval (p + q),x = (eval q,x) + (eval p,x)
A17: for u being set st u in Support q holds
u in (Support (p + q)) \/ {b}
proof
let u be set ; :: thesis: ( u in Support q implies u in (Support (p + q)) \/ {b} )
assume A18: u in Support q ; :: thesis: u in (Support (p + q)) \/ {b}
then reconsider u = u as bag of n ;
end;
(p + q) . b = (p . b) + (q . b) by POLYNOM1:def 21
.= 0. L by A16, RLVECT_1:16 ;
then A20: not b in Support (p + q) by POLYNOM1:def 9;
for u being set st u in (Support (p + q)) \/ {b} holds
u in Support q then A23: (Support (p + q)) \/ {b} = Support q by A17, TARSKI:2;
thus eval (p + q),x = (eval (p + q),x) + (0. L) by RLVECT_1:def 7
.= (eval (p + q),x) + (((q . b) * (eval b,x)) + (- ((q . b) * (eval b,x)))) by RLVECT_1:16
.= ((eval (p + q),x) + ((q . b) * (eval b,x))) + (- ((q . b) * (eval b,x))) by RLVECT_1:def 6
.= (eval q,x) + (- ((q . b) * (eval b,x))) by A3, A20, A23, Lm10
.= (eval q,x) + ((p . b) * (eval b,x)) by A16, VECTSP_1:41
.= (eval q,x) + (eval p,x) by A1, Th21 ; :: thesis: verum
end;
case A24: p . b <> - (q . b) ; :: thesis: eval (p + q),x = (eval p,x) + (eval q,x)
(p . b) + (q . b) <> (- (q . b)) + (q . b)
proof
assume A25: (p . b) + (q . b) = (- (q . b)) + (q . b) ; :: thesis: contradiction
p . b = (p . b) + (0. L) by RLVECT_1:def 7
.= (p . b) + ((q . b) + (- (q . b))) by RLVECT_1:16
.= ((- (q . b)) + (q . b)) + (- (q . b)) by A25, RLVECT_1:def 6
.= (0. L) + (- (q . b)) by RLVECT_1:16
.= - (q . b) by RLVECT_1:def 7 ;
hence contradiction by A24; :: thesis: verum
end;
then (p . b) + (q . b) <> 0. L by RLVECT_1:16;
then A26: (p + q) . b <> 0. L by POLYNOM1:def 21;
A27: for u being set st u in Support q holds
u in Support (p + q)
proof
let u be set ; :: thesis: ( u in Support q implies u in Support (p + q) )
assume A28: u in Support q ; :: thesis: u in Support (p + q)
then reconsider u = u as bag of n ;
end;
A30: for u being set st u in Support (p + q) holds
u in Support q
proof
let u be set ; :: thesis: ( u in Support (p + q) implies u in Support q )
assume A31: u in Support (p + q) ; :: thesis: u in Support q
then reconsider u = u as bag of n ;
end;
then A32: Support (p + q) = Support q by A27, TARSKI:2;
A33: len ypq = len yq by A11, A8, A30, A27, TARSKI:2;
consider spqk being Nat such that
A34: dom (SgmX (BagOrder n),(Support (p + q))) = Seg spqk by FINSEQ_1:def 2;
b in rng (SgmX (BagOrder n),(Support q)) by A14, A15, PRE_POLY:def 2;
then consider k being Nat such that
A35: k in dom (SgmX (BagOrder n),(Support q)) and
A36: (SgmX (BagOrder n),(Support q)) . k = b by FINSEQ_2:11;
consider sqk being Nat such that
A37: dom (SgmX (BagOrder n),(Support q)) = Seg sqk by FINSEQ_1:def 2;
reconsider k = k as Element of NAT by ORDINAL1:def 13;
reconsider k = k, sqk = sqk, spqk = spqk as Element of NAT by ORDINAL1:def 13;
A38: 1 <= k by A35, A37, FINSEQ_1:3;
A39: dom (p + q) = Bags n by FUNCT_2:def 1;
then (SgmX (BagOrder n),(Support q)) . k in dom (p + q) by A36, PRE_POLY:def 12;
then A40: k in dom ((p + q) * (SgmX (BagOrder n),(Support q))) by A35, FUNCT_1:21;
then A41: ((p + q) * (SgmX (BagOrder n),(Support q))) /. k = ((p + q) * (SgmX (BagOrder n),(Support q))) . k by PARTFUN1:def 8
.= (p + q) . b by A36, A40, FUNCT_1:22 ;
A42: k <= sqk by A35, A37, FINSEQ_1:3;
A43: dom q = Bags n by FUNCT_2:def 1;
then (SgmX (BagOrder n),(Support q)) . k in dom q by A36, PRE_POLY:def 12;
then A44: k in dom (q * (SgmX (BagOrder n),(Support q))) by A35, FUNCT_1:21;
then A45: (q * (SgmX (BagOrder n),(Support q))) /. k = (q * (SgmX (BagOrder n),(Support q))) . k by PARTFUN1:def 8
.= q . b by A36, A44, FUNCT_1:22 ;
consider i being Nat such that
A46: dom yq = Seg i by FINSEQ_1:def 2;
A47: sqk = len (SgmX (BagOrder n),(Support q)) by A37, FINSEQ_1:def 3
.= len (SgmX (BagOrder n),(Support (p + q))) by A30, A27, TARSKI:2
.= spqk by A34, FINSEQ_1:def 3 ;
A48: i in NAT by ORDINAL1:def 13;
then A49: len yq = i by A46, FINSEQ_1:def 3;
A50: for i9 being Element of NAT st i9 in dom yq & i9 <> k holds
ypq /. i9 = yq /. i9
proof
let i9 be Element of NAT ; :: thesis: ( i9 in dom yq & i9 <> k implies ypq /. i9 = yq /. i9 )
assume that
A51: i9 in dom yq and
A52: i9 <> k ; :: thesis: ypq /. i9 = yq /. i9
A53: 1 <= i9 by A46, A51, FINSEQ_1:3;
i9 in Seg (len (SgmX (BagOrder n),(Support (p + q)))) by A11, A33, A51, FINSEQ_1:def 3;
then A54: i9 in dom (SgmX (BagOrder n),(Support (p + q))) by FINSEQ_1:def 3;
then (SgmX (BagOrder n),(Support (p + q))) /. i9 = (SgmX (BagOrder n),(Support (p + q))) . i9 by PARTFUN1:def 8;
then A55: i9 in dom ((p + q) * (SgmX (BagOrder n),(Support (p + q)))) by A39, A54, FUNCT_1:21;
then A56: ((p + q) * (SgmX (BagOrder n),(Support (p + q)))) /. i9 = ((p + q) * (SgmX (BagOrder n),(Support (p + q)))) . i9 by PARTFUN1:def 8
.= (p + q) . ((SgmX (BagOrder n),(Support (p + q))) . i9) by A55, FUNCT_1:22
.= (p + q) . ((SgmX (BagOrder n),(Support (p + q))) /. i9) by A54, PARTFUN1:def 8 ;
A57: (SgmX (BagOrder n),(Support (p + q))) /. i9 <> b
proof
assume (SgmX (BagOrder n),(Support (p + q))) /. i9 = b ; :: thesis: contradiction
then A58: (SgmX (BagOrder n),(Support (p + q))) . i9 = b by A54, PARTFUN1:def 8;
A59: SgmX (BagOrder n),(Support (p + q)) is one-to-one by Th20, PRE_POLY:10;
(SgmX (BagOrder n),(Support (p + q))) . k = b by A30, A27, A36, TARSKI:2;
hence contradiction by A35, A37, A34, A47, A52, A54, A58, A59, FUNCT_1:def 8; :: thesis: verum
end;
A60: i9 in dom (SgmX (BagOrder n),(Support q)) by A8, A46, A49, A51, FINSEQ_1:def 3;
(SgmX (BagOrder n),(Support q)) /. i9 = (SgmX (BagOrder n),(Support q)) . i9 by A37, A34, A47, A54, PARTFUN1:def 8;
then A61: i9 in dom (q * (SgmX (BagOrder n),(Support q))) by A43, A60, FUNCT_1:21;
then A62: (q * (SgmX (BagOrder n),(Support q))) /. i9 = (q * (SgmX (BagOrder n),(Support q))) . i9 by PARTFUN1:def 8
.= q . ((SgmX (BagOrder n),(Support q)) . i9) by A61, FUNCT_1:22
.= q . ((SgmX (BagOrder n),(Support q)) /. i9) by A60, PARTFUN1:def 8 ;
A63: i9 <= len yq by A46, A49, A51, FINSEQ_1:3;
hence ypq /. i9 = (((p + q) * (SgmX (BagOrder n),(Support (p + q)))) /. i9) * (eval (((SgmX (BagOrder n),(Support (p + q))) /. i9) @ ),x) by A13, A33, A53
.= (q . ((SgmX (BagOrder n),(Support q)) /. i9)) * (eval (((SgmX (BagOrder n),(Support q)) /. i9) @ ),x) by A3, A32, A57, A56
.= yq /. i9 by A10, A53, A63, A62 ;
:: thesis: verum
end;
A64: (SgmX (BagOrder n),(Support q)) /. k = b by A35, A36, PARTFUN1:def 8;
A65: sqk = len yq by A8, A37, FINSEQ_1:def 3;
then k <= i by A42, A46, A48, FINSEQ_1:def 3;
then A66: k in dom yq by A38, A46, FINSEQ_1:3;
len ypq = sqk by A11, A34, A47, FINSEQ_1:def 3;
then ypq /. k = (((p + q) * (SgmX (BagOrder n),(Support (p + q)))) /. k) * (eval (((SgmX (BagOrder n),(Support (p + q))) /. k) @ ),x) by A13, A38, A42
.= ((p . b) + (q . b)) * (eval b,x) by A32, A64, A41, POLYNOM1:def 21
.= ((p . b) * (eval b,x)) + (((q * (SgmX (BagOrder n),(Support q))) /. k) * (eval (((SgmX (BagOrder n),(Support q)) /. k) @ ),x)) by A64, A45, VECTSP_1:def 18
.= ((p . b) * (eval b,x)) + (yq /. k) by A10, A38, A42, A65 ;
hence eval (p + q),x = ((p . b) * (eval b,x)) + (Sum yq) by A12, A33, A66, A50, Th7
.= (eval p,x) + (eval q,x) by A1, A9, Th21 ;
:: thesis: verum
end;
end;
end;
hence eval (p + q),x = (eval p,x) + (eval q,x) ; :: thesis: verum
end;
case A67: not b in Support q ; :: thesis: eval (p + q),x = (eval q,x) + (eval p,x)
A68: (p + q) . b = (p . b) + (q . b) by POLYNOM1:def 21
.= (p . b) + (0. L) by A6, A67, POLYNOM1:def 9
.= p . b by RLVECT_1:def 7 ;
A69: for u being set st u in (Support p) \/ (Support q) holds
u in Support (p + q)
proof
let u be set ; :: thesis: ( u in (Support p) \/ (Support q) implies u in Support (p + q) )
assume A70: u in (Support p) \/ (Support q) ; :: thesis: u in Support (p + q)
end;
for u being set st u in Support (p + q) holds
u in (Support p) \/ (Support q) by A7;
then Support (p + q) = {b} \/ (Support q) by A1, A69, TARSKI:2;
hence eval (p + q),x = (eval q,x) + (((p + q) . b) * (eval b,x)) by A3, A67, Lm10
.= (eval q,x) + (eval p,x) by A1, A68, Th21 ;
:: thesis: verum
end;
end;
end;
hence eval (p + q),x = (eval p,x) + (eval q,x) ; :: thesis: verum