let R be domRing; :: thesis: for V being RightMod of R
for L being Linear_Combination of V
for a being Scalar of R holds Sum (L * a) = (Sum L) * a

let V be RightMod of R; :: thesis: for L being Linear_Combination of V
for a being Scalar of R holds Sum (L * a) = (Sum L) * a

let L be Linear_Combination of V; :: thesis: for a being Scalar of R holds Sum (L * a) = (Sum L) * a
let a be Scalar of R; :: thesis: Sum (L * a) = (Sum L) * a
per cases ( a <> 0. R or a = 0. R ) ;
suppose A1: a <> 0. R ; :: thesis: Sum (L * a) = (Sum L) * a
consider F being FinSequence of V such that
A2: F is one-to-one and
A3: rng F = Carrier (L * a) and
A4: Sum (L * a) = Sum ((L * a) (#) F) by Def9;
consider G being FinSequence of V such that
A5: G is one-to-one and
A6: rng G = Carrier L and
A7: Sum L = Sum (L (#) G) by Def9;
set g = L (#) G;
set f = (L * a) (#) F;
set l = L * a;
deffunc H1( Nat) -> set = F <- (G . $1);
consider P being FinSequence such that
A8: len P = len F and
A9: for k being Nat st k in dom P holds
P . k = H1(k) from FINSEQ_1:sch 2();
A10: dom P = Seg (len F) by A8, FINSEQ_1:def 3;
A11: Carrier (L * a) = Carrier L by A1, Th59;
A12: len G = len F by A1, A2, A3, A5, A6, Th59, FINSEQ_1:65;
A13: rng P c= dom F
proof
let x be set ; :: according to TARSKI:def 3 :: thesis: ( not x in rng P or x in dom F )
assume x in rng P ; :: thesis: x in dom F
then consider y being set such that
A14: y in dom P and
A15: P . y = x by FUNCT_1:def 5;
reconsider y = y as Nat by A14, FINSEQ_3:25;
A16: dom F = Seg (len F) by FINSEQ_1:def 3;
A17: y in dom F by A8, A14, FINSEQ_3:31;
y in dom G by A8, A12, A14, FINSEQ_3:31;
then G . y in rng F by A3, A6, A11, FUNCT_1:def 5;
then ( P . y = F <- (G . y) & F just_once_values G . y ) by A2, A9, A16, A17, A10, FINSEQ_4:10;
hence x in dom F by A15, FINSEQ_4:def 3; :: thesis: verum
end;
A18: now
let x be set ; :: thesis: ( ( x in dom G implies ( x in dom P & P . x in dom F ) ) & ( x in dom P & P . x in dom F implies x in dom G ) )
thus ( x in dom G implies ( x in dom P & P . x in dom F ) ) :: thesis: ( x in dom P & P . x in dom F implies x in dom G )
proof
assume x in dom G ; :: thesis: ( x in dom P & P . x in dom F )
then x in Seg (len P) by A8, A12, FINSEQ_1:def 3;
hence x in dom P by FINSEQ_1:def 3; :: thesis: P . x in dom F
then ( rng P c= dom F & P . x in rng P ) by A13, FUNCT_1:def 5;
hence P . x in dom F ; :: thesis: verum
end;
assume ( x in dom P & P . x in dom F ) ; :: thesis: x in dom G
then x in Seg (len P) by FINSEQ_1:def 3;
hence x in dom G by A8, A12, FINSEQ_1:def 3; :: thesis: verum
end;
now
let x be set ; :: thesis: ( x in dom G implies G . x = F . (P . x) )
assume A19: x in dom G ; :: thesis: G . x = F . (P . x)
then reconsider n = x as Nat by FINSEQ_3:25;
G . n in rng F by A3, A6, A11, A19, FUNCT_1:def 5;
then A20: F just_once_values G . n by A2, FINSEQ_4:10;
n in Seg (len F) by A12, A19, FINSEQ_1:def 3;
then F . (P . n) = F . (F <- (G . n)) by A9, A10
.= G . n by A20, FINSEQ_4:def 3 ;
hence G . x = F . (P . x) ; :: thesis: verum
end;
then A21: G = F * P by A18, FUNCT_1:20;
dom F c= rng P
proof
let x be set ; :: according to TARSKI:def 3 :: thesis: ( not x in dom F or x in rng P )
assume A22: x in dom F ; :: thesis: x in rng P
set f = (F " ) * G;
dom (F " ) = rng G by A2, A3, A6, A11, FUNCT_1:55;
then A23: rng ((F " ) * G) = rng (F " ) by RELAT_1:47
.= dom F by A2, FUNCT_1:55 ;
(F " ) * G = ((F " ) * F) * P by A21, RELAT_1:55
.= (id (dom F)) * P by A2, FUNCT_1:61
.= P by A13, RELAT_1:79 ;
hence x in rng P by A22, A23; :: thesis: verum
end;
then A24: dom F = rng P by A13, XBOOLE_0:def 10;
A25: dom P = dom F by A8, FINSEQ_3:31;
then A26: P is one-to-one by A24, FINSEQ_4:75;
A27: len ((L * a) (#) F) = len F by Def8;
then A28: dom ((L * a) (#) F) = dom F by FINSEQ_3:31;
( dom F = {} implies dom F = {} ) ;
then reconsider P = P as Function of (dom F),(dom F) by A13, A25, FUNCT_2:def 1, RELSET_1:11;
reconsider P = P as Function of (dom ((L * a) (#) F)),(dom ((L * a) (#) F)) by A28;
reconsider Fp = ((L * a) (#) F) * P as FinSequence of V by FINSEQ_2:51;
reconsider P = P as Permutation of (dom ((L * a) (#) F)) by A24, A26, A28, FUNCT_2:83;
A29: Fp = ((L * a) (#) F) * P ;
then A30: Sum Fp = Sum ((L * a) (#) F) by RLVECT_2:9;
A31: len Fp = len ((L * a) (#) F) by A29, FINSEQ_2:48;
then A32: len Fp = len (L (#) G) by A12, A27, Def8;
now
let k be Nat; :: thesis: for v being Vector of V st k in dom Fp & v = (L (#) G) . k holds
Fp . k = v * a

let v be Vector of V; :: thesis: ( k in dom Fp & v = (L (#) G) . k implies Fp . k = v * a )
assume that
A33: k in dom Fp and
A34: v = (L (#) G) . k ; :: thesis: Fp . k = v * a
A35: k in Seg (len (L (#) G)) by A32, A33, FINSEQ_1:def 3;
then A36: k in dom G by A12, A27, A31, A32, FINSEQ_1:def 3;
then G . k in rng G by FUNCT_1:def 5;
then F just_once_values G . k by A2, A3, A6, A11, FINSEQ_4:10;
then A37: F <- (G . k) in dom F by FINSEQ_4:def 3;
then reconsider i = F <- (G . k) as Nat by FINSEQ_3:25;
A38: k in dom (L (#) G) by A35, FINSEQ_1:def 3;
A39: k in dom P by A8, A27, A31, A32, A35, FINSEQ_1:def 3;
A40: G /. k = G . k by A36, PARTFUN1:def 8
.= F . (P . k) by A21, A39, FUNCT_1:23
.= F . i by A9, A27, A31, A32, A35, A10
.= F /. i by A37, PARTFUN1:def 8 ;
i in Seg (len ((L * a) (#) F)) by A27, A37, FINSEQ_1:def 3;
then A41: i in dom ((L * a) (#) F) by FINSEQ_1:def 3;
thus Fp . k = ((L * a) (#) F) . (P . k) by A39, FUNCT_1:23
.= ((L * a) (#) F) . (F <- (G . k)) by A9, A27, A31, A32, A35, A10
.= (F /. i) * ((L * a) . (F /. i)) by A41, Def8
.= (F /. i) * ((L . (F /. i)) * a) by Def12
.= ((F /. i) * (L . (F /. i))) * a by VECTSP_2:def 23
.= v * a by A34, A38, A40, Def8 ; :: thesis: verum
end;
hence Sum (L * a) = (Sum L) * a by A4, A7, A30, A32, Th1; :: thesis: verum
end;
suppose A42: a = 0. R ; :: thesis: Sum (L * a) = (Sum L) * a
hence Sum (L * a) = Sum (ZeroLC V) by Th60
.= 0. V by Lm3
.= (Sum L) * a by A42, VECTSP_2:90 ;
:: thesis: verum
end;
end;