reserve x,y for object,
        D,D1,D2 for non empty set,
        i,j,k,m,n for Nat,
        f,g for FinSequence of D*,
        f1 for FinSequence of D1*,
        f2 for FinSequence of D2*;
reserve f for complex-valued Function,
        g,h for complex-valued FinSequence;

theorem Th12:
  k <= n+1 implies (f,k) +...+ (f,n+1) = (f,k) +...+ (f,n) + f.(n+1)
proof
  set n1=n+1;
  assume A1:k <= n1;
  per cases by A1,NAT_1:8;
  suppose A2: k=n1;
    then k > n by NAT_1:13;
    then (f,k) +...+ (f,n)=0 & (f,k) +...+ (f,n+1) = f.k by A2, Th11,Def1;
    hence thesis by A2;
  end;
  suppose A3: k <= n;
    then consider h be complex-valued FinSequence such that
    A4:(f,k) +...+ (f,n) = Sum h & len h = n-'k+1 and
    A5:h.(0+1) = f.(0+k) & ... & h.(n-'k+1) = f.(n-'k+k) by Th9;
    A6:n1-'k = n-'k+1 by A3,NAT_D:38;
    set fn=f.n1;
    reconsider fn as Complex;
    set h1 = h ^ <*fn*>;
    A7:len h1 = n1-'k+1 by A6,A4,FINSEQ_2:16;
    h1.(0+1) = f.(0+k) & ... & h1.(n1-'k+1) = f.(n1-'k+k)
    proof
      let i;
      set i1=i+1;
      assume A8:0<=i & i <= n1-'k;
      per cases by A8,A6,NAT_1:8;
      suppose A9:i <= n-'k;
        then 1<= i1 & i1 <= len h by NAT_1:11,A4,XREAL_1:6;
        then i1 in dom h by FINSEQ_3:25;
        then h1.i1 = h.i1 by FINSEQ_1:def 7;
        hence thesis by A5,A9;
      end;
      suppose A10:i = n-'k+1;
        n1-'k+k =n1-k+k by NAT_D:37,A3;
        hence thesis by A10,A4,FINSEQ_1:42,A6;
      end;
    end;
    then (f,k) +...+ (f,n1) = Sum (h1| (n1-'k+1)) by A1,Def1
                           .= Sum h1 by A7,FINSEQ_1:58;
    hence thesis by A4,RVSUM_2:31;
  end;
end;
