reserve x, x1, x2, y, X, D for set,
  i, j, k, l, m, n, N for Nat,
  p, q for XFinSequence of NAT,
  q9 for XFinSequence,
  pd, qd for XFinSequence of D;
reserve pN, qN for Element of NAT^omega;
reserve seq1,seq2,seq3,seq4 for Real_Sequence,
  r,s,e for Real,
  Fr,Fr1, Fr2 for XFinSequence of REAL;

theorem Th51:
  for seq1 st seq1 is summable ex r st 0 < r & for k holds |.Sum
  (seq1^\k).| < r
proof
  let seq1 such that
A1: seq1 is summable;
  defpred P[Nat] means ex r st r>=0 & for i st i <= $1 holds |.Sum (seq1^\i)
  .|<=r;
A2: for k st P[k] holds P[k+1]
  proof
    let k;
    assume P[k];
    then consider r such that
A3: r>=0 and
A4: for i st i <= k holds |.Sum (seq1^\i) .|<=r;
    take M=max(r,|.Sum (seq1^\(k+1)).|);
    thus M >=0 by A3,XXREAL_0:25;
    let i such that
A5: i <= k+1;
    now
      per cases by A5,NAT_1:8;
      suppose
        i=k+1;
        hence thesis by XXREAL_0:25;
      end;
      suppose
A6:     i<=k;
A7:     r<=M by XXREAL_0:25;
        |.Sum (seq1^\i) .|<=r by A4,A6;
        hence thesis by A7,XXREAL_0:2;
      end;
    end;
    hence thesis;
  end;
  set P=Partial_Sums(seq1);
A8: lim P= Sum seq1 by SERIES_1:def 3;
  P is convergent by A1,SERIES_1:def 2;
  then consider n be Nat such that
A9: for m be Nat
st n<=m holds |.P.m-Sum seq1.|<1 by A8,SEQ_2:def 7;
A10: P[0]
  proof
    take |.Sum(seq1).|;
    thus |.Sum(seq1).|>=0 by COMPLEX1:46;
    let i;
    assume i<=0;
    then i=0;
    hence thesis by NAT_1:47;
  end;
  for k holds P[k] from NAT_1:sch 2(A10,A2);
  then consider r such that
A11: r>=0 and
A12: for i st i <= n holds |.Sum (seq1^\i) .|<=r;
  take r1=r+1;
  thus r1>0 by A11;
  let k;
  now
    per cases;
    suppose
A13:  k <= n;
A14:  0 qua Nat+r< r1 by XREAL_1:8;
      |.Sum (seq1^\k) .|<=r by A12,A13;
      hence thesis by A14,XXREAL_0:2;
    end;
    suppose
A15:  k > n;
      then reconsider k1=k-1 as Nat by NAT_1:20;
      k1+1>n by A15;
      then k1>=n by NAT_1:13;
      then
A16:  |.P.k1-Sum seq1.|<1 by A9;
      Sum seq1 = P.k1+Sum(seq1^\(k1+1)) by A1,SERIES_1:15;
      then |.-Sum(seq1^\(k1+1)).|<1 by A16;
      then
A17:  |. Sum(seq1^\(k1+1)) .|<1 by COMPLEX1:52;
      1+(0 qua Nat)<=r1 by A11,XREAL_1:6;
      hence thesis by A17,XXREAL_0:2;
    end;
  end;
  hence thesis;
end;
