reserve a,b,e,r,x,y for Real,
  i,j,k,n,m for Element of NAT,
  x1 for set,
  p,q for FinSequence of REAL,
  A for non empty closed_interval Subset of REAL,
  D,D1,D2 for Division of A,
  f,g for Function of A,REAL,
  T for DivSequence of A;

theorem Th12:
  i in dom D & j in dom D & i<=j & r < mid(D,i,j).1 implies
  ex B be non empty closed_interval Subset of REAL st r = lower_bound B &
  upper_bound B=mid(D,i,j).(len mid(D,i,j)) &  mid(D,i,j) is Division of B
proof
  assume
A1: i in dom D;
  assume
A2: j in dom D;
  assume i <= j;
  then consider C being non empty closed_interval Subset of REAL such that
A3: lower_bound C=mid(D,i,j).1 and
A4: upper_bound C=mid(D,i,j).(len mid(D,i,j)) and
A5: mid(D,i,j) is Division of C by A1,A2,INTEGRA1:36;
  reconsider MD=mid(D,i,j) as non empty increasing FinSequence of REAL by A5;
  assume
A6: r < mid(D,i,j).1;
  reconsider rr=r, ub=upper_bound C as Real;
  ex a,b st a <= b & a = lower_bound C & b = upper_bound C by SEQ_4:11;
  then r <= upper_bound C by A6,A3,XXREAL_0:2;
  then reconsider B=[.rr,ub.]
   as non empty closed_interval Subset of REAL by MEASURE5:14;
A7: B=[.lower_bound B,upper_bound B.] by INTEGRA1:4;
  then
A8: lower_bound B = r by INTEGRA1:5;
A9: upper_bound B = upper_bound C by A7,INTEGRA1:5;
  for x being Element of REAL holds x in C implies x in B
  proof let x be Element of REAL;
    assume
A10: x in C;
    then lower_bound C <= x by INTEGRA2:1;
    then
A11: r <= x by A6,A3,XXREAL_0:2;
    x <= upper_bound C by A10,INTEGRA2:1;
    hence thesis by A8,A9,A11,INTEGRA2:1;
  end;
  then
A12: C c= B;
  rng mid(D,i,j) c= C by A5,INTEGRA1:def 2;
  then rng mid(D,i,j) c= B by A12;
  then MD is Division of B by A4,A9,INTEGRA1:def 2;
  hence thesis by A4,A8,A9;
end;
