 reserve Rseq, Rseq1, Rseq2 for Function of [:NAT,NAT:],REAL;

theorem th80a:
  Rseq is nonnegative-yielding implies
    Partial_Sums Rseq is non-decreasing
proof
   set CPS = Partial_Sums Rseq;
   assume a1: Rseq is nonnegative-yielding;
   now let n1,m1,n2,m2 be Nat;
    assume b2: n1>=n2 & m1>=m2; then
    consider dn be Nat such that
b3:  n1 = n2+dn by NAT_1:10;
    consider dm be Nat such that
b4:  m1 = m2+dm by b2,NAT_1:10;
    reconsider dn,dm as Element of NAT by ORDINAL1:def 12;
    defpred P1[Nat] means CPS.(n2+$1,m2) >= CPS.(n2,m2);
b5: P1[0];
b6: for k be Nat st P1[k] holds P1[k+1]
    proof
     let k be Nat;
     assume a7: P1[k];
b8:  CPS.(n2+k+1,m2)
      = (Partial_Sums_in_cod2(Rseq)).(n2+k+1,m2) + CPS.(n2+k,m2) by ThRS;
     Partial_Sums_in_cod2 Rseq is nonnegative-yielding by a1,lm80; then
     CPS.(n2+k+1,m2) >= CPS.(n2+k,m2) by b8,XREAL_1:31;
     hence P1[k+1] by a7,XXREAL_0:2;
    end;
    for k be Nat holds P1[k] from NAT_1:sch 2(b5,b6); then
b9: CPS.(n1,m2) >= CPS.(n2,m2) by b3;
    defpred P2[Nat] means CPS.(n1,m2+$1) >= CPS.(n1,m2);
b10:P2[0];
b11:for k be Nat st P2[k] holds P2[k+1]
    proof
     let k be Nat;
     assume b12: P2[k];
b13: CPS.(n1,m2+k+1)
      = (Partial_Sums_in_cod1 Rseq).(n1,m2+k+1) + CPS.(n1,m2+k) by DefCS;
     Partial_Sums_in_cod1 Rseq is nonnegative-yielding by a1,lm80; then
     CPS.(n1,m2+k+1) >= CPS.(n1,m2+k) by b13,XREAL_1:31;
     hence P2[k+1] by b12,XXREAL_0:2;
    end;
    for k be Nat holds P2[k] from NAT_1:sch 2(b10,b11); then
    CPS.(n1,m1) >= CPS.(n1,m2) by b4;
    hence CPS.(n1,m1) >= CPS.(n2,m2) by b9,XXREAL_0:2;
   end;
   hence Partial_Sums Rseq is non-decreasing;
end;
