reserve D for non empty set,
  i,j,k for Nat,
  n,m for Nat,
  r for Real,
  e for real-valued FinSequence;

theorem Th5:
  (for i be Nat st i in dom e holds 0 <= e.i) implies for k be Nat
  st k in dom e holds e.k <= Sum e
proof
  assume
A1: for i be Nat st i in dom e holds 0 <= e.i;
  per cases;
  suppose
    len e = 0;
    then e = {};
    hence thesis;
  end;
  suppose
A2: len e <> 0;
    then len e >= 1 by NAT_1:14;
    then
A3: len e in dom e by FINSEQ_3:25;
    let n be Nat;
    assume
A4: n in dom e;
    reconsider n as Nat;
    consider f be Real_Sequence such that
A5: f.1 = e.1 and
A6: for n be Nat st 0 <> n & n < len e holds f.(n+1) = f.n+e.(n+1) and
A7: Sum e = f.len e by A2,NAT_1:14,PROB_3:63;
A8: e.n <= f.n by A1,A2,A5,A6,A4,Th4,NAT_1:14;
    n <= len e by A4,FINSEQ_3:25;
    then f.n <= f.len e by A1,A6,A4,A3,Th3;
    hence thesis by A7,A8,XXREAL_0:2;
  end;
end;
