reserve Z for set;

theorem Th2:
  for A be non empty closed_interval Subset of REAL, f be Function of A,REAL,
  D be Division of A, F be middle_volume of f,D st f|A is bounded_above holds
  middle_sum(f,F) <= upper_sum (f,D)
proof
  let A be non empty closed_interval Subset of REAL,
  f be Function of A,REAL, D be
  Division of A, F be middle_volume of f,D;
  len upper_volume (f,D) = len D by INTEGRA1:def 6;
  then reconsider
  p = upper_volume (f,D) as Element of (len D)-tuples_on REAL by FINSEQ_2:92;
  len F = len D by Def1;
  then reconsider q =F as Element of (len D)-tuples_on REAL by FINSEQ_2:92;
  assume
A1: f|A is bounded_above;
  now
    let i be Nat;
    assume i in Seg (len D);
    then i in dom D by FINSEQ_1:def 3;
    hence q.i <= p.i by A1,Lm4;
  end;
  hence thesis by RVSUM_1:82;
end;
