reserve r,x,x0,a,b for Real;
reserve n,m for Element of NAT;
reserve A for non empty closed_interval Subset of REAL;
reserve Z for open Subset of REAL;
reserve f, f1, f2, f3 for PartFunc of REAL, REAL;

theorem
  A c= Z & f=#Z 2 & Z = dom ((1/2)(#)f) implies integral(id Z,A) = ((1/2
  )(#)f).(upper_bound A)-((1/2)(#)f).(lower_bound A)
proof
  assume that
A1: A c= Z and
A2: f=#Z 2 & Z = dom ((1/2)(#)f);
A3: A c= dom id Z by A1;
  then
A4: (id Z)|A is bounded by INTEGRA5:10;
A5: ((1/2)(#)f) is_differentiable_on Z by A2,Th33;
A6: for x being Element of REAL
st x in dom (((1/2)(#)f)`|Z) holds (((1/2)(#)f)`|Z).x = (id Z).x
  proof
    let x be Element of REAL;
    assume x in dom (((1/2)(#)f)`|Z);
    then
A7: x in Z by A5,FDIFF_1:def 7;
    then (((1/2)(#)f)`|Z).x = x by A2,Th33
      .= (id Z).x by A7,FUNCT_1:18;
    hence thesis;
  end;
  dom (((1/2)(#)f)`|Z) = dom (id Z) by A5,FDIFF_1:def 7;
  then
A8: (((1/2)(#)f)`|Z) = id Z by A6,PARTFUN1:5;
  (id Z)|A is continuous;
  then id Z is_integrable_on A by A3,INTEGRA5:11;
  hence thesis by A1,A2,A4,A8,Th33,INTEGRA5:13;
end;
