reserve s1,s2,q1 for Real_Sequence;
reserve n for Element of NAT;
reserve a,b for Real;

theorem Th7:
for Y be RealNormSpace, E be Point of Y, q be FinSequence of REAL,
    S be FinSequence of Y
 st len S = len q
  & for i be Nat st i in dom S holds ex r be Real st r = q.i & S.i= r * E
 holds Sum S = (Sum q)*E
proof
  let Y be RealNormSpace, E be Point of Y;
  defpred P[Nat] means
   for q be FinSequence of REAL, S be FinSequence of Y st
     $1 = len S & len S = len q &
     for i be Nat st i in dom S holds ex r be Real st r = q.i & S.i= r * E
   holds Sum S = (Sum q)*E;
A1:P[0]
   proof
    let q be FinSequence of REAL, S be FinSequence of Y;
    assume 0 = len S & len S = len q &
      for i be Nat st i in dom S holds
        ex r be Real st r = q.i & S.i= r * E; then
A2: <*>(the carrier of Y) = S & <*> REAL = q; then
    (Sum q)*E = 0.Y by RLVECT_1:10,RVSUM_1:72;
    hence thesis by A2,RLVECT_1:43;
   end;
A3:now let i be Nat;
    assume A4: P[i];
    now let q be FinSequence of REAL, S be FinSequence of Y;
     set S0=S|i, q0=q|i;
     assume A5: i+1 = len S & len S = len q
        & for i be Nat st i in dom S holds
             ex r be Real st r = q.i & S.i= r * E;
A6:  for k be Nat st k in dom S0 holds
           ex r be Real st r = q0.k & S0.k= r * E
     proof
      let k be Nat;
      assume k in dom S0; then
A7:   k in Seg i & k in dom S by RELAT_1:57; then
      consider r be Real such that
A8:    r = q.k & S.k= r * E by A5;
      take r;
      thus thesis by A8,A7,FUNCT_1:49;
     end;
     dom S = Seg(i+1) by A5,FINSEQ_1:def 3; then
     consider r be Real such that
A9:   r = q.(i+1) & S.(i+1)= r * E by A5,FINSEQ_1:4;
A10:  1 <= i + 1 & i + 1 <= len q by A5,NAT_1:11;
     q = (q|i)^<*q/.(i+1)*> by A5,FINSEQ_5:21; then
     q = q0^<*q.(i+1)*> by A10,FINSEQ_4:15; then
     (Sum q)*E = (Sum q0 + q.(i+1))*E by RVSUM_1:74; then
A11: (Sum q)*E = (Sum q0)*E + q.(i+1)*E by RLVECT_1:def 6;
A12: i = len S0 & i = len q0 by FINSEQ_1:59,A5,NAT_1:11;
     reconsider v=S.(i+1) as Point of Y by A9;
     S0 = S| dom S0 by FINSEQ_1:def 3,A12; then
     Sum S = Sum S0 + v by A5,A12,RLVECT_1:38;
     hence Sum S = (Sum q)*E by A9,A4,A6,A12,A11;
   end;
   hence P[i+1];
  end;
  for i being Nat holds P[i] from NAT_1:sch 2(A1,A3);
  hence thesis;
end;
