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

theorem th1003:
  Rseq is nonnegative-yielding implies
  ( for i1,i2,j being Nat st i1 <= i2 holds
     (Partial_Sums_in_cod1 Rseq).(i1,j) <= (Partial_Sums_in_cod1 Rseq).(i2,j) )
& ( for i,j1,j2 being Nat st j1 <= j2 holds
     (Partial_Sums_in_cod2 Rseq).(i,j1) <= (Partial_Sums_in_cod2 Rseq).(i,j2) )
proof
   assume A1: Rseq is nonnegative-yielding;
A2:now let i1,i2,j be natural number;
    assume i1 <= i2; then
    consider k be Nat such that
A3:  i2 = i1 + k by NAT_1:10;
    defpred P[Nat] means
     $1 <= k implies (Partial_Sums_in_cod1 Rseq).(i1,j)
                        <= (Partial_Sums_in_cod1 Rseq).(i1+$1,j);
A4: P[0];
A5: for l be Nat st P[l] holds P[l+1]
    proof
     let l be Nat;
     assume A6: P[l];
     now assume A7: l+1 <= k;
      (Partial_Sums_in_cod1 Rseq).(i1+l+1,j)
        = (Partial_Sums_in_cod1 Rseq).(i1+l,j) + Rseq.(i1+l+1,j) by DefRS; then
      (Partial_Sums_in_cod1 Rseq).(i1+l,j)
         <= (Partial_Sums_in_cod1 Rseq).(i1+l+1,j) by A1,XREAL_1:31;
      hence (Partial_Sums_in_cod1 Rseq).(i1,j)
         <= (Partial_Sums_in_cod1 Rseq).(i1+(l+1),j)
           by A6,A7,NAT_1:13,XXREAL_0:2;
     end;
     hence P[l+1];
    end;
    for l be Nat holds P[l] from NAT_1:sch 2(A4,A5);
    hence (Partial_Sums_in_cod1 Rseq).(i1,j)
      <= (Partial_Sums_in_cod1 Rseq).(i2,j) by A3;
   end;
   now let i,j1,j2 be natural number;
    assume j1 <= j2; then
    consider k be Nat such that
B3:  j2 = j1 + k by NAT_1:10;
    defpred P[Nat] means
     $1 <= k implies (Partial_Sums_in_cod2 Rseq).(i,j1)
                        <= (Partial_Sums_in_cod2 Rseq).(i,j1+$1);
B4: P[0];
B5: for l be Nat st P[l] holds P[l+1]
    proof
     let l be Nat;
     assume B6: P[l];
     now assume B7: l+1 <= k;
      (Partial_Sums_in_cod2 Rseq).(i,j1+l+1)
        = (Partial_Sums_in_cod2 Rseq).(i,j1+l) + Rseq.(i,j1+l+1) by DefCS; then
      (Partial_Sums_in_cod2 Rseq).(i,j1+l)
         <= (Partial_Sums_in_cod2 Rseq).(i,j1+l+1) by A1,XREAL_1:31;
      hence (Partial_Sums_in_cod2 Rseq).(i,j1)
         <= (Partial_Sums_in_cod2 Rseq).(i,j1+(l+1))
           by B6,B7,NAT_1:13,XXREAL_0:2;
     end;
     hence P[l+1];
    end;
    for l be Nat holds P[l] from NAT_1:sch 2(B4,B5);
    hence (Partial_Sums_in_cod2 Rseq).(i,j1)
       <= (Partial_Sums_in_cod2 Rseq).(i,j2) by B3;
   end;
   hence thesis by A2;
end;
