 reserve R for Ring;
 reserve x, y, y1 for set;
 reserve a, b for Element of R;
 reserve V for LeftMod of R;
 reserve v, w for Vector of V;
 reserve u,v,w for Vector of V;
 reserve F,G,H,I for FinSequence of V;
 reserve j,k,n for Nat;
 reserve f,f9,g for sequence of V;

theorem Th12:
  len F = len G & (for k,v st k in dom F & v = G.k holds F.k = a * v)
  implies Sum(F) = a * Sum(G)
  proof
    defpred P[set] means for H,I st len H = len I & len H = $1 & (for k, v
    st k in Seg len H & v = I.k holds H.k = a * v) holds Sum(H) = a * Sum(I);
    A1: dom F = Seg len F by FINSEQ_1:def 3;
    now
      let n;
      assume
      A2: for H, I st len H = len I & len H = n & for k, v st k in Seg len H &
      v = I.k holds H.k = a * v holds Sum(H) = a * Sum(I);
      let H, I;
      assume that
      A3: len H = len I and
      A4: len H = n + 1 and
      A5: for k, v st k in Seg len H & v = I.k holds H.k = a * v;
      reconsider p = H | (Seg n),q = I | (Seg n) as FinSequence of the carrier
      of V by FINSEQ_1:18;
      A6: n <= n + 1 by NAT_1:12; then
      A7: len q = n by A3,A4,FINSEQ_1:17;
      A8: len p = n by A4,A6,FINSEQ_1:17;
      A9:
      now
        len p <= len H by A4,A6,FINSEQ_1:17; then
        A10: Seg len p c= Seg len H by FINSEQ_1:5;
        A11: dom p = Seg n by A4,A6,FINSEQ_1:17;
        let k, v;
        assume that
        A12: k in Seg len p and
        A13: v = q.k;
        dom q = Seg n by A3,A4,A6,FINSEQ_1:17;
        then I.k = q.k by A8,A12,FUNCT_1:47;
        then H.k = a * v by A5,A12,A13,A10;
        hence p.k = a * v by A8,A12,A11,FUNCT_1:47;
      end;
      1 <= n + 1 by NAT_1:11;
      then n + 1 in dom H & n + 1 in dom I by A3,A4,FINSEQ_3:25;
      then reconsider v1 = H.(n + 1),v2 = I.(n + 1) as Vector of V
        by FUNCT_1:102;
      A14: v1 = a * v2 by A4,A5,FINSEQ_1:4;
      A15: dom q = Seg len q by FINSEQ_1:def 3;
      dom p = Seg len p by FINSEQ_1:def 3;
      hence Sum(H) = Sum(p) + v1 by A4,A8,RLVECT_1:38
      .= a * Sum(q) + a * v2 by A2,A8,A7,A9,A14
      .= a * (Sum(q) + v2) by VECTSP_1:def 14
      .= a * Sum(I) by A3,A4,A7,A15,RLVECT_1:38;
    end;
    then
    A16: for n st P[n] holds P[n+1];
    now
      let H, I;
      assume that
      A17: len H = len I and
      A18: len H = 0 and
      for k, v st k in Seg len H & v = I.k holds H.k = a * v;
AA:   Sum(H) = 0.V by A18,Lm2;
      Sum I = 0.V by A17,A18,Lm2;
      hence Sum(H) = a * Sum(I) by VECTSP_1:14,AA;
    end;
    then
    A19: P[0];
    for n holds P[n] from NAT_1:sch 2(A19,A16);
    hence thesis by A1;
  end;
