reserve x,y for set,
        r,s for Real,
        S for non empty addLoopStr,
        LS,LS1,LS2 for Linear_Combination of S,
        G for Abelian add-associative right_zeroed right_complementable
          non empty addLoopStr,
        LG,LG1,LG2 for Linear_Combination of G,
        g,h for Element of G,
        RLS for non empty RLSStruct,
        R for vector-distributive scalar-distributive scalar-associative
        scalar-unitalnon empty RLSStruct,
        AR for Subset of R,
        LR,LR1,LR2 for Linear_Combination of R,
        V for RealLinearSpace,
        v,v1,v2,w,p for VECTOR of V,
        A,B for Subset of V,
        F1,F2 for Subset-Family of V,
        L,L1,L2 for Linear_Combination of V;

theorem Th40:
  Sum (r(*)L) = r * Sum L
  proof
    defpred P[Nat] means
    for L be Linear_Combination of V st card Carrier L<=$1 holds Sum(r(*)L)=r*
    Sum L;
    A1: for n be Nat st P[n] holds P[n+1]
    proof
      let n be Nat such that
      A2: P[n];
      let L be Linear_Combination of V such that
      A3: card Carrier L<=n+1;
      per cases;
      suppose r=0;
        then r(*)L=ZeroLC(V) & r*Sum L=0.V by Def2,RLVECT_1:10;
        hence thesis by RLVECT_2:30;
      end;
      suppose A4: r<>0;
        per cases by A3,NAT_1:8;
        suppose card Carrier L<=n;
          hence thesis by A2;
        end;
        suppose A5: card Carrier L=n+1;
          then Carrier L<>{};
          then consider p be object such that
          A6: p in Carrier L by XBOOLE_0:def 1;
          reconsider p as Element of V by A6;
          A7: card(Carrier L\{p})=n by A5,A6,STIRL2_1:55;
          consider Lp be Linear_Combination of{p} such that
          A8: Lp.p=L.p by RLVECT_4:37;
          set LLp=L-Lp;
          LLp.p = L.p-Lp.p by RLVECT_2:54
               .= 0 by A8;
          then A9: not p in Carrier LLp by RLVECT_2:19;
          A10: Carrier Lp c={p} by RLVECT_2:def 6;
          then A11: Carrier LLp c=Carrier L\/Carrier Lp &
            Carrier L\/Carrier Lp c= Carrier L\/{p} by RLVECT_2:55,XBOOLE_1:9;
          r*Carrier Lp c={r*p}
          proof
            let x be object;
            assume x in r*Carrier Lp;
            then consider w be Element of V such that
            A12: x=r*w and
            A13: w in Carrier Lp;
            w=p by A10,A13,TARSKI:def 1;
            hence thesis by A12,TARSKI:def 1;
          end;
          then Carrier(r(*)Lp)c={r*p} by A4,Th23;
          then r(*)Lp is Linear_Combination of{r*p} by RLVECT_2:def 6;
          then A14: Sum(r(*)Lp)=(r(*)Lp).(r*p)*(r*p) by RLVECT_2:32
                              .=Lp.(r"*(r*p))*(r*p) by A4,Def2
                              .=Lp.((r"*r)*p)*(r*p) by RLVECT_1:def 7
                              .=Lp.(1*p)*(r*p) by A4,XCMPLX_0:def 7
                              .=Lp.p*(r*p) by RLVECT_1:def 8;
          A15: LLp+Lp=L+(Lp-Lp) by RLVECT_2:40
                    .=L+ZeroLC(V) by RLVECT_2:57
                    .=L by RLVECT_2:41;
          then A16: Sum L=Sum LLp+Sum Lp by RLVECT_3:1
                        .=Sum LLp+Lp.p*p by RLVECT_2:32;
          Carrier L\/{p}=Carrier L by A6,ZFMISC_1:40;
          then Carrier LLp c=Carrier L by A11;
          then card Carrier LLp<=n by A9,A7,NAT_1:43,ZFMISC_1:34;
          then A17: Sum(r(*)LLp)=r*Sum LLp by A2;
          r(*)L=(r(*)LLp)+(r(*)Lp) by A15,Th24;
          hence Sum(r(*)L)=Sum(r(*)LLp)+Sum(r(*)Lp) by RLVECT_3:1
                             .=r*Sum LLp+(Lp.p*r)*p by A14,A17,RLVECT_1:def 7
                             .=r*Sum LLp+r*(Lp.p*p) by RLVECT_1:def 7
                             .=r*Sum L by A16,RLVECT_1:def 5;
        end;
      end;
    end;
    A18: P[0 qua Nat]
    proof
      let L;
      assume card Carrier L<=0;
      then Carrier L={};
      then A19: L=ZeroLC(V) by RLVECT_2:def 5;
      then r*0.V=0.V & Sum L=0.V by RLVECT_2:30;
      hence thesis by A19,Th26;
    end;
    for n be Nat holds P[n] from NAT_1:sch 2(A18,A1);
    then P[card Carrier L];
    hence thesis;
  end;
