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

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

let L be Linear_Combination of V; :: thesis: for a being Scalar of R holds Sum (a * L) = a * (Sum L)
let a be Scalar of R; :: thesis: Sum (a * L) = a * (Sum L)
per cases ( a <> 0. R or a = 0. R ) ;
suppose A1: a <> 0. R ; :: thesis: Sum (a * L) = a * (Sum L)
set l = a * L;
A2: Carrier (a * L) = Carrier L by A1, Th7;
consider G being FinSequence of the carrier of V such that
A3: G is one-to-one and
A4: rng G = Carrier L and
A5: Sum L = Sum (L (#) G) by VECTSP_6:def 6;
set g = L (#) G;
consider F being FinSequence of the carrier of V such that
A6: F is one-to-one and
A7: rng F = Carrier (a * L) and
A8: Sum (a * L) = Sum ((a * L) (#) F) by VECTSP_6:def 6;
A9: len G = len F by A1, A6, A7, A3, A4, Th7, FINSEQ_1:48;
set f = (a * L) (#) F;
deffunc H1( Nat) -> set = F <- (G . $1);
consider P being FinSequence such that
A10: len P = len F and
A11: for k being Nat st k in dom P holds
P . k = H1(k) from FINSEQ_1:sch 2();
A12: ( Seg (len F) = dom F & dom P = dom F ) by A10, FINSEQ_1:def 3, FINSEQ_3:29;
A13: now
let x be set ; :: thesis: ( x in dom G implies G . x = F . (P . x) )
assume A14: x in dom G ; :: thesis: G . x = F . (P . x)
then reconsider n = x as Element of NAT ;
G . n in rng F by A7, A4, A2, A14, FUNCT_1:def 3;
then A15: F just_once_values G . n by A6, FINSEQ_4:8;
n in Seg (len F) by A9, A14, FINSEQ_1:def 3;
then F . (P . n) = F . (F <- (G . n)) by A11, A12
.= G . n by A15, FINSEQ_4:def 3 ;
hence G . x = F . (P . x) ; :: thesis: verum
end;
A16: 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
A17: y in dom P and
A18: P . y = x by FUNCT_1:def 3;
reconsider y = y as Element of NAT by A17;
y in dom G by A10, A9, A17, FINSEQ_3:29;
then G . y in rng F by A7, A4, A2, FUNCT_1:def 3;
then A19: F just_once_values G . y by A6, FINSEQ_4:8;
P . y = F <- (G . y) by A11, A17;
hence x in dom F by A18, A19, FINSEQ_4:def 3; :: thesis: verum
end;
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 )
hence x in dom P by A10, A9, FINSEQ_3:29; :: thesis: P . x in dom F
then P . x in rng P by FUNCT_1:def 3;
hence P . x in dom F by A16; :: thesis: verum
end;
assume that
A20: x in dom P and
P . x in dom F ; :: thesis: x in dom G
thus x in dom G by A10, A9, A20, FINSEQ_3:29; :: thesis: verum
end;
then A21: G = F * P by A13, FUNCT_1:10;
dom F c= rng P
proof
set f = (F ") * G;
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
dom (F ") = rng G by A6, A7, A4, A2, FUNCT_1:33;
then A23: rng ((F ") * G) = rng (F ") by RELAT_1:28
.= dom F by A6, FUNCT_1:33 ;
(F ") * G = ((F ") * F) * P by A21, RELAT_1:36
.= (id (dom F)) * P by A6, FUNCT_1:39
.= P by A16, RELAT_1:53 ;
hence x in rng P by A22, A23; :: thesis: verum
end;
then A24: dom F = rng P by A16, XBOOLE_0:def 10;
A25: dom P = dom F by A10, FINSEQ_3:29;
then A26: P is one-to-one by A24, FINSEQ_4:60;
( dom F = {} implies dom F = {} ) ;
then reconsider P = P as Function of (dom F),(dom F) by A16, A25, FUNCT_2:def 1, RELSET_1:4;
A27: len ((a * L) (#) F) = len F by VECTSP_6:def 5;
then A28: dom ((a * L) (#) F) = dom F by FINSEQ_3:29;
then reconsider P = P as Function of (dom ((a * L) (#) F)),(dom ((a * L) (#) F)) ;
reconsider Fp = ((a * L) (#) F) * P as FinSequence of the carrier of V by FINSEQ_2:47;
reconsider P = P as Permutation of (dom ((a * L) (#) F)) by A24, A26, A28, FUNCT_2:57;
A29: Fp = ((a * L) (#) F) * P ;
then A30: len Fp = len ((a * L) (#) F) by FINSEQ_2:44;
then A31: len Fp = len (L (#) G) by A9, A27, VECTSP_6:def 5;
A32: now
let k be Element of NAT ; :: thesis: for v being Vector of V st k in dom Fp & v = (L (#) G) . k holds
Fp . k = a * v

let v be Vector of V; :: thesis: ( k in dom Fp & v = (L (#) G) . k implies Fp . k = a * v )
assume that
A33: k in dom Fp and
A34: v = (L (#) G) . k ; :: thesis: Fp . k = a * v
A35: k in Seg (len (L (#) G)) by A31, A33, FINSEQ_1:def 3;
then A36: k in dom P by A10, A27, A30, A31, FINSEQ_1:def 3;
A37: k in dom G by A9, A27, A30, A31, A35, FINSEQ_1:def 3;
then G . k in rng G by FUNCT_1:def 3;
then F just_once_values G . k by A6, A7, A4, A2, FINSEQ_4:8;
then A38: F <- (G . k) in dom F by FINSEQ_4:def 3;
then reconsider i = F <- (G . k) as Element of NAT ;
A39: G /. k = G . k by A37, PARTFUN1:def 6
.= F . (P . k) by A21, A36, FUNCT_1:13
.= F . i by A11, A12, A27, A30, A31, A35
.= F /. i by A38, PARTFUN1:def 6 ;
A40: k in dom (L (#) G) by A35, FINSEQ_1:def 3;
i in Seg (len ((a * L) (#) F)) by A27, A38, FINSEQ_1:def 3;
then A41: i in dom ((a * L) (#) F) by FINSEQ_1:def 3;
thus Fp . k = ((a * L) (#) F) . (P . k) by A36, FUNCT_1:13
.= ((a * L) (#) F) . (F <- (G . k)) by A11, A12, A27, A30, A31, A35
.= ((a * L) . (F /. i)) * (F /. i) by A41, VECTSP_6:def 5
.= (a * (L . (F /. i))) * (F /. i) by VECTSP_6:def 9
.= a * ((L . (F /. i)) * (F /. i)) by VECTSP_1:def 16
.= a * v by A34, A40, A39, VECTSP_6:def 5 ; :: thesis: verum
end;
Sum Fp = Sum ((a * L) (#) F) by A29, RLVECT_2:7;
hence Sum (a * L) = a * (Sum L) by A8, A5, A31, A32, RLVECT_2:66; :: thesis: verum
end;
suppose A42: a = 0. R ; :: thesis: Sum (a * L) = a * (Sum L)
hence Sum (a * L) = Sum (ZeroLC V) by VECTSP_6:30
.= 0. V by VECTSP_6:15
.= a * (Sum L) by A42, VECTSP_1:14 ;
:: thesis: verum
end;
end;