The Mizar article:

Darboux's Theorem

by
Noboru Endou,
Katsumi Wasaki, and
Yasunari Shidama

Received December 7, 1999

Copyright (c) 1999 Association of Mizar Users

MML identifier: INTEGRA3
[ MML identifier index ]


environ

 vocabulary FINSEQ_1, ARYTM_1, INTEGRA1, MEASURE5, RELAT_1, ORDINAL2, BOOLE,
      FUNCT_1, CARD_1, FUNCT_3, SQUARE_1, ABSVALUE, RFUNCT_1, RLVECT_1, SEQ_2,
      LATTICES, JORDAN3, RCOMP_1, PARTFUN1, RFINSEQ, INTEGRA2, FDIFF_1, SEQ_1,
      ARYTM_3, PROB_1, FINSEQ_4, ARYTM;
 notation TARSKI, XBOOLE_0, SUBSET_1, ORDINAL1, NUMBERS, XCMPLX_0, XREAL_0,
      REAL_1, NAT_1, RELAT_1, FUNCT_1, FUNCT_2, RELSET_1, SEQ_4, PARTFUN1,
      PSCOMP_1, FINSEQ_1, RFUNCT_1, RVSUM_1, INTEGRA1, SEQ_1, SEQ_2, JORDAN3,
      PRE_CIRC, SFMASTR3, RCOMP_1, FDIFF_1, ABSVALUE, GOBOARD1, CARD_1,
      SQUARE_1, FINSEQ_4, TOPREAL1, RFINSEQ, BINARITH, INTEGRA2;
 constructors REAL_1, REALSET1, PARTFUN1, RFUNCT_1, PRE_CIRC, SFMASTR3,
      FDIFF_1, SQUARE_1, FINSEQ_4, RFINSEQ, TOPREAL1, BINARITH, JORDAN3,
      INTEGRA2, ABSVALUE, PSCOMP_1, FINSOP_1;
 clusters XREAL_0, RELSET_1, FINSEQ_1, NAT_2, GOBOARD1, INTEGRA1, INTEGRA2,
      NAT_1, MEMBERED, NUMBERS, ORDINAL2;
 requirements REAL, NUMERALS, BOOLE, SUBSET, ARITHM;
 definitions TARSKI;
 theorems AXIOMS, REAL_1, SEQ_4, SUBSET_1, REAL_2, PARTFUN1, PSCOMP_1,
      INTEGRA1, RFUNCT_1, FUNCT_1, FINSEQ_1, RVSUM_1, SEQ_1, SEQ_2, FDIFF_1,
      ABSVALUE, PRE_CIRC, NAT_1, GOBOARD2, RFINSEQ, TARSKI, GOBOARD1, SQUARE_1,
      CARD_1, FINSEQ_5, TOPREAL1, FINSEQ_3, FINSEQ_4, JORDAN7, JORDAN3,
      SFMASTR3, RLVECT_1, BINARITH, INTEGRA2, RELAT_1, XREAL_0, SCMFSA_7,
      FUNCT_2, XBOOLE_0, XBOOLE_1, RCOMP_1, XCMPLX_1;
 schemes FINSEQ_2, NAT_1, BINARITH;

begin :: Lemmas of Division

reserve a,b,d,e,x,y for Real,
        i,j,k,n,m for Nat,
        x1 for set,
        p,q for FinSequence of REAL;

Lm1: now let k; k <= k+1 by NAT_1:29; hence k-1 <= k by REAL_1:86; end;
Lm2: 2-1=1;
Lm3:j-'j+1 = 1
    proof
       j-'j=j-j by SCMFSA_7:3 .= 0 by XCMPLX_1:14;
     hence thesis;
    end;

Lm4:for n st 1 <= n & n <= 2 holds n = 1 or n = 2
    proof
     let n; assume A1:1<=n & n<=2;
     per cases by A1,REAL_1:def 5;
      suppose n=1;
      hence thesis;
      suppose n>1;
      then n >= 1+1 by NAT_1:38;
      hence thesis by A1,AXIOMS:21;
    end;

theorem Th1:for A be closed-interval Subset of REAL, D be Element of divs A
st vol(A) <> 0 holds ex i st i in dom D & vol(divset(D,i)) > 0
proof
   let A be closed-interval Subset of REAL;
   let D be Element of divs A;
   assume A1:vol(A) <>0;
   assume A2:for i st i in dom D holds vol(divset(D,i))<=0;
A3:i in dom D implies vol(divset(D,i))=0
   proof
    assume i in dom D;
then vol(divset(D,i)) <= 0 by A2;
    hence thesis by INTEGRA1:11;
   end;
A4:i in dom D implies sup divset(D,i)=inf divset(D,i)
   proof
    assume i in dom D;
    then vol(divset(D,i))=0 by A3;
    then sup divset(D,i)-inf divset(D,i)=0 by INTEGRA1:def 6;
    hence thesis by XCMPLX_1:15;
   end;
A5:len D in dom D by SCMFSA_7:12;
     len D = 1
   proof
    assume A6:len D <> 1;
then A7:inf divset(D,len D)=D.(len D-1) & sup divset(D,len D)=D.(len D)
    by A5,INTEGRA1:def 5;
A8: len D-1 in dom D & len D-1 in NAT by A5,A6,INTEGRA1:9;
      len D < len D+1 by NAT_1:38;
    then len D-1 < len D by REAL_1:84;
    then inf divset(D,len D)<sup divset(D,len D) by A5,A7,A8,GOBOARD1:def 1;
    hence contradiction by A4,A5;
   end;
   then inf divset(D,len D)=inf A & sup divset(D,len D)=D.(len D)
   by A5,INTEGRA1:def 5;
   then inf divset(D,len D)=inf A & sup divset(D,len D)=sup A
   by INTEGRA1:def 2;
   then sup A = inf A+0 by A4,A5;
   then sup A- inf A = 0 by XCMPLX_1:26;
   hence contradiction by A1,INTEGRA1:def 6;
end;

theorem Th2: for A be closed-interval Subset of REAL,
D be Element of divs A st x in A holds
ex j st j in dom D & x in divset(D,j)
proof
   let A be closed-interval Subset of REAL;
   let D be Element of divs A;
   assume x in A;
then A1:inf A <= x & x <= sup A by INTEGRA2:1;
     rng D <> {};
then A2:1 in dom D by FINSEQ_3:34;
   per cases;
    suppose x in rng D;
    then consider j such that
A3: j in dom D & D.j = x by PARTFUN1:26;
      x in divset(D,j)
    proof
     per cases;
      suppose j=1;
then A4:   inf divset(D,j)=inf A & sup divset(D,j)=D.j by A3,INTEGRA1:def 5;
      consider a,b such that
A5:  a <= b & a=inf divset(D,j) & b=sup divset(D,j) by INTEGRA1:4;
      thus thesis by A3,A4,A5,INTEGRA2:1;
      suppose j<>1;
then A6:  sup divset(D,j)=D.j by A3,INTEGRA1:def 5;
      consider a,b such that
A7:  a <= b & a=inf divset(D,j) & b=sup divset(D,j) by INTEGRA1:4;
      thus thesis by A3,A6,A7,INTEGRA2:1;
    end;
    hence thesis by A3;
    suppose A8:not x in rng D;
    defpred MIN[Nat] means x < sup divset(D,$1) & $1 in dom D;
    defpred MAX[Nat] means x >= inf divset(D,$1) & $1 in dom D;
A9:len D in dom D by SCMFSA_7:12;
      sup divset(D,len D)=D.(len D)
     proof
      per cases;
       suppose len D=1;
       hence thesis by A9,INTEGRA1:def 5;
       suppose len D<>1;
       hence thesis by A9,INTEGRA1:def 5;
     end;
then A10: sup divset(D,len D) = sup A by INTEGRA1:def 2;
      x < sup divset(D,len D)
    proof
       x <> sup A
     proof
      assume x = sup A;
      then x = D.(len D) by INTEGRA1:def 2;
      hence contradiction by A8,A9,FUNCT_1:def 5;
     end;
     hence thesis by A1,A10,REAL_1:def 5;
    end;
then A11: ex k st MIN[k] by A9;
    consider k such that
A12:MIN[k] & for n st MIN[n] holds k <= n from Min(A11);
      inf divset(D,1)=inf A by A2,INTEGRA1:def 5;
then A13: ex k st MAX[k] by A1,A2;
A14: for k holds MAX[k] implies k <= len D by FINSEQ_3:27;
    consider j such that
A15:MAX[j] & for n st MAX[n] holds n <= j from Max(A14,A13);
      k=j
    proof
     assume A16:k<>j;
       now per cases by A16,AXIOMS:21;
      suppose A17:k < j;
A18:  1 <= k & k <= len D by A12,FINSEQ_3:27;
then A19:  j-1 in dom D & j-1 in NAT by A15,A17,INTEGRA1:9;
A20:   sup divset(D,k)=D.k
      proof
       per cases;
        suppose k=1;
        hence thesis by A12,INTEGRA1:def 5;
        suppose k<>1;
        hence thesis by A12,INTEGRA1:def 5;
      end;
        D.(j-1) <= x by A15,A17,A18,INTEGRA1:def 5;
      then D.(j-1) < D.k by A12,A20,AXIOMS:22;
      then j-1 < k by A12,A19,GOBOARD2:18;
      then j < k+1 by REAL_1:84;
      hence contradiction by A17,NAT_1:38;
      suppose A21:k > j;
        x < sup divset(D,j)
      proof
       assume A22:x >= sup divset(D,j);
A23:    sup divset(D,j)=D.j
       proof
        per cases;
         suppose j=1;
         hence thesis by A15,INTEGRA1:def 5;
         suppose j<>1;
         hence thesis by A15,INTEGRA1:def 5;
       end;
A24:   j+1 in dom D & j+1 > 1
       proof
A25:    1 <= j & k <= len D by A12,A15,FINSEQ_3:27;
          j < j+1 & j+1 <= k by A21,NAT_1:38;
        then 1 <= j+1 & j+1 <= len D by A25,AXIOMS:22;
        hence j+1 in dom D by FINSEQ_3:27;
        thus thesis by A25,NAT_1:38;
       end;
       then inf divset(D,j+1) = D.(j+1-1) by INTEGRA1:def 5 .=D.j
       by XCMPLX_1:26;
       then j+1 <= j by A15,A22,A23,A24;
       hence contradiction by NAT_1:38;
      end;
      hence contradiction by A12,A15,A21;
     end;
     hence contradiction;
    end;
    then x in divset(D,k) & k in dom D by A12,A15,INTEGRA2:1;
    hence thesis;
end;

theorem Th3: for A be closed-interval Subset of REAL,
                 D1,D2 be Element of divs A holds
ex D be Element of divs A st D1 <= D & D2 <= D & rng D = rng D1 \/ rng D2
proof
   let A be closed-interval Subset of REAL;
   let D1,D2 be Element of divs A;
   consider D being FinSequence of REAL such that
A1:rng D = rng(D1^D2) & len D = card rng(D1^D2) & D is increasing
   by GOBOARD2:21;
   reconsider D as increasing FinSequence of REAL by A1;
     D1^D2 <> {} by FINSEQ_1:48;
   then rng D <> {} by A1,FINSEQ_1:27;
   then reconsider D as non empty increasing FinSequence of REAL by FINSEQ_1:27
;
A2:rng(D1^D2) = rng D1 \/ rng D2 by FINSEQ_1:44;
     rng D1 c= A & rng D2 c= A by INTEGRA1:def 2;
then A3:rng D c= A by A1,A2,XBOOLE_1:8;
A4:rng D1 c= rng(D1^D2) by A2,XBOOLE_1:7;
A5:rng D2 c= rng(D1^D2) by A2,XBOOLE_1:7;
     D.(len D) = sup A
   proof
    assume A6:D.(len D) <> sup A;
A7: len D in dom D by SCMFSA_7:12;
    then D.(len D) in rng D by FUNCT_1:def 5;
    then D.(len D) <= sup A by A3,INTEGRA2:1;
then A8: D.(len D) < sup A by A6,REAL_1:def 5;
A9: D1.(len D1) = sup A by INTEGRA1:def 2;
      len D1 in dom D1 by SCMFSA_7:12;
    then D1.(len D1) in rng D1 by FUNCT_1:def 5;
    then consider k such that
A10: k in dom D & D1.(len D1)=D.k by A1,A4,PARTFUN1:26;
      k > len D by A7,A8,A9,A10,GOBOARD2:18;
    hence contradiction by A10,FINSEQ_3:27;
   end;
   then D is DivisionPoint of A by A3,INTEGRA1:def 2;
   then reconsider D as Element of divs A by INTEGRA1:def 3;
   take D;
A11:card rng D1 <= len D by A1,A4,CARD_1:80;
      D1 is one-to-one by JORDAN7:17;
    then len D1 <= len D by A11,FINSEQ_4:77;
    hence D1 <= D by A1,A4,INTEGRA1:def 20;
A12:card rng D2 <= len D by A1,A5,CARD_1:80;
      D2 is one-to-one by JORDAN7:17;
    then len D2 <= len D by A12,FINSEQ_4:77;
    hence D2 <= D by A1,A5,INTEGRA1:def 20;
    thus thesis by A1,FINSEQ_1:44;
end;

theorem Th4:for A be closed-interval Subset of REAL,
D,D1 be Element of divs A
st delta(D1)<min rng upper_volume(chi(A,A),D)
holds (for x,y,i st i in dom D1 & x in rng D /\ divset(D1,i)
& y in rng D /\ divset(D1,i) holds x=y)
proof
   let A be closed-interval Subset of REAL;
   let D,D1 be Element of divs A;
   assume A1:delta(D1)<min rng upper_volume(chi(A,A),D);
    let x,y,i;
    assume A2:i in dom D1;
    assume A3:x in rng D /\ divset(D1,i);
    assume A4:y in rng D /\ divset(D1,i);
     assume A5:x<>y;
       x in rng D by A3,XBOOLE_0:def 3;
     then consider n such that A6:n in dom D & x=D.n by PARTFUN1:26;
       y in rng D by A4,XBOOLE_0:def 3;
     then consider m such that A7:m in dom D & y=D.m by PARTFUN1:26;
A8:abs( D.n-D.m ) >= min rng upper_volume(chi(A,A),D)
    proof
     per cases by A5,A6,A7,AXIOMS:21;
      suppose n<m;
then A9:   n+1<=m by NAT_1:38;
        n in Seg len D & m in Seg len D by A6,A7,FINSEQ_1:def 3;
then A10:  1<=n & m<=len D by FINSEQ_1:3;
      then 1<=n+1 & n+1<=len D by A9,AXIOMS:22,NAT_1:37;
then A11:  n+1 in Seg len D by FINSEQ_1:3;
then A12:  n+1 in dom D by FINSEQ_1:def 3;
        -abs( D.n-D.m ) <= D.n-D.m by ABSVALUE:11;
then A13:  abs( D.n-D.m ) >= -(D.n-D.m) by REAL_2:110;
        D.m>=D.(n+1) by A7,A9,A12,GOBOARD2:18;
      then D.n-D.m <= D.n-D.(n+1) by REAL_2:106;
      then -(D.n-D.m) >= -(D.n-D.(n+1)) by REAL_1:50;
then A14:  -(D.n-D.m) >= D.(n+1)-D.n by XCMPLX_1:143;
A15:  D.(n+1)-D.n=(upper_volume(chi(A,A),D)).(n+1)
      proof
         n+1 <> 1 by A10,NAT_1:38;
then A16:   inf divset(D,n+1)=D.((n+1)-1)
       & sup divset(D,n+1)=D.(n+1) by A12,INTEGRA1:def 5;
         (n+1)-1=n by XCMPLX_1:26;
       then vol(divset(D,n+1))=D.(n+1)-D.n by A16,INTEGRA1:def 6;
       hence thesis by A11,INTEGRA1:22;
      end;
        n+1 in Seg len upper_volume(chi(A,A),D) by A11,INTEGRA1:def 7;
      then n+1 in dom upper_volume(chi(A,A),D) by FINSEQ_1:def 3;
      then (upper_volume(chi(A,A),D)).(n+1) in rng upper_volume(chi(A,A),D)
      by FUNCT_1:def 5;
      then D.(n+1)-D.n>=min rng upper_volume(chi(A,A),D) by A15,SFMASTR3:def 1
;
      then -(D.n-D.m) >= min rng upper_volume(chi(A,A),D) by A14,AXIOMS:22;
      hence thesis by A13,AXIOMS:22;
      suppose n>m;
then A17:  m+1<=n by NAT_1:38;
        n in Seg len D & m in Seg len D by A6,A7,FINSEQ_1:def 3;
then A18:  1<=m & n<=len D by FINSEQ_1:3;
then A19:  1<=m+1 & m+1<=len D by A17,AXIOMS:22,NAT_1:37;
then A20:  m+1 in Seg len D by FINSEQ_1:3;
A21:  m+1 in dom D by A19,FINSEQ_3:27;
A22:  abs( D.n-D.m ) >= D.n-D.m by ABSVALUE:11;
        D.(m+1)<=D.n by A6,A17,A21,GOBOARD2:18;
then A23:  D.n-D.m >= D.(m+1)-D.m by REAL_1:49;
A24:  D.(m+1)-D.m=(upper_volume(chi(A,A),D)).(m+1)
      proof
         1 < m+1 by A18,NAT_1:38;
then A25:   inf divset(D,m+1)=D.((m+1)-1)
       & sup divset(D,m+1)=D.(m+1) by A21,INTEGRA1:def 5;
         (m+1)-1=m by XCMPLX_1:26;
       then vol(divset(D,m+1))=D.(m+1)-D.m by A25,INTEGRA1:def 6;
       hence thesis by A20,INTEGRA1:22;
      end;
        m+1 in Seg len upper_volume(chi(A,A),D) by A20,INTEGRA1:def 7;
      then m+1 in dom upper_volume(chi(A,A),D) by FINSEQ_1:def 3;
      then (upper_volume(chi(A,A),D)).(m+1) in rng upper_volume(chi(A,A),D)
      by FUNCT_1:def 5;
      then D.(m+1)-D.m>=min rng upper_volume(chi(A,A),D) by A24,SFMASTR3:def 1
;
      then D.n-D.m >= min rng upper_volume(chi(A,A),D) by A23,AXIOMS:22;
      hence thesis by A22,AXIOMS:22;
    end;
      abs (D.n-D.m) <= delta D1
    proof
     per cases by A5,A6,A7,AXIOMS:21;
      suppose n<m;
      then D.n<D.m by A6,A7,GOBOARD1:def 1;
      then D.n-D.m<0 by REAL_2:105;
then A26:  abs( D.n-D.m )=-(D.n-D.m) by ABSVALUE:def 1 .= D.m-D.n by XCMPLX_1:
143;
        D.n in divset(D1,i) by A3,A6,XBOOLE_0:def 3;
then A27:  D.n >= inf divset(D1,i) by INTEGRA2:1;
        D.m in divset(D1,i) by A4,A7,XBOOLE_0:def 3;
      then D.m <= sup divset(D1,i) by INTEGRA2:1;
then A28:  D.m-inf divset(D1,i)<= sup divset(D1,i)-inf divset(D1,i) by REAL_1:
49;
        D.m-D.n <= D.m-inf divset(D1,i) by A27,REAL_2:106;
      then D.m-D.n <= sup divset(D1,i)-inf divset(D1,i) by A28,AXIOMS:22;
then A29:  D.m-D.n <= vol(divset(D1,i)) by INTEGRA1:def 6;
A30:  i in Seg len D1 by A2,FINSEQ_1:def 3;
then A31:  D.m-D.n <= upper_volume(chi(A,A),D1).i by A29,INTEGRA1:22;
        i in Seg len upper_volume(chi(A,A),D1) by A30,INTEGRA1:def 7;
      then i in dom upper_volume(chi(A,A),D1) by FINSEQ_1:def 3;
      then upper_volume(chi(A,A),D1).i in rng upper_volume(chi(A,A),D1)
      by FUNCT_1:def 5;
      then upper_volume(chi(A,A),D1).i <= max rng upper_volume(chi(A,A),D1)
      by PRE_CIRC:def 1;
      then upper_volume(chi(A,A),D1).i<=delta(D1) by INTEGRA1:def 19;
      hence thesis by A26,A31,AXIOMS:22;
      suppose n>m;
      then D.n>D.m by A6,A7,GOBOARD1:def 1;
      then D.n-D.m>0 by SQUARE_1:11;
then A32:  abs( D.n-D.m )=D.n-D.m by ABSVALUE:def 1;
        D.m in divset(D1,i) by A4,A7,XBOOLE_0:def 3;
then A33:  D.m >= inf divset(D1,i) by INTEGRA2:1;
        D.n in divset(D1,i) by A3,A6,XBOOLE_0:def 3;
      then D.n <= sup divset(D1,i) by INTEGRA2:1;
then A34:  D.n-inf divset(D1,i)<= sup divset(D1,i)-inf divset(D1,i) by REAL_1:
49;
        D.n-D.m <= D.n-inf divset(D1,i) by A33,REAL_2:106;
      then D.n-D.m <= sup divset(D1,i)-inf divset(D1,i) by A34,AXIOMS:22;
then A35:  D.n-D.m <= vol(divset(D1,i)) by INTEGRA1:def 6;
A36:  i in Seg len D1 by A2,FINSEQ_1:def 3;
then A37:  D.n-D.m <= upper_volume(chi(A,A),D1).i by A35,INTEGRA1:22;
        i in Seg len upper_volume(chi(A,A),D1) by A36,INTEGRA1:def 7;
      then i in dom upper_volume(chi(A,A),D1) by FINSEQ_1:def 3;
      then upper_volume(chi(A,A),D1).i in rng upper_volume(chi(A,A),D1)
      by FUNCT_1:def 5;
      then upper_volume(chi(A,A),D1).i <= max rng upper_volume(chi(A,A),D1)
      by PRE_CIRC:def 1;
      then upper_volume(chi(A,A),D1).i<=delta(D1) by INTEGRA1:def 19;
      hence thesis by A32,A37,AXIOMS:22;
    end;
    hence contradiction by A1,A8,AXIOMS:22;
end;

theorem Th5:
for p,q st rng p = rng q & p is increasing & q is increasing holds p = q
proof
  let p,q;
  assume A1:rng p = rng q;
  assume A2:p is increasing & q is increasing;
  then p is one-to-one & q is one-to-one by JORDAN7:17;
  then len p = len q by A1,RLVECT_1:106;
  hence thesis by A1,A2,GOBOARD2:22;
end;

theorem Th6:
for A be closed-interval Subset of REAL, D,D1 be Element of divs A st
D <= D1 & i in dom D & j in dom D & i <= j holds
indx(D1,D,i) <= indx(D1,D,j) & indx(D1,D,i) in dom D1
proof
   let A be closed-interval Subset of REAL;
   let D,D1 be Element of divs A;
   assume A1:D <= D1 & i in dom D & j in dom D & i <= j;
then A2:D.i = D1.indx(D1,D,i) & indx(D1,D,i) in dom D1 by INTEGRA1:def 21;
A3:D.j = D1.indx(D1,D,j) & indx(D1,D,j) in dom D1 by A1,INTEGRA1:def 21;
     D.i <= D.j by A1,GOBOARD2:18;
   hence thesis by A2,A3,GOBOARD1:def 1;
end;

theorem Th7:for A be closed-interval Subset of REAL, D,D1 be Element of divs A
st D <= D1 & i in dom D & j in dom D & i < j holds
indx(D1,D,i) < indx(D1,D,j)
proof
   let A be closed-interval Subset of REAL;
   let D,D1 be Element of divs A;
   assume A1:D <= D1 & i in dom D & j in dom D & i < j;
then A2:D.i = D1.indx(D1,D,i) & indx(D1,D,i) in dom D1 by INTEGRA1:def 21;
A3:D.j = D1.indx(D1,D,j) & indx(D1,D,j) in dom D1 by A1,INTEGRA1:def 21;
     D.i < D.j by A1,GOBOARD1:def 1;
   hence thesis by A2,A3,GOBOARD2:18;
end;

theorem Th8: for A be closed-interval Subset of REAL,
D be Element of divs A holds delta(D) >= 0
proof
   let A be closed-interval Subset of REAL;
   let D be Element of divs A;
   consider y such that
A1:y in rng D by SUBSET_1:10;
   consider n such that
A2:n in dom D & y=D.n by A1,PARTFUN1:26;
A3:n in Seg len D by A2,FINSEQ_1:def 3;
   then vol(divset(D,n))=upper_volume(chi(A,A),D).n by INTEGRA1:22;
then A4:upper_volume(chi(A,A),D).n >= 0 by INTEGRA1:11;
     n in Seg len upper_volume(chi(A,A),D) by A3,INTEGRA1:def 7;
   then n in dom upper_volume(chi(A,A),D) by FINSEQ_1:def 3;
   then upper_volume(chi(A,A),D).n in rng upper_volume(chi(A,A),D)
   by FUNCT_1:def 5;
   then upper_volume(chi(A,A),D).n <= max rng upper_volume(chi(A,A),D)
   by PRE_CIRC:def 1;
   hence thesis by A4,INTEGRA1:def 19;
end;

Lm5:a+b-(d+e) = (a-d)+(b-e)
proof
   a+b-(d+e)=a+b-d-e by XCMPLX_1:36
 .=a-d+b-e by XCMPLX_1:29;
 hence thesis by XCMPLX_1:29;
end;

Lm6:for A be closed-interval Subset of REAL, g be Function of A,REAL st
 g is_bounded_on A holds sup rng g >= inf rng g
proof
  let A be closed-interval Subset of REAL;
  let g be Function of A,REAL;
  assume A1: g is_bounded_on A;
    dom g <> {} by FUNCT_2:def 1;
  then A2: rng g <> {} by RELAT_1:65;
    g is_bounded_below_on A & g is_bounded_above_on A by A1,RFUNCT_1:def 11;
  then rng g is bounded_above & rng g is bounded_below by INTEGRA1:13,15;
  then rng g is bounded by SEQ_4:def 3;
  hence thesis by A2,SEQ_4:24;
end;

Lm7:for A,B be closed-interval Subset of REAL,
        f be Function of A,REAL st f is_bounded_on A & B c= A holds
   inf rng(f|B) >= inf rng f & inf rng f <= sup rng(f|B) &
   sup rng(f|B) <= sup rng f & inf rng(f|B) <= sup rng f
  proof
     let A,B be closed-interval Subset of REAL,
         f be Function of A,REAL;
     assume A1: f is_bounded_on A & B c= A;
     then f is_bounded_above_on A & f is_bounded_below_on A
       by RFUNCT_1:def 11;
then A2:rng f is bounded_above & rng f is bounded_below by INTEGRA1:13,15;
     consider x such that
A3:x in B by SUBSET_1:10;
       B c=dom f by A1,FUNCT_2:def 1;
then A4:dom(f|B)=B by RELAT_1:91;
then A5:(f|B).x in rng(f|B) by A3,FUNCT_1:def 5;
A6:rng(f|B) <> {} by A4,RELAT_1:65;
A7:rng(f|B) c= rng f by FUNCT_1:76;
then A8:rng(f|B) is bounded_above & rng(f|B) is bounded_below
              by A2,RCOMP_1:3,4;
     thus A9:inf rng(f|B) >= inf rng f by A2,A6,A7,PSCOMP_1:12;
A10:inf rng(f|B)<=(f|B).x by A5,A8,SEQ_4:def 5;
       sup rng(f|B)>=(f|B).x by A5,A8,SEQ_4:def 4;
then A11:  inf rng(f|B) <= sup rng(f|B) by A10,AXIOMS:22;
     hence sup rng(f|B) >= inf rng f by A9,AXIOMS:22;
     thus sup rng(f|B) <= sup rng f by A2,A6,A7,PSCOMP_1:13;
     hence thesis by A11,AXIOMS:22;
   end;

Lm8: for A be closed-interval Subset of REAL,
      D1 be Element of divs A st j in dom D1 holds
    vol(divset(D1,j)) <= delta(D1)
proof
  let A be closed-interval Subset of REAL,
      D1 be Element of divs A;
  assume j in dom D1;
then A1:j in Seg len D1 by FINSEQ_1:def 3;
  then j in Seg len upper_volume(chi(A,A),D1) by INTEGRA1:def 7;
  then j in dom upper_volume(chi(A,A),D1) by FINSEQ_1:def 3;
  then upper_volume(chi(A,A),D1).j in rng upper_volume(chi(A,A),D1)
  by FUNCT_1:def 5;
  then upper_volume(chi(A,A),D1).j <= max rng upper_volume(chi(A,A),D1)
  by PRE_CIRC:def 1;
  then vol(divset(D1,j)) <= max rng upper_volume(chi(A,A),D1) by A1,INTEGRA1:22
;
  hence thesis by INTEGRA1:def 19;
end;

Lm9:for A be closed-interval Subset of REAL, j1 be Nat,
          D1,D2 be Element of divs A st
    j1 = len D1 - 1 & x in divset(D1,len D1) & len D1 >= 2 &
    D1 <= D2 & rng D2 = rng D1 \/ {x}
    holds rng (D2|indx(D2,D1,j1)) = rng (D1|j1)
    proof
    let A be closed-interval Subset of REAL, j1 be Nat,
        D1,D2 be Element of divs A;
    assume A1:j1 = len D1 - 1 & x in divset(D1,len D1) & len D1 >= 2;
    assume A2:D1<=D2 & rng D2 = rng D1 \/ {x};
A3: len D1 in dom D1 & len D2 in dom D2 by SCMFSA_7:12;
A4: len D1 <> 1 by A1;
then A5:len D1-1 in NAT & len D1-1 in dom D1 by A3,INTEGRA1:9;
     inf divset(D1,len D1) <= x & x <= sup divset(D1,len D1)
   by A1,INTEGRA2:1;
then A6:D1.j1 <= x & x <= D1.(len D1) by A1,A3,A4,INTEGRA1:def 5;
    A7:indx(D2,D1,j1) in dom D2 by A1,A2,A5,INTEGRA1:def 21;
then A8:  1 <= indx(D2,D1,j1) & indx(D2,D1,j1) <= len D2 by FINSEQ_3:27;
    A9:j1 in dom D1 by A1,A3,A4,INTEGRA1:9;
then A10:  1 <= j1 & j1 <= len D1 by FINSEQ_3:27;
       for x1 st x1 in rng(D2|indx(D2,D1,j1)) holds x1 in rng(D1|j1)
     proof
      let x1; assume x1 in rng(D2|indx(D2,D1,j1));
      then consider k such that
A11:  k in dom(D2|indx(D2,D1,j1)) & x1=(D2|indx(D2,D1,j1)).k by PARTFUN1:26;
        k in Seg len(D2|indx(D2,D1,j1)) by A11,FINSEQ_1:def 3;
then A12:  k in Seg indx(D2,D1,j1) by A8,TOPREAL1:3;
then A13:  (D2|indx(D2,D1,j1)).k = D2.k & k in dom D2 by A7,RFINSEQ:19;
then A14:   D2.k in rng D2 by FUNCT_1:def 5;
        1 <= k & k <= indx(D2,D1,j1) by A12,FINSEQ_1:3;
      then D2.k <= D2.indx(D2,D1,j1) by A7,A13,GOBOARD2:18;
then A15:  D2.k <= D1.j1 by A1,A2,A5,INTEGRA1:def 21;
A16:  len(D1|j1) = j1 by A10,TOPREAL1:3;
A17:  D2.k in {x} implies D2.k = D1.j1
      proof
       assume D2.k in {x};
       then D1.j1 <= D2.k by A6,TARSKI:def 1;
       hence thesis by A15,AXIOMS:21;
      end;
A18:  D2.k in {x} implies D2.k in rng(D1|j1)
      proof
       assume A19:D2.k in {x};
         j1 in dom(D1|j1) by A10,A16,FINSEQ_3:27;
then A20:   (D1|j1).j1 in rng(D1|j1) by FUNCT_1:def 5;
         j1 in Seg j1 by A10,FINSEQ_1:3;
       hence thesis by A9,A17,A19,A20,RFINSEQ:19;
      end;
        D2.k in rng D1 implies D2.k in rng(D1|j1)
      proof
       assume D2.k in rng D1;
       then consider m such that
A21:   m in dom D1 & D2.k = D1.m by PARTFUN1:26;
         m in Seg len D1 by A21,FINSEQ_1:def 3;
then A22:   1 <= m & m <= j1 by A9,A15,A21,FINSEQ_1:3,GOBOARD1:def 1;
then A23:   m in dom (D1|j1) by A16,FINSEQ_3:27;
         m in Seg j1 by A22,FINSEQ_1:3;
       then D2.k = (D1|j1).m by A9,A21,RFINSEQ:19;
       hence thesis by A23,FUNCT_1:def 5;
      end;
      hence thesis by A2,A7,A11,A12,A14,A18,RFINSEQ:19,XBOOLE_0:def 2;
     end;
then A24: rng(D2|indx(D2,D1,j1)) c= rng (D1|j1) by TARSKI:def 3;
       for x1 st x1 in rng(D1|j1) holds x1 in rng(D2|indx(D2,D1,j1))
     proof
      let x1; assume x1 in rng(D1|j1);
      then consider k such that
A25:   k in dom(D1|j1) & x1=(D1|j1).k by PARTFUN1:26;
        k in Seg len(D1|j1) by A25,FINSEQ_1:def 3;
then A26:  k in Seg j1 by A10,TOPREAL1:3;
then A27:  (D1|j1).k = D1.k & k in dom D1 by A9,RFINSEQ:19;
      then D1.k in rng D1 by FUNCT_1:def 5;
      then x1 in rng D2 by A2,A25,A27,XBOOLE_0:def 2;
      then consider n such that
A28:   n in dom D2 & x1=D2.n by PARTFUN1:26;
A29:  indx(D2,D1,k) in dom D2 & D2.indx(D2,D1,k)=D2.n
        by A2,A25,A27,A28,INTEGRA1:def 21;
        k <= j1 by A26,FINSEQ_1:3;
      then D1.k <= D1.j1 by A1,A5,A27,GOBOARD2:18;
      then D2.indx(D2,D1,k) <= D1.j1 by A2,A27,INTEGRA1:def 21;
      then D2.indx(D2,D1,k)<=D2.indx(D2,D1,j1)
      by A1,A2,A5,INTEGRA1:def 21;
then A30:  n <= indx(D2,D1,j1) by A7,A28,A29,GOBOARD1:def 1;
        1 <= n by A28,FINSEQ_3:27;
then A31:  n in Seg indx(D2,D1,j1) by A30,FINSEQ_1:3;
then A32:  D2.n = (D2|indx(D2,D1,j1)).n by A7,RFINSEQ:19;
        n in Seg len(D2|indx(D2,D1,j1)) by A8,A31,TOPREAL1:3;
      then n in dom(D2|indx(D2,D1,j1)) by FINSEQ_1:def 3;
      hence thesis by A28,A32,FUNCT_1:def 5;
     end;
     then rng(D1|j1) c= rng(D2|indx(D2,D1,j1)) by TARSKI:def 3;
     hence thesis by A24,XBOOLE_0:def 10;
    end;

theorem Th9:
for A be closed-interval Subset of REAL, g be Function of A,REAL,
D1,D2 be Element of divs A st x in divset(D1,len D1) & len D1 >= 2
& D1<=D2 & rng D2 = rng D1 \/ {x} & g is_bounded_on A
holds Sum lower_volume(g,D2)-Sum
lower_volume(g,D1)<=(sup rng g-inf rng g)*delta(D1)
proof
   let A be closed-interval Subset of REAL;
   let g be Function of A,REAL;
   let D1,D2 be Element of divs A;
   assume A1:x in divset(D1,len D1) & len D1 >= 2;
   assume A2:D1<=D2 & rng D2 = rng D1 \/ {x};
   assume A3:g is_bounded_on A;
   deffunc PLg(Element of divs A,Nat) = (PartSums(lower_volume(g,$1))).$2;
   deffunc LVg(Element of divs A) = lower_volume(g,$1);
   set j = len D1;
A4:len D1 <> 0 & len D2 <> 0 by FINSEQ_1:25;
then A5:len D1 in Seg len D1 & len D2 in Seg len D2 by FINSEQ_1:5;
A6:len D1 in dom D1 & len D2 in dom D2 by SCMFSA_7:12;
A7:len D1 <> 1 by A1;
A8:sup rng g >= inf rng g by A3,Lm6;
A9:indx(D2,D1,j) in dom D2 & D2.indx(D2,D1,j)=D1.(len D1)
  by A2,A6,INTEGRA1:def 21;
then A10:indx(D2,D1,j) in Seg len D2 by FINSEQ_1:def 3;
  A11: indx(D2,D1,j) >= len lower_volume(g,D2)
  proof
   assume indx(D2,D1,j) < len lower_volume(g,D2);
   then indx(D2,D1,j) < len D2 by INTEGRA1:def 8;
then A12:D1.(len D1) < D2.(len D2) by A6,A9,GOBOARD1:def 1;
A13:not D2.(len D2) in rng D1
   proof
    assume A14:D2.(len D2) in rng D1;
      rng D1 c= A by INTEGRA1:def 2;
    then inf A <= D2.(len D2) & D2.(len D2) <= sup A by A14,INTEGRA2:1;
    hence contradiction by A12,INTEGRA1:def 2;
   end;
     D2.(len D2) in rng D2 by A6,FUNCT_1:def 5;
   then D2.(len D2) in rng D1 or D2.(len D2) in {x} by A2,XBOOLE_0:def 2;
   then D2.(len D2) = x by A13,TARSKI:def 1;
   then D2.(len D2) <= sup divset(D1,len D1) by A1,INTEGRA2:1;
   hence contradiction by A6,A7,A12,INTEGRA1:def 5;
  end;
then A15:indx(D2,D1,j) in Seg len lower_volume(g,D2)
   & indx(D2,D1,j) >= len lower_volume(g,D2) by A10,INTEGRA1:def 8;
A16:j in Seg len lower_volume(g,D1)
   & j >= len lower_volume(g,D1) by A5,INTEGRA1:def 8;
A17:len D1-1 in NAT & len D1-1 in dom D1 by A6,A7,INTEGRA1:9;
   reconsider j1=len D1-1 as Element of NAT by A6,A7,INTEGRA1:9;
A18:indx(D2,D1,j1) in dom D2 & 1 <= indx(D2,D1,j1) & indx(D2,D1,j1) <= len D2
   proof
    thus indx(D2,D1,j1) in dom D2 by A2,A17,INTEGRA1:def 21;
    hence thesis by FINSEQ_3:27;
   end;
   then mid(D2,1,indx(D2,D1,j1)) is increasing by INTEGRA1:37;
then A19:D2|indx(D2,D1,j1) is increasing by A18,JORDAN3:25;
A20:j1 in dom D1 & 1 <= j1 & j1 <= len D1
   proof
    thus j1 in dom D1 by A6,A7,INTEGRA1:9;
    hence thesis by FINSEQ_3:27;
    end;
    then mid(D1,1,j1) is increasing by INTEGRA1:37;
then A21:D1|j1 is increasing by A20,JORDAN3:25;
A22:rng (D2|indx(D2,D1,j1)) = rng (D1|j1) by A1,A2,Lm9;
then A23:D2|indx(D2,D1,j1)=D1|j1 by A19,A21,Th5;
A24:for k st 1 <= k & k <= j1 holds k=indx(D2,D1,k)
    proof
     let k; assume A25:1 <= k & k <= j1;
     assume A26:k<>indx(D2,D1,k);
       now per cases by A26,AXIOMS:21;
      suppose A27:k > indx(D2,D1,k);
        1 <= k & k <= len D1 by A20,A25,AXIOMS:22;
then A28:  k in dom D1 by FINSEQ_3:27;
then A29:  indx(D2,D1,k) in dom D2 & D1.k=D2.indx(D2,D1,k)
      by A2,INTEGRA1:def 21;
      then indx(D2,D1,k) in Seg len D2 by FINSEQ_1:def 3;
then A30:  1<=indx(D2,D1,k)&indx(D2,D1,k)<=indx(D2,D1,j1)
      by A2,A20,A25,A28,Th6,FINSEQ_1:3;
      then indx(D2,D1,k) in Seg indx(D2,D1,j1) by FINSEQ_1:3;
then A31:   (D2|indx(D2,D1,j1)).indx(D2,D1,k)=D2.indx(D2,D1,k) by A18,RFINSEQ:
19;
A32:  indx(D2,D1,k) < j1 by A25,A27,AXIOMS:22;
      then indx(D2,D1,k) <= len D1 by A20,AXIOMS:22;
      then indx(D2,D1,k) in dom D1 by A30,FINSEQ_3:27;
then A33:   D1.k > D1.indx(D2,D1,k) by A27,A28,GOBOARD1:def 1;
        indx(D2,D1,k) in Seg j1 by A30,A32,FINSEQ_1:3;
      hence contradiction by A20,A23,A29,A31,A33,RFINSEQ:19;
      suppose A34:k < indx(D2,D1,k);
        k in Seg j1 by A25,FINSEQ_1:3;
then A35:  D1.k = (D1|j1).k by A17,RFINSEQ:19;
        1 <= k & k <= len D1 by A20,A25,AXIOMS:22;
then A36:  k in dom D1 by FINSEQ_3:27;
then A37:  indx(D2,D1,k) in dom D2 & D1.k=D2.indx(D2,D1,k)
      by A2,INTEGRA1:def 21;
        indx(D2,D1,k) <= indx(D2,D1,j1) & indx(D2,D1,k) in dom D2 &
      indx(D2,D1,j1) in dom D2 by A2,A20,A25,A36,Th6;
then A38:  k <= indx(D2,D1,j1) by A34,AXIOMS:22;
      then k <= len D2 by A18,AXIOMS:22;
      then k in dom D2 by A25,FINSEQ_3:27;
then A39:  D2.k < D2.indx(D2,D1,k) by A34,A37,GOBOARD1:def 1;
        k in Seg indx(D2,D1,j1) by A25,A38,FINSEQ_1:3;
      hence contradiction by A18,A23,A35,A37,A39,RFINSEQ:19;
     end;
     hence contradiction;
    end;
A40:len (D2|indx(D2,D1,j1))=len (D1|j1) by A19,A21,A22,Th5;
      len (D2|indx(D2,D1,j1))=indx(D2,D1,j1) by A18,TOPREAL1:3;
then A41:indx(D2,D1,j1) =j1 by A20,A40,TOPREAL1:3;
      j1 <= len D1 by A17,FINSEQ_3:27;
    then j1 <= len lower_volume(g,D1) by INTEGRA1:def 8;
then A42:len(lower_volume(g,D1)|j1)=indx(D2,D1,j1) by A41,TOPREAL1:3;
      indx(D2,D1,j1) in dom D2 by A2,A17,INTEGRA1:def 21;
    then indx(D2,D1,j1) <= len D2 by FINSEQ_3:27;
    then indx(D2,D1,j1) <= len lower_volume(g,D2) by INTEGRA1:def 8;
then A43:len(lower_volume(g,D1)|j1)=len(lower_volume(g,D2)|indx(D2,D1,j1))
    by A42,TOPREAL1:3;
      for k st 1 <= k & k <= len(lower_volume(g,D1)|j1) holds
    (lower_volume(g,D1)|j1).k = (lower_volume(g,D2)|indx(D2,D1,j1)).k
    proof
    let k; assume A44:1 <= k & k <= len(lower_volume(g,D1)|j1);
A45: len(lower_volume(g,D1)) = len D1 by INTEGRA1:def 8;
then A46:1 <= k & k <= j1 by A20,A44,TOPREAL1:3;
then A47: k in Seg j1 by FINSEQ_1:3;
      k <= len D1 by A20,A46,AXIOMS:22;
then A48:k in Seg len D1 by A44,FINSEQ_1:3;
A49:divset(D1,k)=divset(D2,indx(D2,D1,k))
    proof
A50:  divset(D1,k)=[. inf divset(D1,k), sup divset(D1,k) .] by INTEGRA1:5;
A51:  k in dom D1 by A48,FINSEQ_1:def 3;
then A52:  indx(D2,D1,k) in dom D2 & D1.k=D2.indx(D2,D1,k) by A2,INTEGRA1:def
21;
       inf divset(D1,k)=inf divset(D2,indx(D2,D1,k)) &
     sup divset(D1,k)=sup divset(D2,indx(D2,D1,k))
     proof
      per cases;
      suppose A53:k=1;
then A54:  inf divset(D1,k)=inf A & sup divset(D1,k)=D1.k by A51,INTEGRA1:def 5
;
        indx(D2,D1,k)=1 by A20,A24,A53;
      hence thesis by A52,A54,INTEGRA1:def 5;
      suppose A55:k<>1;
then A56:  inf divset(D1,k)=D1.(k-1) & sup divset(D1,k)=D1.k
      by A51,INTEGRA1:def 5;
A57:  k-1 in dom D1 & D1.(k-1) in A & k-1 in NAT by A51,A55,INTEGRA1:9;
      reconsider k1=k-1 as Nat by A51,A55,INTEGRA1:9;
        k <= k+1 by NAT_1:29;
      then k1 <= k by REAL_1:86;
then A58:  k1 <= j1 by A46,AXIOMS:22;
A59:  1 <= k1 by A57,FINSEQ_3:27;
        indx(D2,D1,k)<>1 by A24,A46,A55;
then A60:  inf divset(D2,indx(D2,D1,k))=D2.(indx(D2,D1,k)-1) &
      sup divset(D2,indx(D2,D1,k))=D2.indx(D2,D1,k) by A52,INTEGRA1:def 5;
        D2.(indx(D2,D1,k)-1)=D2.(k-1) by A24,A46
        .= D2.indx(D2,D1,k1) by A24,A58,A59;
      hence thesis by A2,A51,A56,A57,A60,INTEGRA1:def 21;
     end;
     hence thesis by A50,INTEGRA1:5;
    end;
      j1 in Seg len(lower_volume(g,D1)) by A20,A45,FINSEQ_1:def 3;
    then j1 in dom(lower_volume(g,D1)) by FINSEQ_1:def 3;
then A61: (lower_volume(g,D1)|j1).k = lower_volume(g,D1).k by A47,RFINSEQ:19
    .=(inf(rng(g|divset(D2,indx(D2,D1,k)))))*vol(divset(D2,indx(D2,D1,k)))
     by A48,A49,INTEGRA1:def 8;
      indx(D2,D1,k) in Seg j1 by A24,A46,A47;
then A62:indx(D2,D1,k) in Seg indx(D2,D1,j1) by A20,A24;
    then 1<=indx(D2,D1,k) & indx(D2,D1,k)<=indx(D2,D1,j1) by FINSEQ_1:3;
    then 1<=indx(D2,D1,k) & indx(D2,D1,k)<=len D2 by A18,AXIOMS:22;
then A63:indx(D2,D1,k) in Seg len D2 by FINSEQ_1:3;
      indx(D2,D1,j1) in Seg len D2 by A18,FINSEQ_1:def 3;
    then indx(D2,D1,j1) in Seg len lower_volume(g,D2) by INTEGRA1:def 8;
then A64:indx(D2,D1,j1) in dom lower_volume(g,D2) by FINSEQ_1:def 3;
      (lower_volume(g,D2)|indx(D2,D1,j1)).k
     =(lower_volume(g,D2)|indx(D2,D1,j1)).indx(D2,D1,k) by A24,A46
    .=lower_volume(g,D2).indx(D2,D1,k) by A62,A64,RFINSEQ:19
    .=(inf(rng(g|divset(D2,indx(D2,D1,k)))))*vol(divset(D2,indx(D2,D1,k)))
    by A63,INTEGRA1:def 8;
    hence thesis by A61;
   end;
then A65:lower_volume(g,D2)|indx(D2,D1,j1)=lower_volume(g,D1)|j1
   by A43,FINSEQ_1:18;
     indx(D2,D1,j1) in Seg len D2 by A18,FINSEQ_1:def 3;
then A66:indx(D2,D1,j1) in Seg len lower_volume(g,D2) by INTEGRA1:def 8;
     j1 in Seg len D1 by A20,FINSEQ_1:def 3;
then A67:j1 in Seg len lower_volume(g,D1) by INTEGRA1:def 8;
A68:PLg(D2,indx(D2,D1,j1))=Sum(lower_volume(g,D2)|indx(D2,D1,j1))
   by A66,INTEGRA1:def 22
   .=PLg(D1,j1) by A65,A67,INTEGRA1:def 22;
A69:indx(D2,D1,j1)+1 <= indx(D2,D1,len D1)
   proof
      len D1 < len D1+1 by NAT_1:38;
    then j1 < len D1 by REAL_1:84;
    then indx(D2,D1,j1) < indx(D2,D1,len D1) by A2,A6,A20,Th7;
    hence thesis by NAT_1:38;
   end;
A70:Sum mid(lower_volume(g,D2),(indx(D2,D1,j1)+1),indx(D2,D1,len D1))
   -Sum mid(lower_volume(g,D1),len D1,len D1) <=
   (sup rng g-inf rng g)*delta(D1)
   proof
A71: 1 <= indx(D2,D1,j) & indx(D2,D1,j) <= len lower_volume(g,D2)
    proof
       indx(D2,D1,j) in dom D2 by A2,A6,INTEGRA1:def 21;
     then indx(D2,D1,j) in Seg len D2 by FINSEQ_1:def 3;
     then indx(D2,D1,j) in Seg len lower_volume(g,D2) by INTEGRA1:def 8;
    hence thesis by FINSEQ_1:3;
    end;
then A72: 1 <= indx(D2,D1,j1)+1 & indx(D2,D1,j1)+1 <= len lower_volume(g,D2)
    by A18,A69,AXIOMS:22,NAT_1:38;
A73:indx(D2,D1,j)-indx(D2,D1,j1) <= 2
    proof
     assume A74:indx(D2,D1,j)-indx(D2,D1,j1) > 2;
     set ID1=indx(D2,D1,j1)+1;
     set ID2=ID1+1;
A75:indx(D2,D1,j1) < ID1 & ID1 < ID2 & ID2 < indx(D2,D1,j)
     proof
      thus indx(D2,D1,j1) < ID1 by NAT_1:38;
      thus ID1 < ID2 by NAT_1:38;
        indx(D2,D1,j1)+(1+1)<indx(D2,D1,j) by A74,REAL_1:86;
      hence thesis by XCMPLX_1:1;
     end;
A76:indx(D2,D1,j) in dom D2 by A2,A6,INTEGRA1:def 21;
then A77:indx(D2,D1,j) <= len D2 by FINSEQ_3:27;
A78:ID1 in dom D2
     proof
A79:    1 <= ID1 & ID1 <= indx(D2,D1,j) by A18,A75,AXIOMS:22;
      then ID1 <= len D2 by A77,AXIOMS:22;
      hence thesis by A79,FINSEQ_3:27;
     end;
A80:ID2 in dom D2
     proof
A81:    indx(D2,D1,j1) <= ID2 & ID2 <= len D2 by A75,A77,AXIOMS:22;
      then 1 <= ID2 by A18,AXIOMS:22;
      hence thesis by A81,FINSEQ_3:27;
     end;
then A82:D2.indx(D2,D1,j1)<D2.ID1 & D2.ID1<D2.ID2 & D2.ID2<D2.indx(D2,D1,j)
     by A18,A75,A76,A78,GOBOARD1:def 1;
A83: D2.ID1 in rng D2 & D2.ID2 in rng D2 by A78,A80,FUNCT_1:def 5;
A84: D1.j1 = D2.indx(D2,D1,j1) & D1.j = D2.indx(D2,D1,j)
      by A2,A6,A20,INTEGRA1:def 21;
A85:D2.ID1 in {x} & D2.ID2 in {x}
     proof
        not(D2.ID1 in rng D1) & not(D2.ID2 in rng D1)
      proof
       assume A86:D2.ID1 in rng D1 or D2.ID2 in rng D1;
         now per cases by A86;
        suppose D2.ID1 in rng D1;
        then consider n such that
A87:   n in dom D1 & D1.n=D2.ID1 by PARTFUN1:26;
          D2.indx(D2,D1,j1)<D2.ID1 & D2.ID1<D2.indx(D2,D1,j)
        by A82,AXIOMS:22;
        then j1<n & n<j by A6,A20,A84,A87,GOBOARD2:18;
        then j<n+1 & n<j by REAL_1:84;
        hence contradiction by NAT_1:38;
        suppose D2.ID2 in rng D1;
        then consider n such that
A88:   n in dom D1 & D1.n=D2.ID2 by PARTFUN1:26;
          D2.indx(D2,D1,j1)<D2.ID2 & D2.ID2<D2.indx(D2,D1,j)
        by A82,AXIOMS:22;
        then j1<n & n<j by A6,A20,A84,A88,GOBOARD2:18;
        then j<n+1 & n<j by REAL_1:84;
        hence contradiction by NAT_1:38;
       end;
       hence thesis;
      end;
      hence thesis by A2,A83,XBOOLE_0:def 2;
     end;
     then D2.ID1 = x by TARSKI:def 1;
     then D2.ID1=D2.ID2 by A85,TARSKI:def 1;
     hence contradiction by A75,A78,A80,GOBOARD2:19;
    end;
  1 <= indx(D2,D1,j)-'(indx(D2,D1,j1)+1)+1 &
    indx(D2,D1,j)-'(indx(D2,D1,j1)+1)+1 <= 2
    proof
A89: indx(D2,D1,j)-'(indx(D2,D1,j1)+1)
     =indx(D2,D1,j)-(indx(D2,D1,j1)+1) by A69,SCMFSA_7:3;
     then indx(D2,D1,j)-'(indx(D2,D1,j1)+1) >= 0 by A69,SQUARE_1:12;
     then indx(D2,D1,j)-'(indx(D2,D1,j1)+1)+1 >= 0+1 by AXIOMS:24;
     hence indx(D2,D1,j)-'(indx(D2,D1,j1)+1)+1 >= 1;
       indx(D2,D1,j)-'(indx(D2,D1,j1)+1)+1
      =indx(D2,D1,j)-indx(D2,D1,j1)-1+1 by A89,XCMPLX_1:36
     .=indx(D2,D1,j)-indx(D2,D1,j1)+1-1 by XCMPLX_1:29
     .=indx(D2,D1,j)-indx(D2,D1,j1) by XCMPLX_1:26;
     hence thesis by A73;
    end;
then A90: 1 <= len mid(lower_volume(g,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j)) &
    len mid(lower_volume(g,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))<=2
    by A69,A71,A72,JORDAN3:27;
A91: 1 <= j & j <= len lower_volume(g,D1) by A5,FINSEQ_1:3,INTEGRA1:def 8;
  j-'j+1 = 1 by Lm3;
then A92: len mid(lower_volume(g,D1),j,j)=1 by A91,JORDAN3:27;
      mid(lower_volume(g,D1),j,j).1 = lower_volume(g,D1).j by A91,JORDAN3:27;
then A93:mid(lower_volume(g,D1),j,j)=<*lower_volume(g,D1).j*> by A92,FINSEQ_1:
57;
       indx(D2,D1,j1)+1 in Seg len lower_volume(g,D2) by A72,FINSEQ_1:3;
then A94:indx(D2,D1,j1)+1 in Seg len D2 by INTEGRA1:def 8;
A95:j in Seg len D1 by A4,FINSEQ_1:5;
      now per cases by A90,Lm4;
     suppose
A96: len mid(lower_volume(g,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))=1;
A97: indx(D2,D1,j1)+1=indx(D2,D1,j)
     proof
        len mid(lower_volume(g,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))
       = indx(D2,D1,j)-'(indx(D2,D1,j1)+1)+1 by A69,A71,A72,JORDAN3:27;
      then indx(D2,D1,j)-'(indx(D2,D1,j1)+1)=1-1 by A96,XCMPLX_1:26;
      then indx(D2,D1,j)-(indx(D2,D1,j1)+1)=0 by A69,SCMFSA_7:3;
      then indx(D2,D1,j)=0+(indx(D2,D1,j1)+1) by XCMPLX_1:27;
      hence thesis;
     end;
A98: divset(D2,indx(D2,D1,j))=divset(D1,j)
     proof
        inf divset(D1,j)=D2.indx(D2,D1,j1)
      & sup divset(D1,j)=D2.indx(D2,D1,j)
      proof
         inf divset(D1,j)=D1.j1 & sup divset(D1,j)=D1.j
       by A6,A7,INTEGRA1:def 5;
       hence thesis by A2,A6,A20,INTEGRA1:def 21;
      end;
then A99: divset(D1,j)=[. D2.indx(D2,D1,j1),D2.indx(D2,D1,j).] by INTEGRA1:5;
A100: indx(D2,D1,j)-1=indx(D2,D1,j1) by A97,XCMPLX_1:26;
A101: indx(D2,D1,j) in dom D2 by A2,A6,INTEGRA1:def 21;
        indx(D2,D1,j)<>1 by A18,A97,NAT_1:38;
      then inf divset(D2,indx(D2,D1,j))=D2.(indx(D2,D1,j)-1)
      & sup divset(D2,indx(D2,D1,j))=D2.indx(D2,D1,j)
      by A101,INTEGRA1:def 5;
      hence thesis by A99,A100,INTEGRA1:5;
     end;
       mid(lower_volume(g,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j)).1
      =lower_volume(g,D2).(indx(D2,D1,j1)+1) by A71,A72,JORDAN3:27;
     then mid(lower_volume(g,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))
      =<*lower_volume(g,D2).(indx(D2,D1,j1)+1)*> by A96,FINSEQ_1:57;
then A102: Sum mid(lower_volume(g,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))
      =lower_volume(g,D2).(indx(D2,D1,j1)+1) by RVSUM_1:103
     .=(inf(rng(g|divset(D2,(indx(D2,D1,j1)+1)))))
      *vol(divset(D2,(indx(D2,D1,j1)+1))) by A94,INTEGRA1:def 8
     .=lower_volume(g,D1).j by A95,A97,A98,INTEGRA1:def 8
     .=Sum mid(lower_volume(g,D1),j,j) by A93,RVSUM_1:103;
A103: delta(D1) >= 0 by Th8;
       sup rng g - inf rng g >= 0 by A8,SQUARE_1:12;
     then (sup rng g - inf rng g)*delta(D1) >= 0*delta(D1) by A103,AXIOMS:25;
     hence Sum mid(lower_volume(g,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))
     -Sum mid(lower_volume(g,D1),j,j) <= (sup rng g-inf rng g)*delta(D1)
     by A102,XCMPLX_1:14;
     suppose
A104:  len mid(lower_volume(g,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))=2;
A105:  mid(lower_volume(g,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j)).1
      =lower_volume(g,D2).(indx(D2,D1,j1)+1) by A71,A72,JORDAN3:27;
       mid(lower_volume(g,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j)).2
      =lower_volume(g,D2).(indx(D2,D1,j1)+2)
     proof
A106:  2+(indx(D2,D1,j1)+1)>=0+1 by A72,REAL_1:55;
        mid(lower_volume(g,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j)).2
       =LVg(D2).(2+(indx(D2,D1,j1)+1)-'1) by A69,A71,A72,A104,JORDAN3:27
      .=LVg(D2).(2+(indx(D2,D1,j1)+1)-1) by A106,SCMFSA_7:3
      .=LVg(D2).((indx(D2,D1,j1)+1)+(2-1)) by XCMPLX_1:29
      .=LVg(D2).(indx(D2,D1,j1)+(1+1)) by XCMPLX_1:1;
      hence thesis;
     end;
     then mid(lower_volume(g,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))
      =<*lower_volume(g,D2).(indx(D2,D1,j1)+1),
       lower_volume(g,D2).(indx(D2,D1,j1)+2)*> by A104,A105,FINSEQ_1:61;
then A107:  Sum mid(lower_volume(g,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))
      =lower_volume(g,D2).(indx(D2,D1,j1)+1)
       +lower_volume(g,D2).(indx(D2,D1,j1)+2) by RVSUM_1:107;
A108:  vol(divset(D1,j))
      =vol(divset(D2,indx(D2,D1,j1)+1))+vol(divset(D2,indx(D2,D1,j1)+2))
     proof
A109:  inf divset(D1,j)=D2.indx(D2,D1,j1)&sup divset(D1,j)=D2.indx(D2,D1,j)
      proof
         inf divset(D1,j)=D1.j1 & sup divset(D1,j)=D1.j by A6,A7,INTEGRA1:def 5
;
       hence thesis by A2,A6,A20,INTEGRA1:def 21;
      end;
A110:  indx(D2,D1,j)=indx(D2,D1,j1)+2
      proof
         indx(D2,D1,j)-'(indx(D2,D1,j1)+1)+1=2 by A69,A71,A72,A104,JORDAN3:27;
       then indx(D2,D1,j)-(indx(D2,D1,j1)+1)+1=2 by A69,SCMFSA_7:3;
       then indx(D2,D1,j)-indx(D2,D1,j1)-1+1=2 by XCMPLX_1:36;
       then indx(D2,D1,j)-indx(D2,D1,j1)-(1-1)=2 by XCMPLX_1:37;
       hence thesis by XCMPLX_1:27;
      end;
A111:  inf divset(D2,(indx(D2,D1,j1)+2))=D2.(indx(D2,D1,j1)+1)
      & sup divset(D2,(indx(D2,D1,j1)+2))=D2.(indx(D2,D1,j1)+2)
      & inf divset(D2,(indx(D2,D1,j1)+1))=D2.indx(D2,D1,j1)
      & sup divset(D2,(indx(D2,D1,j1)+1))=D2.(indx(D2,D1,j1)+1)
      proof
A112:  indx(D2,D1,j1)+2 in dom D2 by A2,A6,A110,INTEGRA1:def 21;
         indx(D2,D1,j1)+1 in Seg len lower_volume(g,D2) by A72,FINSEQ_1:3;
       then indx(D2,D1,j1)+1 in Seg len D2 by INTEGRA1:def 8;
then A113:  indx(D2,D1,j1)+1 in dom D2 by FINSEQ_1:def 3;
A114:  indx(D2,D1,j1)+1 <> 1 by A18,NAT_1:38;
         indx(D2,D1,j1)+1+1 > 1 by A72,NAT_1:38;
then A115:  indx(D2,D1,j1)+(1+1) > 1 by XCMPLX_1:1;
A116:  indx(D2,D1,j1)+2-1=indx(D2,D1,j1)+1 by Lm2,XCMPLX_1:29;
A117:  indx(D2,D1,j1)+1-1=indx(D2,D1,j1)+(1-1) by XCMPLX_1:29
       .=indx(D2,D1,j1)+0;
       thus inf divset(D2,(indx(D2,D1,j1)+2))=D2.(indx(D2,D1,j1)+1)
       & sup divset(D2,(indx(D2,D1,j1)+2))=D2.(indx(D2,D1,j1)+2)
       by A112,A115,A116,INTEGRA1:def 5;
       thus thesis by A113,A114,A117,INTEGRA1:def 5;
      end;
        vol(divset(D1,j))=sup divset(D1,j)-inf divset(D1,j) by INTEGRA1:def 6
      .=D2.indx(D2,D1,j)-(D2.(indx(D2,D1,j1)+1)
        -D2.(indx(D2,D1,j1)+1))-D2.indx(D2,D1,j1) by A109,XCMPLX_1:17
      .=D2.(indx(D2,D1,j1)+2)-D2.(indx(D2,D1,j1)+1)
        +D2.(indx(D2,D1,j1)+1)-D2.indx(D2,D1,j1) by A110,XCMPLX_1:37;
      then vol(divset(D1,j))=vol(divset(D2,indx(D2,D1,j1)+2))
        +D2.(indx(D2,D1,j1)+1)-D2.indx(D2,D1,j1) by A111,INTEGRA1:def 6
      .=vol(divset(D2,indx(D2,D1,j1)+2))
        +(sup divset(D2,indx(D2,D1,j1)+1)-inf divset(D2,indx(D2,D1,j1)+1))
      by A111,XCMPLX_1:29;
      hence thesis by INTEGRA1:def 6;
     end;
then A118: lower_volume(g,D1).j=(inf(rng(g|divset(D1,j))))*
     (vol(divset(D2,indx(D2,D1,j1)+1))+vol(divset(D2,indx(D2,D1,j1)+2)))
     by A95,INTEGRA1:def 8;
A119: vol(divset(D2,indx(D2,D1,j1)+1))>=0 by INTEGRA1:11;
A120: vol(divset(D2,indx(D2,D1,j1)+2))>=0 by INTEGRA1:11;
     A121: Sum mid(LVg(D2),indx(D2,D1,j1)+1,indx(D2,D1,j))-Sum mid(LVg(D1),j,j)
     <=(sup rng g - inf rng g)*(vol(divset(D2,indx(D2,D1,j1)+2))
      +vol(divset(D2,indx(D2,D1,j1)+1)))
     proof
A122: indx(D2,D1,j) in dom D2 by A2,A6,INTEGRA1:def 21;
A123: indx(D2,D1,j)=indx(D2,D1,j1)+2
      proof
         indx(D2,D1,j)-'(indx(D2,D1,j1)+1)+1=2 by A69,A71,A72,A104,JORDAN3:27;
       then indx(D2,D1,j)-(indx(D2,D1,j1)+1)+1=2 by A69,SCMFSA_7:3;
       then indx(D2,D1,j)-indx(D2,D1,j1)-1+1=2 by XCMPLX_1:36;
       then indx(D2,D1,j)-indx(D2,D1,j1)-(1-1)=2 by XCMPLX_1:37;
       hence thesis by XCMPLX_1:27;
      end;
then A124:  indx(D2,D1,j1)+2 in Seg len D2 by A122,FINSEQ_1:def 3;
      set ID1=indx(D2,D1,j1)+1, ID2=indx(D2,D1,j1)+2;
A125:  Sum mid(LVg(D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))
       =(inf rng(g|divset(D2,indx(D2,D1,j1)+2)))
        *vol(divset(D2,indx(D2,D1,j1)+2))
        +LVg(D2).(indx(D2,D1,j1)+1) by A107,A124,INTEGRA1:def 8
      .=(inf rng(g|divset(D2,indx(D2,D1,j1)+2)))
        *vol(divset(D2,indx(D2,D1,j1)+2))
        +(inf rng(g|divset(D2,indx(D2,D1,j1)+1)))
        *vol(divset(D2,indx(D2,D1,j1)+1)) by A94,INTEGRA1:def 8;
        divset(D2,ID2)c=A by A122,A123,INTEGRA1:10;
      then inf rng(g|divset(D2,ID2)) <= sup rng g by A3,Lm7;
then A126:  (inf rng(g|divset(D2,ID2)))*vol(divset(D2,ID2))
      <=(sup rng g)*vol(divset(D2,ID2)) by A120,AXIOMS:25;
        ID1 in dom D2 by A94,FINSEQ_1:def 3;
      then divset(D2,ID1) c= A by INTEGRA1:10;
      then inf rng(g|divset(D2,ID1)) <= sup rng g by A3,Lm7;
then A127:  (inf rng(g|divset(D2,ID1)))*vol(divset(D2,ID1))
      <=(sup rng g)*vol(divset(D2,ID1)) by A119,AXIOMS:25;
        divset(D1,j)c=A by A6,INTEGRA1:10;
      then inf rng(g|divset(D1,j)) >= inf rng g by A3,Lm7;
then A128:  (inf rng(g|divset(D1,j)))*vol(divset(D2,ID2))
      >=(inf rng g)*vol(divset(D2,ID2))
      & (inf rng(g|divset(D1,j)))*vol(divset(D2,ID1))
      >=(inf rng g)*vol(divset(D2,ID1)) by A119,A120,AXIOMS:25;
        Sum mid(LVg(D2),ID1,indx(D2,D1,j))
      -(inf rng(g|divset(D2,ID1)))*vol(divset(D2,ID1))
      <=(sup rng g)*vol(divset(D2,ID2)) by A125,A126,XCMPLX_1:26;
      then Sum mid(LVg(D2),ID1,indx(D2,D1,j))
      <=(sup rng g)*vol(divset(D2,ID2))
      +(inf rng(g|divset(D2,ID1)))*vol(divset(D2,ID1)) by REAL_1:86;
      then Sum mid(LVg(D2),ID1,indx(D2,D1,j))-(sup rng g)*vol(divset(D2,ID2))
      <=(inf rng(g|divset(D2,ID1)))*vol(divset(D2,ID1)) by REAL_1:86;
      then Sum mid(LVg(D2),ID1,indx(D2,D1,j))-(sup rng g)*vol(divset(D2,ID2))
      <=(sup rng g)*vol(divset(D2,ID1)) by A127,AXIOMS:22;
then A129:  Sum mid(LVg(D2),ID1,indx(D2,D1,j))<=(sup rng g)*vol(divset(D2,ID2))
+
      (sup rng g)*vol(divset(D2,ID1)) by REAL_1:86;
      set IR = (inf rng g)*vol(divset(D2,ID2));
        Sum mid(LVg(D1),j,j)=(inf rng(g|divset(D1,j)))
       *(vol(divset(D2,indx(D2,D1,j1)+1))
       +vol(divset(D2,indx(D2,D1,j1)+2))) by A93,A118,RVSUM_1:103
      .=(inf rng(g|divset(D1,j)))*vol(divset(D2,indx(D2,D1,j1)+2))
       +(inf rng(g|divset(D1,j)))*vol(divset(D2,indx(D2,D1,j1)+1))
      by XCMPLX_1:8;
      then Sum mid(LVg(D1),j,j)-(inf rng(g|divset(D1,j)))*vol(divset(D2,ID1))
       >=IR by A128,XCMPLX_1:26;
      then Sum mid(LVg(D1),j,j)>=(inf rng(g|divset(D1,j)))*vol(divset(D2,ID1))
       +IR by REAL_1:84;
      then Sum mid(LVg(D1),j,j)-(inf rng g)*vol(divset(D2,ID2))
       >=(inf rng(g|divset(D1,j)))*vol(divset(D2,ID1)) by REAL_1:84;
      then Sum mid(LVg(D1),j,j)-(inf rng g)*vol(divset(D2,ID2))
       >=(inf rng g)*vol(divset(D2,ID1)) by A128,AXIOMS:22;
      then Sum mid(LVg(D1),j,j) >=IR+(inf rng g)*vol(divset(D2,ID1))
      by REAL_1:84;
      then Sum mid(LVg(D2),ID1,indx(D2,D1,j))-Sum mid(LVg(D1),j,j)
      <=(sup rng g)*vol(divset(D2,ID2))+(sup rng g)*vol(divset(D2,ID1))
       -(IR+(inf rng g)*vol(divset(D2,ID1)))
      by A129,REAL_1:92;
      then Sum mid(LVg(D2),ID1,indx(D2,D1,j))-Sum mid(LVg(D1),j,j)
       <=((sup rng g)*vol(divset(D2,ID2))-(inf rng g)*vol(divset(D2,ID2)))
       +((sup rng g)*vol(divset(D2,ID1))-(inf rng g)*vol(divset(D2,ID1)))
      by Lm5;
      then Sum mid(LVg(D2),ID1,indx(D2,D1,j))-Sum mid(LVg(D1),j,j)
       <=(sup rng g - inf rng g)*vol(divset(D2,ID2))
       +((sup rng g)*vol(divset(D2,ID1))-(inf rng g)*vol(divset(D2,ID1)))
      by XCMPLX_1:40;
      then Sum mid(LVg(D2),ID1,indx(D2,D1,j))-Sum mid(LVg(D1),j,j)
       <=(sup rng g - inf rng g)*vol(divset(D2,ID2))
       +(sup rng g - inf rng g)*vol(divset(D2,ID1)) by XCMPLX_1:40;
      hence thesis by XCMPLX_1:8;
     end;
A130: vol(divset(D1,j)) <= delta(D1) by A6,Lm8;
       sup rng g - inf rng g >= 0 by A8,SQUARE_1:12;
     then (sup rng g - inf rng g)*(vol(divset(D1,j)))
      <=(sup rng g - inf rng g)*delta(D1) by A130,AXIOMS:25;
     hence thesis by A108,A121,AXIOMS:22;
    end;
    hence thesis;
   end;

A131:PLg(D2,indx(D2,D1,j1))
    +Sum mid(lower_volume(g,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))
    =PLg(D2,indx(D2,D1,j))
   proof
      indx(D2,D1,j) in dom D2 by A2,A6,INTEGRA1:def 21;
then A132: indx(D2,D1,j) in Seg len D2 by FINSEQ_1:def 3;
then A133:1 <= indx(D2,D1,j) & indx(D2,D1,j) <= len D2 by FINSEQ_1:3;
then A134: indx(D2,D1,j) <= len LVg(D2) by INTEGRA1:def 8;
A135: indx(D2,D1,j) in Seg len LVg(D2) by A132,INTEGRA1:def 8;
A136: indx(D2,D1,j1) < indx(D2,D1,j) by A69,NAT_1:38;
      indx(D2,D1,j1) in Seg len D2 by A18,FINSEQ_1:def 3;
    then indx(D2,D1,j1) in Seg len LVg(D2) by INTEGRA1:def 8;
    then PLg(D2,indx(D2,D1,j1))
    =Sum(LVg(D2)|indx(D2,D1,j1)) by INTEGRA1:def 22;
    then PLg(D2,indx(D2,D1,j1))
    +Sum mid(lower_volume(g,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))
    =Sum(LVg(D2)|indx(D2,D1,j1)
    ^mid(LVg(D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))) by RVSUM_1:105
    .=Sum(mid(LVg(D2),1,indx(D2,D1,j1))
     ^mid(LVg(D2),indx(D2,D1,j1)+1,indx(D2,D1,j))) by A18,JORDAN3:25
    .=Sum(mid(LVg(D2),1,indx(D2,D1,j))) by A18,A134,A136,INTEGRA2:4
    .=Sum(LVg(D2)|indx(D2,D1,j)) by A133,JORDAN3:25;
    hence thesis by A135,INTEGRA1:def 22;
   end;

 PLg(D1,j1)+Sum mid(lower_volume(g,D1),j,j)=PLg(D1,j)
   proof
A137: 1 <= j & j <= len LVg(D1) by A5,FINSEQ_1:3,INTEGRA1:def 8;
A138: j in Seg len LVg(D1) by A5,INTEGRA1:def 8;
A139: j1+1=j by XCMPLX_1:27;
      j < j+1 by NAT_1:38;
then A140: j1 < j by REAL_1:84;
      j1 in Seg len D1 by A20,FINSEQ_1:def 3;
    then j1 in Seg len LVg(D1) by INTEGRA1:def 8;
    then PLg(D1,j1)=Sum(LVg(D1)|j1) by INTEGRA1:def 22;
    then PLg(D1,j1)+Sum mid(LVg(D1),j,j)
     =Sum((LVg(D1)|j1)^mid(LVg(D1),j,j)) by RVSUM_1:105
    .=Sum(mid(LVg(D1),1,j1)^mid(LVg(D1),j1+1,j)) by A20,A139,JORDAN3:25
    .=Sum(mid(LVg(D1),1,j)) by A20,A137,A140,INTEGRA2:4
    .=Sum(LVg(D1)|j) by A137,JORDAN3:25;
    hence thesis by A138,INTEGRA1:def 22;
   end;
then A141:PLg(D2,indx(D2,D1,j))-PLg(D1,j)
    =(PLg(D2,indx(D2,D1,j1))-PLg(D1,j1))
     +(Sum mid(lower_volume(g,D2),(indx(D2,D1,j1)+1),indx(D2,D1,len D1))
     -Sum mid(lower_volume(g,D1),j,j)) by A131,Lm5
   .=0+(Sum mid(lower_volume(g,D2),(indx(D2,D1,j1)+1),indx(D2,D1,len D1))
     -Sum mid(lower_volume(g,D1),j,j)) by A68,XCMPLX_1:14;
A142:PLg(D2,indx(D2,D1,j))=Sum(lower_volume(g,D2)|indx(D2,D1,j))
   by A15,INTEGRA1:def 22
   .=Sum lower_volume(g,D2) by A11,TOPREAL1:2;
     PLg(D1,j)=Sum(lower_volume(g,D1)|j) by A16,INTEGRA1:def 22
   .=Sum lower_volume(g,D1) by A16,TOPREAL1:2;
   hence thesis by A70,A141,A142;
end;

theorem Th10:
for A be closed-interval Subset of REAL, g be Function of A,REAL,
D1,D2 be Element of divs A st x in divset(D1,len D1) & len D1 >= 2
& D1<=D2 & rng D2 = rng D1 \/ {x} & g is_bounded_on A
holds Sum upper_volume(g,D1)-Sum
upper_volume(g,D2)<=(sup rng g-inf rng g)*delta(D1)
proof
   let A be closed-interval Subset of REAL;
   let g be Function of A,REAL;
   let D1,D2 be Element of divs A;
   assume A1:x in divset(D1,len D1) & len D1 >= 2;
   assume A2:D1<=D2 & rng D2 = rng D1 \/ {x};
   assume A3:g is_bounded_on A;
   deffunc PUg(Element of divs A,Nat) = (PartSums(upper_volume(g,$1))).$2;
   deffunc UVg(Element of divs A) = upper_volume(g,$1);
   set j = len D1;
     len D1 <> 0 & len D2 <> 0 by FINSEQ_1:25;
then A4:len D1 in Seg len D1 & len D2 in Seg len D2 by FINSEQ_1:5;
then A5:len D1 in dom D1 & len D2 in dom D2 by FINSEQ_1:def 3;
A6:len D1 <> 1 by A1;
A7:sup rng g >= inf rng g by A3,Lm6;
A8:indx(D2,D1,j) in dom D2 & D2.indx(D2,D1,j)=D1.(len D1)
  by A2,A5,INTEGRA1:def 21;
then A9:indx(D2,D1,j) in Seg len D2 by FINSEQ_1:def 3;
  A10: indx(D2,D1,j) >= len upper_volume(g,D2)
  proof
   assume indx(D2,D1,j) < len upper_volume(g,D2);
   then indx(D2,D1,j) < len D2 by INTEGRA1:def 7;
then A11:D1.(len D1) < D2.(len D2) by A5,A8,GOBOARD1:def 1;
A12:not(D2.(len D2) in rng D1)
   proof
    assume A13:D2.(len D2) in rng D1;
      rng D1 c= A by INTEGRA1:def 2;
    then inf A <= D2.(len D2) & D2.(len D2) <= sup A by A13,INTEGRA2:1;
    hence contradiction by A11,INTEGRA1:def 2;
   end;
     D2.(len D2) in rng D2 by A5,FUNCT_1:def 5;
   then D2.(len D2) in rng D1 or D2.(len D2) in {x} by A2,XBOOLE_0:def 2;
   then D2.(len D2) = x by A12,TARSKI:def 1;
   then D2.(len D2) <= sup divset(D1,len D1) by A1,INTEGRA2:1;
   hence contradiction by A5,A6,A11,INTEGRA1:def 5;
  end;
then A14:indx(D2,D1,j) in Seg len upper_volume(g,D2)
   & indx(D2,D1,j) >= len upper_volume(g,D2) by A9,INTEGRA1:def 7;
A15:j in Seg len upper_volume(g,D1)
   & j >= len upper_volume(g,D1) by A4,INTEGRA1:def 7;
A16:len D1-1 in NAT & len D1-1 in dom D1 by A5,A6,INTEGRA1:9;
   reconsider j1=len D1-1 as Element of NAT by A5,A6,INTEGRA1:9;
A17:indx(D2,D1,j1) in dom D2 & 1 <= indx(D2,D1,j1) & indx(D2,D1,j1) <= len D2
   proof
    thus indx(D2,D1,j1) in dom D2 by A2,A16,INTEGRA1:def 21;
    hence thesis by FINSEQ_3:27;
   end;
   then mid(D2,1,indx(D2,D1,j1)) is increasing by INTEGRA1:37;
then A18:D2|indx(D2,D1,j1) is increasing by A17,JORDAN3:25;
A19:j1 in dom D1 & 1 <= j1 & j1 <= len D1 by A16,FINSEQ_3:27;
    then mid(D1,1,j1) is increasing by INTEGRA1:37;
then A20: D1|j1 is increasing by A19,JORDAN3:25;
A21: rng (D2|indx(D2,D1,j1)) = rng (D1|j1) by A1,A2,Lm9;
then A22:D2|indx(D2,D1,j1)=D1|j1 by A18,A20,Th5;
A23:for k st 1 <= k & k <= j1 holds k=indx(D2,D1,k)
    proof
     let k; assume A24:1 <= k & k <= j1;
     assume A25:k<>indx(D2,D1,k);
       now per cases by A25,AXIOMS:21;
      suppose A26:k > indx(D2,D1,k);
        1 <= k & k <= len D1 by A19,A24,AXIOMS:22;
then A27:   k in dom D1 by FINSEQ_3:27;
then A28:   indx(D2,D1,k) in dom D2 & D1.k=D2.indx(D2,D1,k)
      by A2,INTEGRA1:def 21;
      then indx(D2,D1,k) in Seg len D2 by FINSEQ_1:def 3;
then A29:   1<=indx(D2,D1,k)&indx(D2,D1,k)<=indx(D2,D1,j1)
      by A2,A16,A24,A27,Th6,FINSEQ_1:3;
      then indx(D2,D1,k) in Seg indx(D2,D1,j1) by FINSEQ_1:3;
then A30:   (D2|indx(D2,D1,j1)).indx(D2,D1,k)=D2.indx(D2,D1,k) by A17,RFINSEQ:
19;
A31:  indx(D2,D1,k) < j1 by A24,A26,AXIOMS:22;
      then indx(D2,D1,k) <= len D1 by A19,AXIOMS:22;
      then indx(D2,D1,k) in Seg len D1 by A29,FINSEQ_1:3;
      then indx(D2,D1,k) in dom D1 by FINSEQ_1:def 3;
then A32:   D1.k > D1.indx(D2,D1,k) by A26,A27,GOBOARD1:def 1;
        indx(D2,D1,k) in Seg j1 by A29,A31,FINSEQ_1:3;
      hence contradiction by A16,A22,A28,A30,A32,RFINSEQ:19;
      suppose A33:k < indx(D2,D1,k);
        k in Seg j1 by A24,FINSEQ_1:3;
then A34:   D1.k = (D1|j1).k by A16,RFINSEQ:19;
        1 <= k & k <= len D1 by A19,A24,AXIOMS:22;
then A35:   k in dom D1 by FINSEQ_3:27;
then A36:   indx(D2,D1,k) in dom D2 & D1.k=D2.indx(D2,D1,k)
      by A2,INTEGRA1:def 21;
        indx(D2,D1,k) <= indx(D2,D1,j1) & indx(D2,D1,k) in dom D2 &
      indx(D2,D1,j1) in dom D2 by A2,A16,A24,A35,Th6;
then A37:  k <= indx(D2,D1,j1) by A33,AXIOMS:22;
      then k <= len D2 by A17,AXIOMS:22;
      then k in dom D2 by A24,FINSEQ_3:27;
then A38:  D2.k < D2.indx(D2,D1,k) by A33,A36,GOBOARD1:def 1;
        k in Seg indx(D2,D1,j1) by A24,A37,FINSEQ_1:3;
      hence contradiction by A17,A22,A34,A36,A38,RFINSEQ:19;
     end;
     hence contradiction;
    end;

A39: len (D2|indx(D2,D1,j1))=len (D1|j1) by A18,A20,A21,Th5;
       len (D2|indx(D2,D1,j1))=indx(D2,D1,j1) by A17,TOPREAL1:3;
then A40: indx(D2,D1,j1) =j1 by A19,A39,TOPREAL1:3;
      j1 in Seg len D1 by A16,FINSEQ_1:def 3;
    then j1 <= len D1 by FINSEQ_1:3;
    then j1 <= len upper_volume(g,D1) by INTEGRA1:def 7;
then A41:len(upper_volume(g,D1)|j1)=indx(D2,D1,j1) by A40,TOPREAL1:3;
      indx(D2,D1,j1) in dom D2 by A2,A16,INTEGRA1:def 21;
    then indx(D2,D1,j1) <= len D2 by FINSEQ_3:27;
    then indx(D2,D1,j1) <= len upper_volume(g,D2) by INTEGRA1:def 7;
then A42:len(upper_volume(g,D1)|j1)=len(upper_volume(g,D2)|indx(D2,D1,j1))
    by A41,TOPREAL1:3;
      for k st 1 <= k & k <= len(upper_volume(g,D1)|j1) holds
    (upper_volume(g,D1)|j1).k = (upper_volume(g,D2)|indx(D2,D1,j1)).k
    proof
    let k; assume A43:1 <= k & k <= len(upper_volume(g,D1)|j1);
A44: len(upper_volume(g,D1)) = len D1 by INTEGRA1:def 7;
then A45:1 <= k & k <= j1 by A19,A43,TOPREAL1:3;
then A46: k in Seg j1 by FINSEQ_1:3;
      1 <= k & k <= len D1 by A19,A45,AXIOMS:22;
then A47:k in Seg len D1 by FINSEQ_1:3;
A48:divset(D1,k)=divset(D2,indx(D2,D1,k))
    proof
A49:  divset(D1,k)=[. inf divset(D1,k), sup divset(D1,k) .] by INTEGRA1:5;
A50:  k in dom D1 by A47,FINSEQ_1:def 3;
then A51:  indx(D2,D1,k) in dom D2 & D1.k=D2.indx(D2,D1,k) by A2,INTEGRA1:def
21;
       inf divset(D1,k)=inf divset(D2,indx(D2,D1,k)) &
     sup divset(D1,k)=sup divset(D2,indx(D2,D1,k))
     proof
      per cases;
       suppose A52:k=1;
then A53:   inf divset(D1,k)=inf A&sup divset(D1,k)=D1.k by A50,INTEGRA1:def 5;
         indx(D2,D1,k)=1 by A19,A23,A52;
       hence thesis by A51,A53,INTEGRA1:def 5;
       suppose A54:k<>1;
then A55:   inf divset(D1,k)=D1.(k-1) & sup divset(D1,k)=D1.k
       by A50,INTEGRA1:def 5;
A56:   k-1 in dom D1 & D1.(k-1) in A & k-1 in NAT by A50,A54,INTEGRA1:9;
       reconsider k1=k-1 as Nat by A50,A54,INTEGRA1:9;
        k <= k+1 by NAT_1:29;
      then k1 <= k by REAL_1:86;
then A57:  k1 <= j1 by A45,AXIOMS:22;
        1 <= k1 by A56,FINSEQ_3:27;
then A58:  k1=indx(D2,D1,k1) by A23,A57;
         indx(D2,D1,k)<>1 by A23,A45,A54;
then A59:   inf divset(D2,indx(D2,D1,k))=D2.(indx(D2,D1,k)-1) &
       sup divset(D2,indx(D2,D1,k))=D2.indx(D2,D1,k) by A51,INTEGRA1:def 5;
         D2.(indx(D2,D1,k)-1)= D2.indx(D2,D1,k1) by A23,A45,A58;
       hence thesis by A2,A50,A55,A56,A59,INTEGRA1:def 21;
     end;
     hence thesis by A49,INTEGRA1:5;
    end;
      j1 in Seg len(upper_volume(g,D1))
       by A16,A44,FINSEQ_1:def 3;
    then j1 in dom(upper_volume(g,D1)) by FINSEQ_1:def 3;
then A60: (upper_volume(g,D1)|j1).k = upper_volume(g,D1).k by A46,RFINSEQ:19
    .=(sup(rng(g|divset(D2,indx(D2,D1,k)))))*vol(divset(D2,indx(D2,D1,k)))
     by A47,A48,INTEGRA1:def 7;
      indx(D2,D1,k) in Seg j1 by A23,A45,A46;
then A61:indx(D2,D1,k) in Seg indx(D2,D1,j1) by A19,A23;
    then 1<=indx(D2,D1,k) & indx(D2,D1,k)<=indx(D2,D1,j1) by FINSEQ_1:3;
    then 1<=indx(D2,D1,k) & indx(D2,D1,k)<=len D2 by A17,AXIOMS:22;
then A62:indx(D2,D1,k) in Seg len D2 by FINSEQ_1:3;
      indx(D2,D1,j1) in Seg len D2 by A17,FINSEQ_1:def 3;
    then indx(D2,D1,j1) in Seg len upper_volume(g,D2) by INTEGRA1:def 7;
then A63:indx(D2,D1,j1) in dom upper_volume(g,D2) by FINSEQ_1:def 3;
      (upper_volume(g,D2)|indx(D2,D1,j1)).k
     =(upper_volume(g,D2)|indx(D2,D1,j1)).indx(D2,D1,k) by A23,A45
    .=upper_volume(g,D2).indx(D2,D1,k) by A61,A63,RFINSEQ:19
    .=(sup(rng(g|divset(D2,indx(D2,D1,k)))))*vol(divset(D2,indx(D2,D1,k)))
    by A62,INTEGRA1:def 7;
    hence thesis by A60;
   end;
then A64:upper_volume(g,D2)|indx(D2,D1,j1)=upper_volume(g,D1)|j1
   by A42,FINSEQ_1:18;
     indx(D2,D1,j1) in Seg len D2 by A17,FINSEQ_1:def 3;
then A65:indx(D2,D1,j1) in Seg len upper_volume(g,D2) by INTEGRA1:def 7;
     j1 in Seg len D1 by A16,FINSEQ_1:def 3;
then A66:j1 in Seg len upper_volume(g,D1) by INTEGRA1:def 7;
A67:PUg(D2,indx(D2,D1,j1))=Sum(upper_volume(g,D2)|indx(D2,D1,j1))
   by A65,INTEGRA1:def 22
   .=PUg(D1,j1) by A64,A66,INTEGRA1:def 22;
A68:indx(D2,D1,j1)+1 <= indx(D2,D1,len D1)
   proof
      len D1 < len D1+1 by NAT_1:38;
    then j1 < len D1 by REAL_1:84;
    then indx(D2,D1,j1) < indx(D2,D1,len D1) by A2,A5,A16,Th7;
    hence thesis by NAT_1:38;
   end;
A69:Sum mid(upper_volume(g,D1),len D1,len D1)
    -Sum mid(upper_volume(g,D2),(indx(D2,D1,j1)+1),indx(D2,D1,len D1))
    <= (sup rng g-inf rng g)*delta(D1)
   proof
A70: 1 <= indx(D2,D1,j) & indx(D2,D1,j) <= len upper_volume(g,D2)
    proof
       indx(D2,D1,j) in dom D2 by A2,A5,INTEGRA1:def 21;
     then indx(D2,D1,j) in Seg len D2 by FINSEQ_1:def 3;
     then indx(D2,D1,j) in Seg len upper_volume(g,D2) by INTEGRA1:def 7;
    hence thesis by FINSEQ_1:3;
    end;
then A71: 1 <= indx(D2,D1,j1)+1 & indx(D2,D1,j1)+1 <= len upper_volume(g,D2)
    by A17,A68,AXIOMS:22,NAT_1:38;
A72:indx(D2,D1,j)-indx(D2,D1,j1) <= 2
    proof
     assume A73:indx(D2,D1,j)-indx(D2,D1,j1) > 2;
     reconsider ID1=indx(D2,D1,j1)+1 as Nat;
     reconsider ID2=ID1+1 as Nat;
A74:indx(D2,D1,j1) < ID1 & ID1 < ID2 & ID2 < indx(D2,D1,j)
     proof
      thus indx(D2,D1,j1) < ID1 by NAT_1:38;
      thus ID1 < ID2 by NAT_1:38;
        indx(D2,D1,j1)+(1+1)<indx(D2,D1,j) by A73,REAL_1:86;
      hence thesis by XCMPLX_1:1;
     end;
A75:indx(D2,D1,j) in dom D2 by A2,A5,INTEGRA1:def 21;
then A76:indx(D2,D1,j) <= len D2 by FINSEQ_3:27;
A77:ID1 in dom D2
     proof
A78:    1 <= ID1 & ID1 <= indx(D2,D1,j) by A17,A74,AXIOMS:22;
      then ID1 <= len D2 by A76,AXIOMS:22;
      hence thesis by A78,FINSEQ_3:27;
     end;
A79:ID2 in dom D2
     proof
A80:    indx(D2,D1,j1) <= ID2 & ID2 <= len D2 by A74,A76,AXIOMS:22;
      then 1 <= ID2 by A17,AXIOMS:22;
      hence thesis by A80,FINSEQ_3:27;
     end;
then A81:D2.indx(D2,D1,j1)<D2.ID1 & D2.ID1<D2.ID2 & D2.ID2<D2.indx(D2,D1,j)
     by A17,A74,A75,A77,GOBOARD1:def 1;
A82:D2.ID1 in {x} & D2.ID2 in {x}
     proof
      A83: D2.ID1 in rng D2 & D2.ID2 in rng D2 by A77,A79,FUNCT_1:def 5;
A84: D1.j1 = D2.indx(D2,D1,j1) & D1.j = D2.indx(D2,D1,j)
      by A2,A5,A16,INTEGRA1:def 21;
        not(D2.ID1 in rng D1) & not(D2.ID2 in rng D1)
      proof
       assume A85:D2.ID1 in rng D1 or D2.ID2 in rng D1;
         now per cases by A85;
        suppose D2.ID1 in rng D1;
        then consider n such that
A86:   n in dom D1 & D1.n=D2.ID1 by PARTFUN1:26;
          D2.indx(D2,D1,j1)<D2.ID1 & D2.ID1<D2.indx(D2,D1,j)
        by A81,AXIOMS:22;
        then j1<n & n<j by A5,A16,A84,A86,GOBOARD2:18;
        then j<n+1 & n<j by REAL_1:84;
        hence contradiction by NAT_1:38;
        suppose D2.ID2 in rng D1;
        then consider n such that
A87:   n in dom D1 & D1.n=D2.ID2 by PARTFUN1:26;
          D2.indx(D2,D1,j1)<D2.ID2 & D2.ID2<D2.indx(D2,D1,j)
        by A81,AXIOMS:22;
        then j1<n & n<j by A5,A16,A84,A87,GOBOARD2:18;
        then j<n+1 & n<j by REAL_1:84;
        hence contradiction by NAT_1:38;
       end;
       hence thesis;
      end;
      hence thesis by A2,A83,XBOOLE_0:def 2;
     end;
     then D2.ID1 = x by TARSKI:def 1;
     then D2.ID1=D2.ID2 by A82,TARSKI:def 1;
     hence contradiction by A74,A77,A79,GOBOARD2:19;
    end;
  1 <= indx(D2,D1,j)-'(indx(D2,D1,j1)+1)+1 &
    indx(D2,D1,j)-'(indx(D2,D1,j1)+1)+1 <= 2
    proof
A88: indx(D2,D1,j)-'(indx(D2,D1,j1)+1)
     =indx(D2,D1,j)-(indx(D2,D1,j1)+1) by A68,SCMFSA_7:3;
     then indx(D2,D1,j)-'(indx(D2,D1,j1)+1) >= 0 by A68,SQUARE_1:12;
     then indx(D2,D1,j)-'(indx(D2,D1,j1)+1)+1 >= 0+1 by AXIOMS:24;
     hence indx(D2,D1,j)-'(indx(D2,D1,j1)+1)+1 >= 1;
       indx(D2,D1,j)-'(indx(D2,D1,j1)+1)+1
      =indx(D2,D1,j)-indx(D2,D1,j1)-1+1 by A88,XCMPLX_1:36
     .=indx(D2,D1,j)-indx(D2,D1,j1)+1-1 by XCMPLX_1:29
     .=indx(D2,D1,j)-indx(D2,D1,j1) by XCMPLX_1:26;
     hence thesis by A72;
    end;
then A89: 1 <= len mid(upper_volume(g,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j)) &
    len mid(upper_volume(g,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))<=2
    by A68,A70,A71,JORDAN3:27;
A90: 1 <= j & j <= len upper_volume(g,D1) by A4,FINSEQ_1:3,INTEGRA1:def 7;
  j-'j+1 = 1 by Lm3;
then A91: len mid(upper_volume(g,D1),j,j)=1 by A90,JORDAN3:27;
      mid(upper_volume(g,D1),j,j).1 = upper_volume(g,D1).j by A90,JORDAN3:27;
    then mid(upper_volume(g,D1),j,j)=<*upper_volume(g,D1).j*> by A91,FINSEQ_1:
57;
then A92:Sum mid(upper_volume(g,D1),j,j)=upper_volume(g,D1).j by RVSUM_1:103;
A93:indx(D2,D1,j1)+1 in Seg len D2
    proof
       indx(D2,D1,j1)+1 in Seg len upper_volume(g,D2) by A71,FINSEQ_1:3;
     hence thesis by INTEGRA1:def 7;
    end;
      now per cases by A89,Lm4;
     suppose
A94: len mid(upper_volume(g,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))=1;
A95: indx(D2,D1,j1)+1=indx(D2,D1,j)
     proof
        len mid(upper_volume(g,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))
       = indx(D2,D1,j)-'(indx(D2,D1,j1)+1)+1 by A68,A70,A71,JORDAN3:27;
      then indx(D2,D1,j)-'(indx(D2,D1,j1)+1)=1-1 by A94,XCMPLX_1:26;
      then indx(D2,D1,j)-(indx(D2,D1,j1)+1)=0 by A68,SCMFSA_7:3;
      then indx(D2,D1,j)=0+(indx(D2,D1,j1)+1) by XCMPLX_1:27;
      hence thesis;
     end;
A96: divset(D2,indx(D2,D1,j))=divset(D1,j)
     proof
        inf divset(D1,j)=D1.j1 & sup divset(D1,j)=D1.j
        by A5,A6,INTEGRA1:def 5;
      then inf divset(D1,j)=D2.indx(D2,D1,j1)
      & sup divset(D1,j)=D2.indx(D2,D1,j)
      by A2,A5,A16,INTEGRA1:def 21;
then A97: divset(D1,j)=[. D2.indx(D2,D1,j1),D2.indx(D2,D1,j).] by INTEGRA1:5;
A98: indx(D2,D1,j)-1=indx(D2,D1,j1) by A95,XCMPLX_1:26;
A99: indx(D2,D1,j) in dom D2 by A2,A5,INTEGRA1:def 21;
        indx(D2,D1,j)<>1 by A17,A95,NAT_1:38;
      then inf divset(D2,indx(D2,D1,j))=D2.(indx(D2,D1,j)-1)
      & sup divset(D2,indx(D2,D1,j))=D2.indx(D2,D1,j)
      by A99,INTEGRA1:def 5;
      hence thesis by A97,A98,INTEGRA1:5;
     end;
       mid(upper_volume(g,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j)).1
      =upper_volume(g,D2).(indx(D2,D1,j1)+1) by A70,A71,JORDAN3:27;
     then mid(upper_volume(g,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))
      =<*upper_volume(g,D2).(indx(D2,D1,j1)+1)*> by A94,FINSEQ_1:57;
     then A100: Sum mid(upper_volume(g,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))
      =upper_volume(g,D2).(indx(D2,D1,j1)+1) by RVSUM_1:103
     .=(sup(rng(g|divset(D2,(indx(D2,D1,j1)+1)))))
      *vol(divset(D2,(indx(D2,D1,j1)+1))) by A93,INTEGRA1:def 7
     .=Sum
mid(upper_volume(g,D1),j,j) by A4,A92,A95,A96,INTEGRA1:def 7;
A101: delta(D1) >= 0 by Th8;
       sup rng g - inf rng g >= 0 by A7,SQUARE_1:12;
     then (sup rng g - inf rng g)*delta(D1) >= 0*delta(D1) by A101,AXIOMS:25;
     hence Sum mid(upper_volume(g,D1),j,j)-
     Sum mid(upper_volume(g,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))
     <= (sup rng g-inf rng g)*delta(D1) by A100,XCMPLX_1:14;
     suppose
A102:  len mid(upper_volume(g,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))=2;
A103:  mid(upper_volume(g,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j)).1
      =upper_volume(g,D2).(indx(D2,D1,j1)+1) by A70,A71,JORDAN3:27;
       mid(upper_volume(g,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j)).2
      =upper_volume(g,D2).(indx(D2,D1,j1)+2)
     proof
A104:  2+(indx(D2,D1,j1)+1)>=0+1 by A71,REAL_1:55;
        mid(upper_volume(g,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j)).2
       =UVg(D2).(2+(indx(D2,D1,j1)+1)-'1) by A68,A70,A71,A102,JORDAN3:27
      .=UVg(D2).(2+(indx(D2,D1,j1)+1)-1) by A104,SCMFSA_7:3
      .=UVg(D2).((indx(D2,D1,j1)+1)+(2-1)) by XCMPLX_1:29
      .=UVg(D2).(indx(D2,D1,j1)+(1+1)) by XCMPLX_1:1;
      hence thesis;
     end;
     then mid(upper_volume(g,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))
      =<*upper_volume(g,D2).(indx(D2,D1,j1)+1),
       upper_volume(g,D2).(indx(D2,D1,j1)+2)*> by A102,A103,FINSEQ_1:61;
then A105:  Sum mid(upper_volume(g,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))
      =upper_volume(g,D2).(indx(D2,D1,j1)+1)
       +upper_volume(g,D2).(indx(D2,D1,j1)+2) by RVSUM_1:107;
A106:  vol(divset(D1,j))
      =vol(divset(D2,indx(D2,D1,j1)+1))+vol(divset(D2,indx(D2,D1,j1)+2))
     proof
A107:  inf divset(D1,j)=D2.indx(D2,D1,j1)&sup divset(D1,j)=D2.indx(D2,D1,j)
      proof
         inf divset(D1,j)=D1.j1 & sup divset(D1,j)=D1.j by A5,A6,INTEGRA1:def 5
;
       hence thesis by A2,A5,A16,INTEGRA1:def 21;
      end;
A108:  indx(D2,D1,j)=indx(D2,D1,j1)+2
      proof
         indx(D2,D1,j)-'(indx(D2,D1,j1)+1)+1=2 by A68,A70,A71,A102,JORDAN3:27;
       then indx(D2,D1,j)-(indx(D2,D1,j1)+1)+1=2 by A68,SCMFSA_7:3;
       then indx(D2,D1,j)-indx(D2,D1,j1)-1+1=2 by XCMPLX_1:36;
       then indx(D2,D1,j)-indx(D2,D1,j1)-(1-1)=2 by XCMPLX_1:37;
       hence thesis by XCMPLX_1:27;
      end;
A109:  inf divset(D2,(indx(D2,D1,j1)+2))=D2.(indx(D2,D1,j1)+1)
      & sup divset(D2,(indx(D2,D1,j1)+2))=D2.(indx(D2,D1,j1)+2)
      & inf divset(D2,(indx(D2,D1,j1)+1))=D2.indx(D2,D1,j1)
      & sup divset(D2,(indx(D2,D1,j1)+1))=D2.(indx(D2,D1,j1)+1)
      proof
A110:   indx(D2,D1,j1)+2 in dom D2 by A2,A5,A108,INTEGRA1:def 21;
         indx(D2,D1,j1)+1 in Seg len upper_volume(g,D2) by A71,FINSEQ_1:3;
       then indx(D2,D1,j1)+1 in Seg len D2 by INTEGRA1:def 7;
then A111:  indx(D2,D1,j1)+1 in dom D2 by FINSEQ_1:def 3;
A112:  indx(D2,D1,j1)+1 <> 1 by A17,NAT_1:38;
         indx(D2,D1,j1)+1+1 > 1 by A71,NAT_1:38;
then A113:  indx(D2,D1,j1)+(1+1) > 1 by XCMPLX_1:1;
A114:  indx(D2,D1,j1)+2-1=indx(D2,D1,j1)+1 by Lm2,XCMPLX_1:29;
A115:  indx(D2,D1,j1)+1-1=indx(D2,D1,j1)+(1-1) by XCMPLX_1:29
       .=indx(D2,D1,j1)+0;
       thus inf divset(D2,(indx(D2,D1,j1)+2))=D2.(indx(D2,D1,j1)+1)
       & sup divset(D2,(indx(D2,D1,j1)+2))=D2.(indx(D2,D1,j1)+2)
       by A110,A113,A114,INTEGRA1:def 5;
       thus thesis by A111,A112,A115,INTEGRA1:def 5;
      end;
        vol(divset(D1,j))
       =sup divset(D1,j)-inf divset(D1,j) by INTEGRA1:def 6
      .=D2.indx(D2,D1,j)-(D2.(indx(D2,D1,j1)+1)
        -D2.(indx(D2,D1,j1)+1))-D2.indx(D2,D1,j1) by A107,XCMPLX_1:17
      .=D2.(indx(D2,D1,j1)+2)-D2.(indx(D2,D1,j1)+1)
        +D2.(indx(D2,D1,j1)+1)-D2.indx(D2,D1,j1) by A108,XCMPLX_1:37;
      then vol(divset(D1,j))
       =vol(divset(D2,indx(D2,D1,j1)+2))
        +D2.(indx(D2,D1,j1)+1)-D2.indx(D2,D1,j1) by A109,INTEGRA1:def 6
      .=vol(divset(D2,indx(D2,D1,j1)+2))
        +(sup divset(D2,indx(D2,D1,j1)+1)-inf divset(D2,indx(D2,D1,j1)+1))
      by A109,XCMPLX_1:29;
      hence thesis by INTEGRA1:def 6;
     end;
then A116:  upper_volume(g,D1).j=(sup(rng(g|divset(D1,j))))*
     (vol(divset(D2,indx(D2,D1,j1)+1))+vol(divset(D2,indx(D2,D1,j1)+2)))
     by A4,INTEGRA1:def 7;
A117:  vol(divset(D2,indx(D2,D1,j1)+1))>=0 by INTEGRA1:11;
A118: vol(divset(D2,indx(D2,D1,j1)+2))>=0 by INTEGRA1:11;
     A119: Sum mid(UVg(D1),j,j)-Sum mid(UVg(D2),indx(D2,D1,j1)+1,indx(D2,D1,j))
     <=(sup rng g - inf rng g)*(vol(divset(D2,indx(D2,D1,j1)+2))
      +vol(divset(D2,indx(D2,D1,j1)+1)))
     proof
A120: indx(D2,D1,j) in dom D2 by A2,A5,INTEGRA1:def 21;
then A121:  indx(D2,D1,j) in Seg len D2 by FINSEQ_1:def 3;
A122: indx(D2,D1,j)=indx(D2,D1,j1)+2
      proof
         indx(D2,D1,j)-'(indx(D2,D1,j1)+1)+1=2 by A68,A70,A71,A102,JORDAN3:27;
       then indx(D2,D1,j)-(indx(D2,D1,j1)+1)+1=2 by A68,SCMFSA_7:3;
       then indx(D2,D1,j)-indx(D2,D1,j1)-1+1=2 by XCMPLX_1:36;
       then indx(D2,D1,j)-indx(D2,D1,j1)-(1-1)=2 by XCMPLX_1:37;
       hence thesis by XCMPLX_1:27;
      end;
      set ID1=indx(D2,D1,j1)+1, ID2=indx(D2,D1,j1)+2;
A123:  Sum mid(UVg(D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))
       =(sup rng(g|divset(D2,indx(D2,D1,j1)+2)))
        *vol(divset(D2,indx(D2,D1,j1)+2))
        +UVg(D2).(indx(D2,D1,j1)+1) by A105,A121,A122,INTEGRA1:def 7
      .=(sup rng(g|divset(D2,indx(D2,D1,j1)+2)))
        *vol(divset(D2,indx(D2,D1,j1)+2))
        +(sup rng(g|divset(D2,indx(D2,D1,j1)+1)))
        *vol(divset(D2,indx(D2,D1,j1)+1)) by A93,INTEGRA1:def 7;
        divset(D2,ID2)c=A by A120,A122,INTEGRA1:10;
      then sup rng(g|divset(D2,ID2)) >= inf rng g by A3,Lm7;
then A124:  (sup rng(g|divset(D2,ID2)))*vol(divset(D2,ID2))
      >=(inf rng g)*vol(divset(D2,ID2)) by A118,AXIOMS:25;
        ID1 in dom D2 by A93,FINSEQ_1:def 3;
      then divset(D2,ID1)c=A by INTEGRA1:10;
      then sup rng(g|divset(D2,ID1)) >= inf rng g by A3,Lm7;
then A125:  (sup rng(g|divset(D2,ID1)))*vol(divset(D2,ID1))
      >=(inf rng g)*vol(divset(D2,ID1)) by A117,AXIOMS:25;
        divset(D1,j)c=A by A5,INTEGRA1:10;
      then sup rng(g|divset(D1,j)) <= sup rng g by A3,Lm7;
then A126:  (sup rng(g|divset(D1,j)))*vol(divset(D2,ID2))
      <=(sup rng g)*vol(divset(D2,ID2))
      & (sup rng(g|divset(D1,j)))*vol(divset(D2,ID1))
      <=(sup rng g)*vol(divset(D2,ID1)) by A117,A118,AXIOMS:25;
        Sum mid(UVg(D2),ID1,indx(D2,D1,j))
      -(sup rng(g|divset(D2,ID1)))*vol(divset(D2,ID1))
      >=(inf rng g)*vol(divset(D2,ID2)) by A123,A124,XCMPLX_1:26;
      then Sum mid(UVg(D2),ID1,indx(D2,D1,j))
      >=(inf rng g)*vol(divset(D2,ID2))
      +(sup rng(g|divset(D2,ID1)))*vol(divset(D2,ID1)) by REAL_1:84;
      then Sum mid(UVg(D2),ID1,indx(D2,D1,j))-(inf rng g)*vol(divset(D2,ID2))
      >=(sup rng(g|divset(D2,ID1)))*vol(divset(D2,ID1)) by REAL_1:84;
      then Sum mid(UVg(D2),ID1,indx(D2,D1,j))-(inf rng g)*vol(divset(D2,ID2))
      >=(inf rng g)*vol(divset(D2,ID1)) by A125,AXIOMS:22;
then A127:  Sum mid(UVg(D2),ID1,indx(D2,D1,j))>=(inf rng g)*vol(divset(D2,ID2))
+
      (inf rng g)*vol(divset(D2,ID1)) by REAL_1:84;
        Sum mid(UVg(D1),j,j)
       =(sup rng(g|divset(D1,j)))*vol(divset(D2,indx(D2,D1,j1)+2))
       +(sup rng(g|divset(D1,j)))*vol(divset(D2,indx(D2,D1,j1)+1))
      by A92,A116,XCMPLX_1:8;
      then Sum mid(UVg(D1),j,j)-(sup rng(g|divset(D1,j)))*vol(divset(D2,ID1))
       =(sup rng(g|divset(D1,j)))*vol(divset(D2,ID2)) by XCMPLX_1:26;
      then Sum mid(UVg(D1),j,j)<=(sup rng(g|divset(D1,j)))*vol(divset(D2,ID1))
       +(sup rng g)*vol(divset(D2,ID2)) by A126,REAL_1:86;
      then Sum mid(UVg(D1),j,j)-(sup rng g)*vol(divset(D2,ID2))
       <=(sup rng(g|divset(D1,j)))*vol(divset(D2,ID1)) by REAL_1:86;
      then Sum mid(UVg(D1),j,j)-(sup rng g)*vol(divset(D2,ID2))
       <=(sup rng g)*vol(divset(D2,ID1)) by A126,AXIOMS:22;
      then Sum mid(UVg(D1),j,j)
       <=(sup rng g)*vol(divset(D2,ID2))+(sup rng g)*vol(divset(D2,ID1))
      by REAL_1:86;
      then Sum mid(UVg(D1),j,j)-Sum mid(UVg(D2),ID1,indx(D2,D1,j))
      <=(sup rng g)*vol(divset(D2,ID2))+(sup rng g)*vol(divset(D2,ID1))
       -((inf rng g)*vol(divset(D2,ID2))+(inf rng g)*vol(divset(D2,ID1)))
      by A127,REAL_1:92;
      then Sum mid(UVg(D1),j,j)-Sum mid(UVg(D2),ID1,indx(D2,D1,j))
       <=((sup rng g)*vol(divset(D2,ID2))-(inf rng g)*vol(divset(D2,ID2)))
       +((sup rng g)*vol(divset(D2,ID1))-(inf rng g)*vol(divset(D2,ID1)))
      by Lm5;
      then Sum mid(UVg(D1),j,j)-Sum mid(UVg(D2),ID1,indx(D2,D1,j))
       <=(sup rng g - inf rng g)*vol(divset(D2,ID2))
       +((sup rng g)*vol(divset(D2,ID1))-(inf rng g)*vol(divset(D2,ID1)))
      by XCMPLX_1:40;
      then Sum mid(UVg(D1),j,j)-Sum mid(UVg(D2),ID1,indx(D2,D1,j))
       <=(sup rng g - inf rng g)*vol(divset(D2,ID2))
       +(sup rng g - inf rng g)*vol(divset(D2,ID1)) by XCMPLX_1:40;
      hence thesis by XCMPLX_1:8;
     end;
A128: vol(divset(D1,j)) <= delta(D1) by A5,Lm8;
       sup rng g - inf rng g >= 0 by A7,SQUARE_1:12;
     then (sup rng g - inf rng g)*(vol(divset(D1,j)))
      <=(sup rng g - inf rng g)*delta(D1) by A128,AXIOMS:25;
     hence thesis by A106,A119,AXIOMS:22;
    end;
    hence thesis;
   end;

A129:PUg(D2,indx(D2,D1,j1))
    +Sum mid(upper_volume(g,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))
    =PUg(D2,indx(D2,D1,j))
   proof
      indx(D2,D1,j) in dom D2 by A2,A5,INTEGRA1:def 21;
then A130: indx(D2,D1,j) in Seg len D2 by FINSEQ_1:def 3;
    then A131: 1 <= indx(D2,D1,j) & indx(D2,D1,j) <= len D2 by FINSEQ_1:3;
then A132: 1 <= indx(D2,D1,j) & indx(D2,D1,j) <= len UVg(D2) by INTEGRA1:def 7;
A133: indx(D2,D1,j) in Seg len UVg(D2) by A130,INTEGRA1:def 7;
A134: indx(D2,D1,j1) < indx(D2,D1,j) by A68,NAT_1:38;
      indx(D2,D1,j1) in Seg len D2 by A17,FINSEQ_1:def 3;
    then indx(D2,D1,j1) in Seg len UVg(D2) by INTEGRA1:def 7;
    then PUg(D2,indx(D2,D1,j1))
    =Sum(UVg(D2)|indx(D2,D1,j1)) by INTEGRA1:def 22;
    then PUg(D2,indx(D2,D1,j1))
    +Sum mid(upper_volume(g,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))
    =Sum(UVg(D2)|indx(D2,D1,j1)
    ^mid(UVg(D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))) by RVSUM_1:105
    .=Sum(mid(UVg(D2),1,indx(D2,D1,j1))
     ^mid(UVg(D2),indx(D2,D1,j1)+1,indx(D2,D1,j))) by A17,JORDAN3:25
    .=Sum(mid(UVg(D2),1,indx(D2,D1,j))) by A17,A132,A134,INTEGRA2:4
    .=Sum(UVg(D2)|indx(D2,D1,j)) by A131,JORDAN3:25;
    hence thesis by A133,INTEGRA1:def 22;
   end;

 PUg(D1,j1)+Sum mid(upper_volume(g,D1),j,j)=PUg(D1,j)
   proof
A135: 1 <= j & j <= len UVg(D1) by A4,FINSEQ_1:3,INTEGRA1:def 7;
A136: j in Seg len UVg(D1) by A4,INTEGRA1:def 7;
A137: j1+1=j by XCMPLX_1:27;
      j < j+1 by NAT_1:38;
then A138: j1 < j by REAL_1:84;
      j1 in Seg len D1 by A16,FINSEQ_1:def 3;
    then j1 in Seg len UVg(D1) by INTEGRA1:def 7;
    then PUg(D1,j1)=Sum(UVg(D1)|j1) by INTEGRA1:def 22;
    then PUg(D1,j1)+Sum mid(UVg(D1),j,j)
     =Sum((UVg(D1)|j1)^mid(UVg(D1),j,j)) by RVSUM_1:105
    .=Sum(mid(UVg(D1),1,j1)^mid(UVg(D1),j1+1,j)) by A19,A137,JORDAN3:25
    .=Sum(mid(UVg(D1),1,j)) by A19,A135,A138,INTEGRA2:4
    .=Sum(UVg(D1)|j) by A135,JORDAN3:25;
    hence thesis by A136,INTEGRA1:def 22;
   end;

then A139:PUg(D1,j)-PUg(D2,indx(D2,D1,j))
    =(PUg(D1,j1)-PUg(D2,indx(D2,D1,j1)))
     +(Sum mid(upper_volume(g,D1),j,j)
     -Sum mid(upper_volume(g,D2),(indx(D2,D1,j1)+1),indx(D2,D1,len D1)))
       by A129,Lm5
   .=0+(Sum mid(upper_volume(g,D1),j,j)-
     Sum mid(upper_volume(g,D2),(indx(D2,D1,j1)+1),indx(D2,D1,len D1)))
   by A67,XCMPLX_1:14;
A140:PUg(D2,indx(D2,D1,j))=Sum(upper_volume(g,D2)|indx(D2,D1,j))
   by A14,INTEGRA1:def 22
   .=Sum upper_volume(g,D2) by A10,TOPREAL1:2;
     PUg(D1,j)=Sum(upper_volume(g,D1)|j) by A15,INTEGRA1:def 22
   .=Sum upper_volume(g,D1) by A15,TOPREAL1:2;
   hence thesis by A69,A139,A140;
end;

Lm10:
for A be closed-interval Subset of REAL, f be PartFunc of A,REAL
st vol(A)<>0 & y in rng lower_sum_set(f) holds ex D being Element of divs A st
D in dom lower_sum_set(f) & y=(lower_sum_set(f)).D & D.1 > inf A
proof
   let A be closed-interval Subset of REAL;
   let f be PartFunc of A,REAL;
   assume A1:vol(A)<>0;
   assume y in rng lower_sum_set(f);
   then consider D3 being Element of divs A such that
A2:D3 in dom lower_sum_set(f) & y=(lower_sum_set(f)).D3 by PARTFUN1:26;
     len D3 <> 0 by FINSEQ_1:25;
then A3:len D3 in Seg len D3 by FINSEQ_1:5;
   then 1 <= len D3 by FINSEQ_1:3;
then A4:1 in Seg len D3 by FINSEQ_1:3;
     rng D3 <> {};
then A5:1 in dom D3 by FINSEQ_3:34;
     now per cases;
    suppose A6:D3.1 <> inf A;
         D3.1 in A by A5,INTEGRA1:8;
       then inf A <= D3.1 by INTEGRA2:1;
       then D3.1 > inf A by A6,REAL_1:def 5;
       hence ex D being Element of divs A st D in dom lower_sum_set(f) &
       y=(lower_sum_set(f)).D & D.1 > inf A by A2;
       suppose A7:D3.1 = inf A;
         ex D being Element of divs A st D in dom lower_sum_set(f) &
       y=(lower_sum_set(f)).D & D.1 > inf A
       proof
A8:     D3.(len D3) = sup A by INTEGRA1:def 2;
A9:    len D3 in dom D3 by A3,FINSEQ_1:def 3;
          vol(A) >= 0 by INTEGRA1:11;
        then sup A - inf A > 0 by A1,INTEGRA1:def 6;
        then sup A > inf A by REAL_2:106;
then A10:    len D3 > 1 by A5,A7,A8,A9,GOBOARD2:18;
        then reconsider D=D3/^1 as increasing FinSequence of REAL by INTEGRA1:
36;
A11:    len D = len D3 - 1 & for m be Nat st m in dom D holds D.m = D3.(m+1)
        by A10,RFINSEQ:def 2;
        then len D <> 0 by A10,SQUARE_1:11;
       then reconsider D as non empty increasing FinSequence of REAL by
FINSEQ_1:25;
          rng D c= rng D3 & rng D3 c= A by FINSEQ_5:36,INTEGRA1:def 2;
then A12:    rng D c= A by XBOOLE_1:1;
A13:    len D+1=len D3 by A11,XCMPLX_1:27;
          len D in dom D by SCMFSA_7:12;
        then D.(len D)=sup A by A8,A10,A13,RFINSEQ:def 2;
        then D is DivisionPoint of A by A12,INTEGRA1:def 2;
        then reconsider D as Element of divs A by INTEGRA1:def 4;
          D in divs A;
then A14:     D in dom lower_sum_set(f) by INTEGRA1:def 12;
A15:     y=(lower_sum_set(f)).D
        proof
A16:     y=lower_sum(f,D3) by A2,INTEGRA1:def 12
         .=Sum(lower_volume(f,D3)) by INTEGRA1:def 10
         .=Sum((lower_volume(f,D3)|1)^(lower_volume(f,D3)/^1)) by RFINSEQ:21;
A17:     lower_volume(f,D3)|1 = <*lower_volume(f,D3).1*>
         proof
A18:      1 <= len lower_volume(f,D3) by A10,INTEGRA1:def 8;
then A19:      len (lower_volume(f,D3)|1)=1 by TOPREAL1:3;
A20:      1 in dom lower_volume(f,D3) by A18,FINSEQ_3:27;
            1 in Seg 1 by FINSEQ_1:3;
          then (lower_volume(f,D3)|1).1 = lower_volume(f,D3).1 by A20,RFINSEQ:
19;
          hence thesis by A19,FINSEQ_1:57;
         end;
A21:      vol(divset(D3,1))=sup divset(D3,1)-inf divset(D3,1) by INTEGRA1:def 6
          .=sup divset(D3,1) - inf A by A5,INTEGRA1:def 5
          .=D3.1 - inf A by A5,INTEGRA1:def 5
          .=0 by A7,XCMPLX_1:14;
          A22: lower_volume(f,D3).1=(inf rng(f|divset(D3,1)))*vol(divset(D3,1))
          by A4,INTEGRA1:def 8;
           lower_volume(f,D3)/^1 = lower_volume(f,D)
         proof
A23:      2-'1=2-1 by SCMFSA_7:3 .= 1;
A24:      len D3 >= 1+1 by A10,NAT_1:38;
          then len lower_volume(f,D3) >= 2 by INTEGRA1:def 8;
then A25:      mid(lower_volume(f,D3),2,len lower_volume(f,D3))
           =lower_volume(f,D3)/^1 by A23,JORDAN3:26;
A26:      2 <= len lower_volume(f,D3) & 1 <= len lower_volume(f,D3)
          by A10,A24,INTEGRA1:def 8;
A27:      len(mid(lower_volume(f,D3),2,len lower_volume(f,D3)))
          =len lower_volume(f,D)
          proof
             len(mid(lower_volume(f,D3),2,len lower_volume(f,D3)))
           =len lower_volume(f,D3)-'2+1 by A26,JORDAN3:27
           .=len D3-'2+1 by INTEGRA1:def 8
           .=len D3-2+1 by A24,SCMFSA_7:3
           .=len D3-(2-1) by XCMPLX_1:37
           .=len D3-1;
           hence thesis by A11,INTEGRA1:def 8;
          end;
            for i st 1<=i&i<=len mid(lower_volume(f,D3),2,len lower_volume(f,D3
)
)
          holds mid(lower_volume(f,D3),2,len lower_volume(f,D3)).i
          =lower_volume(f,D).i
          proof
           let i; assume
           A28: 1<=i&i<=len mid(lower_volume(f,D3),2,len lower_volume(f,D3));
then A29:       1 <= i & i <= len D by A27,INTEGRA1:def 8;
           then 1<=i & i<=len lower_volume(f,D3) - 1 by A11,INTEGRA1:def 8;
           then 1 <= i & i <= len lower_volume(f,D3)-2+1 by Lm2,XCMPLX_1:37;
then A30:       mid(lower_volume(f,D3),2,len lower_volume(f,D3)).i
           =lower_volume(f,D3).(i+2-1) by A26,JORDAN3:31
           .=lower_volume(f,D3).(i+(2-1)) by XCMPLX_1:29
           .=lower_volume(f,D3).(i+1);
             1 <= i+1 & i+1 <= len D3 by A11,A29,NAT_1:37,REAL_1:84;
then A31:       i+1 in Seg len D3 by FINSEQ_1:3;
then A32:       mid(lower_volume(f,D3),2,len lower_volume(f,D3)).i
           =(inf rng(f|divset(D3,i+1)))*vol(divset(D3,i+1))
           by A30,INTEGRA1:def 8;
           A33: divset(D3,i+1)=divset(D,i)
           proof
A34:        1<>i+1 by A28,NAT_1:38;
              i+1 in dom D3 by A31,FINSEQ_1:def 3;
            then A35: sup divset(D3,i+1)=D3.(i+1) & inf divset(D3,i+1)=D3.(i+1-
1)
            by A34,INTEGRA1:def 5;
then A36:        sup divset(D3,i+1)=D3.(i+1) & inf divset(D3,i+1)=D3.i by
XCMPLX_1:26;
A37:        i in dom D by A29,FINSEQ_3:27;
then A38:        D.i=D3.(i+1) by A10,RFINSEQ:def 2;
            per cases;
             suppose A39:i=1;
then A40:         inf divset(D,i)=inf A & sup divset(D,i)=D.i
             by A37,INTEGRA1:def 5;
               divset(D3,i+1)=[.inf A, D.i.] by A7,A35,A38,A39,INTEGRA1:5;
             hence thesis by A40,INTEGRA1:5;
             suppose A41:i<>1;
then A42:         inf divset(D,i)=D.(i-1) & sup divset(D,i)=D.i
             by A37,INTEGRA1:def 5;
               i-1 in dom D & i-1 in NAT by A37,A41,INTEGRA1:9;
then D.(i-1)=D3.(i-1+1) by A10,RFINSEQ:def 2
             .= D3.(i-(1-1)) by XCMPLX_1:37
             .=D3.i;
             then divset(D3,i+1)=[.inf divset(D,i),sup divset(D,i).]
               by A36,A38,A42,INTEGRA1:5;
             hence thesis by INTEGRA1:5;
           end;
             i in Seg len D by A29,FINSEQ_1:3;
           hence thesis by A32,A33,INTEGRA1:def 8;
          end;
          hence thesis by A25,A27,FINSEQ_1:18;
         end;
         then y=0+Sum(lower_volume(f,D)) by A16,A17,A21,A22,RVSUM_1:106
         .=lower_sum(f,D) by INTEGRA1:def 10;
         hence thesis by A14,INTEGRA1:def 12;
        end;
          rng D <> {};
        then 1 in dom D by FINSEQ_3:34;
then A43:    D.1=D3.(1+1) by A10,RFINSEQ:def 2 .=D3.2;
          1+1 <= len D3 by A10,NAT_1:38;
        then 2 in dom D3 by FINSEQ_3:27;
        then D3.1 < D3.2 by A5,GOBOARD1:def 1;
        hence thesis by A7,A14,A15,A43;
       end;
       hence thesis;
      end;
      hence thesis;
     end;

theorem Th11:
for A be closed-interval Subset of REAL, D be Element of divs A,
r be Real, i,j be Nat st i in dom D & j in dom D & i<=j & r < mid(D,i,j).1
holds ex B be closed-interval Subset of REAL
st r=inf B & sup B=mid(D,i,j).(len mid(D,i,j))
& len mid(D,i,j)=j-i+1 & mid(D,i,j) is DivisionPoint of B
proof
   let A be closed-interval Subset of REAL;
   let D be Element of divs A;
   let r be Real;
   let i,j be Nat;
   assume A1:i in dom D;
   assume A2:j in dom D;
   assume A3:i <= j;
   assume A4:r < mid(D,i,j).1;
   consider C being closed-interval Subset of REAL such that
A5:inf C=mid(D,i,j).1 & sup C=mid(D,i,j).(len mid(D,i,j))
   & len mid(D,i,j)=j-i+1 & mid(D,i,j) is DivisionPoint of C
   by A1,A2,A3,INTEGRA1:38;
   consider a,b such that
A6:a <= b & a = inf C & b = sup C by INTEGRA1:4;
     r <= sup C by A4,A5,A6,AXIOMS:22;
  then reconsider B=[.r,sup C.] as closed-interval Subset of REAL by INTEGRA1:
def 1;
   reconsider MD=mid(D,i,j) as non empty increasing FinSequence of REAL by A5;
     B=[.inf B,sup B.] by INTEGRA1:5;
then A7:inf B = r & sup B = sup C by INTEGRA1:6;
A8:rng mid(D,i,j) c= C&mid(D,i,j).(len mid(D,i,j))=sup C by A5,INTEGRA1:def 2;
     x in C implies x in B
   proof
    assume x in C;
    then inf C <= x & x <= sup C by INTEGRA2:1;
    then r <= x & x <= sup C by A4,A5,AXIOMS:22;
    hence thesis by A7,INTEGRA2:1;
   end;
   then C c= B by SUBSET_1:7;
   then rng mid(D,i,j) c= B by A8,XBOOLE_1:1;
   then MD is DivisionPoint of B by A5,A7,INTEGRA1:def 2;
   hence thesis by A5,A7;
end;

Lm11:for A be closed-interval Subset of REAL,
        D1 be Element of divs A st vol(A)<>0 & len D1 = 1 holds
    <*inf A*>^D1 is non empty increasing FinSequence of REAL
proof
  let A be closed-interval Subset of REAL,
      D1 be Element of divs A;
  assume A1:vol(A)<>0;
  assume len D1 = 1;
then A2: D1.1=sup A by INTEGRA1:def 2;
      vol(A) >= 0 by INTEGRA1:11;
    then D1.1 - inf A > 0 by A1,A2,INTEGRA1:def 6;
then A3:inf A < D1.1 by REAL_2:106;
    set MD1 = <*inf A*>^D1;
A4:len MD1 = len <*inf A*> + len D1 by FINSEQ_1:35;
      len <*inf A*> = 1 by FINSEQ_1:56;
then A5: len MD1 <> 0 by A4,NAT_1:21;
      n in dom MD1 & m in dom MD1 & n<m implies MD1.n < MD1.m
    proof
     assume A6:n in dom MD1 & m in dom MD1 & n<m;
A7: not m in dom <*inf A*>
     proof
      assume m in dom <*inf A*>;
      then m in Seg len <*inf A*> by FINSEQ_1:def 3;
      then m in {1} by FINSEQ_1:4,56;
then A8:   n < 1 by A6,TARSKI:def 1;
        n in Seg len MD1 by A6,FINSEQ_1:def 3;
      hence contradiction by A8,FINSEQ_1:3;
     end;
       MD1.m in rng MD1 by A6,FUNCT_1:def 5;
then A9:  MD1.m in rng <*inf A*> \/ rng D1 by FINSEQ_1:44;
       not(MD1.m in rng <*inf A*>)
     proof
      assume MD1.m in rng <*inf A*>;
      then MD1.m in {inf A} by FINSEQ_1:55;
then A10:  MD1.m = inf A by TARSKI:def 1;
      consider n such that
A11:  n in dom D1 & m=len <*inf A*>+n by A6,A7,FINSEQ_1:38;
        n in Seg len D1 by A11,FINSEQ_1:def 3;
then A12:  1 <= n & n <= len D1 by FINSEQ_1:3;
        rng D1 <> {};
then A13:  1 in dom D1 by FINSEQ_3:34;
        D1.n=MD1.m by A11,FINSEQ_1:def 7;
      hence contradiction by A3,A10,A11,A12,A13,GOBOARD2:18;
     end;
then A14: MD1.m in rng D1 by A9,XBOOLE_0:def 2;
       now per cases by A6,FINSEQ_1:38;
      suppose A15:n in dom <*inf A*>;
      then n in Seg len <*inf A*> by FINSEQ_1:def 3;
      then n in {1} by FINSEQ_1:4,56;
then A16:  n = 1 by TARSKI:def 1;
      consider k such that
A17:  k in dom D1 & MD1.m = D1.k by A14,PARTFUN1:26;
A18:  1 <= k & k <= len D1 by A17,FINSEQ_3:27;
        rng D1 <> {};
      then 1 in dom D1 by FINSEQ_3:34;
then A19:  D1.1 <= MD1.m by A17,A18,GOBOARD2:18;
        MD1.n = <*inf A*>.n by A15,FINSEQ_1:def 7 .= inf A by A16,FINSEQ_1:def
8
;
      hence MD1.n < MD1.m by A3,A19,AXIOMS:22;
      suppose ex i st i in dom D1 & n = len <*inf A*> + i;
      then consider i such that
A20:  i in dom D1 & n=len <*inf A*> + i;
      consider j such that
A21:  j in dom D1 & m=len <*inf A*> + j by A6,A7,FINSEQ_1:38;
A22:  i < j by A6,A20,A21,AXIOMS:24;
A23:  D1.i=MD1.n by A20,FINSEQ_1:def 7;
        D1.j=MD1.m by A21,FINSEQ_1:def 7;
      hence thesis by A20,A21,A22,A23,GOBOARD1:def 1;
     end;
     hence thesis;
    end;
    hence thesis by A5,FINSEQ_1:25,GOBOARD1:def 1;
end;

Lm12:for A be closed-interval Subset of REAL,
        D2 be Element of divs A st inf A < D2.1 holds
    <*inf A*>^D2 is non empty increasing FinSequence of REAL
proof
    let A be closed-interval Subset of REAL,
        D2 be Element of divs A;
    assume A1: inf A < D2.1;
    set MD2=<*inf A*>^D2;
    A2: len MD2 = 1+len D2 by FINSEQ_5:8;
      n in dom MD2 & m in dom MD2 & n<m implies MD2.n < MD2.m
    proof
     assume A3:n in dom MD2 & m in dom MD2 & n<m;
A4: not m in dom <*inf A*>
     proof
      assume m in dom <*inf A*>;
      then m in Seg len <*inf A*> by FINSEQ_1:def 3;
      then m in {1} by FINSEQ_1:4,56;
then A5:  n < 1 by A3,TARSKI:def 1;
        n in Seg len MD2 by A3,FINSEQ_1:def 3;
      hence contradiction by A5,FINSEQ_1:3;
     end;
       MD2.m in rng MD2 by A3,FUNCT_1:def 5;
     then MD2.m in rng <*inf A*> \/ rng D2 by FINSEQ_1:44;
then A6: MD2.m in rng <*inf A*> or MD2.m in rng D2 by XBOOLE_0:def 2;
A7: not MD2.m in rng <*inf A*>
     proof
      assume MD2.m in rng <*inf A*>;
      then MD2.m in {inf A} by FINSEQ_1:55;
then A8:  MD2.m = inf A by TARSKI:def 1;
      consider n such that
A9:  n in dom D2 & m=len <*inf A*>+n by A3,A4,FINSEQ_1:38;
        n in Seg len D2 by A9,FINSEQ_1:def 3;
then A10:  1 <= n & n <= len D2 by FINSEQ_1:3;
        rng D2 <> {};
then A11:  1 in dom D2 by FINSEQ_3:34;
        D2.n=MD2.m by A9,FINSEQ_1:def 7;
      hence contradiction by A1,A8,A9,A10,A11,GOBOARD2:18;
     end;
       now per cases by A3,FINSEQ_1:38;
      suppose A12:n in dom <*inf A*>;
      then n in Seg len <*inf A*> by FINSEQ_1:def 3;
      then n in {1} by FINSEQ_1:4,56;
then A13:  n = 1 by TARSKI:def 1;
      consider k such that
A14:  k in dom D2 & MD2.m = D2.k by A6,A7,PARTFUN1:26;
        k in Seg len D2 by A14,FINSEQ_1:def 3;
then A15:  1 <= k & k <= len D2 by FINSEQ_1:3;
        rng D2 <> {};
      then 1 in dom D2 by FINSEQ_3:34;
then A16:  D2.1 <= MD2.m by A14,A15,GOBOARD2:18;
        MD2.n = <*inf A*>.n by A12,FINSEQ_1:def 7 .= inf A by A13,FINSEQ_1:def
8
;
      hence MD2.n < MD2.m by A1,A16,AXIOMS:22;
      suppose ex i st i in dom D2 & n = len <*inf A*> + i;
      then consider i such that
A17:  i in dom D2 & n=len <*inf A*> + i;
      consider j such that
A18:  j in dom D2 & m=len <*inf A*> + j by A3,A4,FINSEQ_1:38;
A19:  i < j by A3,A17,A18,AXIOMS:24;
A20:  D2.i=MD2.n by A17,FINSEQ_1:def 7;
        D2.j=MD2.m by A18,FINSEQ_1:def 7;
      hence thesis by A17,A18,A19,A20,GOBOARD1:def 1;
     end;
     hence thesis;
    end;
    hence thesis by A2,FINSEQ_1:25,GOBOARD1:def 1;
end;

Lm13:for A be closed-interval Subset of REAL,
        f being PartFunc of A,REAL,
        D1, MD1 being Element of divs A
  st MD1 = <*inf A*>^D1 holds
  (for i st i in Seg len D1 holds divset(MD1,i+1)=divset(D1,i)) &
  upper_volume(f,D1)=upper_volume(f,MD1)/^1 &
  lower_volume(f,D1)=lower_volume(f,MD1)/^1
proof
    let A be closed-interval Subset of REAL,
        f being PartFunc of A,REAL,
        D1, MD1 being Element of divs A;
    assume A1:MD1 = <*inf A*>^D1;
then A2: len MD1=len <*inf A*> + len D1 by FINSEQ_1:35
           .= 1+len D1 by FINSEQ_1:56;
    thus A3:for i st i in Seg len D1 holds divset(MD1,i+1)=divset(D1,i)
    proof
     let i;
     assume A4:i in Seg len D1;
then A5:  1 <= i & i <= len D1 by FINSEQ_1:3;
A6:  i in dom D1 by A4,FINSEQ_1:def 3;
A7:  1 <= i+1 by NAT_1:29;
       i+1 <= len D1+1 by A5,AXIOMS:24;
     then i+1 <= len D1 + len<*inf A*> by FINSEQ_1:56;
     then i+1 <= len MD1 by A1,FINSEQ_1:35;
then A8:  i+1 in dom MD1 by A7,FINSEQ_3:27;
A9:  divset(D1,i)=[.inf divset(D1,i), sup divset(D1,i).] by INTEGRA1:5;
       inf divset(D1,i)=inf divset(MD1,i+1)
     & sup divset(D1,i)=sup divset(MD1,i+1)
     proof
      per cases;
       suppose A10:i=1;
         i+1 > 1 by A5,NAT_1:38;
then A11:   inf divset(MD1,i+1)=MD1.(i+1-1) & sup divset(MD1,i+1)=MD1.(i+1)
       by A8,INTEGRA1:def 5;
then A12:   inf divset(MD1,i+1) = inf A by A1,A10,FINSEQ_1:58;
         MD1.(i+1) = MD1.(i+len <*inf A*>) by FINSEQ_1:57
       .= D1.i by A1,A6,FINSEQ_1:def 7;
       hence thesis by A6,A10,A11,A12,INTEGRA1:def 5;
       suppose A13:i<>1;
A14:   i+1 > 1 by A5,NAT_1:38;
         i-1 in dom D1 & i-1 in NAT by A6,A13,INTEGRA1:9;
       then D1.(i-1) = MD1.(i-1+len <*inf A*>) by A1,FINSEQ_1:def 7
       .=MD1.(i-1+1) by FINSEQ_1:56 .=MD1.(i-(1-1)) by XCMPLX_1:37
       .=MD1.(i+1-1) by XCMPLX_1:26;
then A15:   inf divset(D1,i)=MD1.(i+1-1) by A6,A13,INTEGRA1:def 5
       .=inf divset(MD1,i+1) by A8,A14,INTEGRA1:def 5;
         MD1.(i+1) = MD1.(i+len <*inf A*>) by FINSEQ_1:57
       .= D1.i by A1,A6,FINSEQ_1:def 7;
       then sup divset(MD1,i+1)=D1.i by A8,A14,INTEGRA1:def 5
       .= sup divset(D1,i) by A6,A13,INTEGRA1:def 5;
       hence thesis by A15;
     end;
     hence thesis by A9,INTEGRA1:5;
    end;
    thus upper_volume(f,D1)=upper_volume(f,MD1)/^1
    proof
      set D2 = D1, MD2 = MD1;
A16:  len upper_volume(f,D2)=len (upper_volume(f,MD2)/^1)
     proof
        rng upper_volume(f,MD2) <> {};
      then 1 in dom upper_volume(f,MD2) by FINSEQ_3:34;
      then 1 <= len upper_volume(f,MD2) by FINSEQ_3:27;
      then len (upper_volume(f,MD2)/^1)=len upper_volume(f,MD2)-1 by RFINSEQ:
def 2
      .=len MD2 -1 by INTEGRA1:def 7
      .=len D2 by A2,XCMPLX_1:26;
      hence thesis by INTEGRA1:def 7;
     end;
       1 <= k & k <= len upper_volume(f,D2) implies
     upper_volume(f,D2).k = (upper_volume(f,MD2)/^1).k
     proof
      assume A17:1 <= k & k <= len upper_volume(f,D2);
      then k in Seg len upper_volume(f,D2) by FINSEQ_1:3;
then A18:   k in Seg len D2 by INTEGRA1:def 7;
then A19:   upper_volume(f,D2).k=(sup rng(f|divset(D2,k)))*vol(divset(D2,k))
      by INTEGRA1:def 7 .=(sup rng(f|divset(MD2,k+1)))*vol(divset(D2,k))
      by A3,A18 .=(sup rng(f|divset(MD2,k+1)))*vol(divset(MD2,k+1)) by A3,A18;
A20:  1 <= k+1 by NAT_1:29;
        k+1 <= len upper_volume(f,D2)+1 by A17,AXIOMS:24;
      then k+1 <= len D2+1 by INTEGRA1:def 7;
then A21:   k+1 in Seg len MD2 by A2,A20,FINSEQ_1:3;
A22:   k in dom (upper_volume(f,MD2)/^1) by A16,A17,FINSEQ_3:27;
A23:   len (upper_volume(f,MD2)/^1) <= len upper_volume(f,MD2) by FINSEQ_5:28;
        1 <= len upper_volume(f,D2) by A17,AXIOMS:22;
      then 1 <= len upper_volume(f,MD2) by A16,A23,AXIOMS:22;
      then (upper_volume(f,MD2)/^1).k=upper_volume(f,MD2).(k+1) by A22,RFINSEQ:
def 2
      .=(sup rng(f|divset(MD2,k+1)))*vol(divset(MD2,k+1))
      by A21,INTEGRA1:def 7;
      hence thesis by A19;
     end;
     hence thesis by A16,FINSEQ_1:18;
    end;
A24:  len lower_volume(f,D1)=len (lower_volume(f,MD1)/^1)
     proof
        rng lower_volume(f,MD1) <> {};
      then 1 in dom lower_volume(f,MD1) by FINSEQ_3:34;
      then 1 <= len lower_volume(f,MD1) by FINSEQ_3:27;
      then len (lower_volume(f,MD1)/^1)=len lower_volume(f,MD1)-1 by RFINSEQ:
def 2
      .=len MD1 -1 by INTEGRA1:def 8
      .=len D1 by A2,XCMPLX_1:26;
      hence thesis by INTEGRA1:def 8;
     end;
       1 <= k & k <= len lower_volume(f,D1) implies
     lower_volume(f,D1).k = (lower_volume(f,MD1)/^1).k
     proof
      assume A25:1 <= k & k <= len lower_volume(f,D1);
      then k in Seg len lower_volume(f,D1) by FINSEQ_1:3;
then A26:   k in Seg len D1 by INTEGRA1:def 8;
then A27:   lower_volume(f,D1).k=(inf rng(f|divset(D1,k)))*vol(divset(D1,k))
      by INTEGRA1:def 8 .=(inf rng(f|divset(MD1,k+1)))*vol(divset(D1,k))
      by A3,A26
      .=(inf rng(f|divset(MD1,k+1)))*vol(divset(MD1,k+1)) by A3,A26;
A28:  1 <= k+1 by NAT_1:29;
A29:   len MD1=len <*inf A*>+len D1 by A1,FINSEQ_1:35
              .=len D1 + 1 by FINSEQ_1:56;
        k+1 <= len lower_volume(f,D1)+1 by A25,AXIOMS:24;
      then k+1 <= len D1+1 by INTEGRA1:def 8;
then A30:   k+1 in Seg len MD1 by A28,A29,FINSEQ_1:3;
A31:   k in dom (lower_volume(f,MD1)/^1) by A24,A25,FINSEQ_3:27;
A32:   len (lower_volume(f,MD1)/^1) <= len lower_volume(f,MD1) by FINSEQ_5:28;
        1 <= len (lower_volume(f,MD1)/^1) by A24,A25,AXIOMS:22;
      then 1 <= len lower_volume(f,MD1) by A32,AXIOMS:22;
      then (lower_volume(f,MD1)/^1).k=lower_volume(f,MD1).(k+1) by A31,RFINSEQ:
def 2
      .=(inf rng(f|divset(MD1,k+1)))*vol(divset(MD1,k+1))
      by A30,INTEGRA1:def 8;
      hence thesis by A27;
     end;
     hence thesis by A24,FINSEQ_1:18;
end;

Lm14:for A be closed-interval Subset of REAL, D2, MD2 being Element of divs A
  st MD2 = <*inf A*>^D2 holds vol(divset(MD2,1))=0
    proof
     let A be closed-interval Subset of REAL, D2,MD2 be Element of divs A;
     assume A1:MD2 = <*inf A*>^D2;
       rng MD2 <> {};
     then 1 in dom MD2 by FINSEQ_3:34;
     then inf divset(MD2,1) = inf A & sup divset(MD2,1) = MD2.1 by INTEGRA1:def
5;
     then vol(divset(MD2,1)) = MD2.1 - inf A by INTEGRA1:def 6.=inf A-inf A
     by A1,FINSEQ_1:58;
     hence thesis by XCMPLX_1:14;
  end;

Lm15:
for A be closed-interval Subset of REAL, f be Function of A,REAL,
    D1,MD1 be Element of divs A st MD1 = <*inf A*>^D1 holds
     delta(MD1)=delta(D1)
    proof
     let A be closed-interval Subset of REAL, f be Function of A,REAL,
         D1,MD1 be Element of divs A;
     assume A1:MD1 = <*inf A*>^D1;
then A2: vol(divset(MD1,1))=0 by Lm14;
     A3: delta(D1)=max rng upper_volume(chi(A,A),D1) by INTEGRA1:def 19;
then delta(D1) in rng upper_volume(chi(A,A),D1)
     & for x st x in rng upper_volume(chi(A,A),D1) holds x <= delta(D1)
     by PRE_CIRC:def 1;
     then consider i such that
A4:  i in dom upper_volume(chi(A,A),D1) & upper_volume(chi(A,A),D1).i=delta(D1)
     by PARTFUN1:26;
     A5: delta(MD1)=max rng upper_volume(chi(A,A),MD1) by INTEGRA1:def 19;
then delta(MD1) in rng upper_volume(chi(A,A),MD1)
     &for x st x in rng upper_volume(chi(A,A),MD1) holds x <= delta(MD1)
     by PRE_CIRC:def 1;
     then consider j such that
A6:  j in dom upper_volume(chi(A,A),MD1)&upper_volume(chi(A,A),MD1).j=delta(MD1
)
     by PARTFUN1:26;
       i in Seg len upper_volume(chi(A,A),D1) by A4,FINSEQ_1:def 3;
then A7:  i in Seg len D1 by INTEGRA1:def 7;
then A8:  delta(D1)=(sup rng (chi(A,A)|divset(D1,i)))*vol(divset(D1,i))
     by A4,INTEGRA1:def 7
     .=(sup rng(chi(A,A)|divset(MD1,i+1)))*vol(divset(D1,i)) by A1,A7,Lm13
     .=(sup rng (chi(A,A)|divset(MD1,i+1)))*vol(divset(MD1,i+1)) by A1,A7,Lm13;
       i in dom D1 by A7,FINSEQ_1:def 3;
     then len <*inf A*>+i in dom MD1 by A1,FINSEQ_1:41;
     then i+1 in dom MD1 by FINSEQ_1:56;
then A9:  i+1 in Seg len MD1 by FINSEQ_1:def 3;
then A10:  delta(D1)=upper_volume(chi(A,A),MD1).(i+1) by A8,INTEGRA1:def 7;
       i+1 in Seg len upper_volume(chi(A,A),MD1) by A9,INTEGRA1:def 7;
     then i+1 in dom upper_volume(chi(A,A),MD1) by FINSEQ_1:def 3;
     then delta(D1) in rng upper_volume(chi(A,A),MD1) by A10,FUNCT_1:def 5;
then A11:  delta(D1) <= delta(MD1) by A5,PRE_CIRC:def 1;
       j in Seg len upper_volume(chi(A,A),MD1) by A6,FINSEQ_1:def 3;
then A12: j in Seg len MD1 by INTEGRA1:def 7;
then A13: delta(MD1)=(sup rng(chi(A,A)|divset(MD1,j)))*vol(divset(MD1,j))
     by A6,INTEGRA1:def 7;
       delta(MD1) <= delta(D1)
     proof
      per cases;
       suppose j=1;
       hence thesis by A2,A13,Th8;
       suppose j<>1;
       then not(j in Seg 1) by FINSEQ_1:4,TARSKI:def 1;
       then not(j in Seg len <*inf A*>) by FINSEQ_1:56;
then A14:   not(j in dom <*inf A*>) by FINSEQ_1:def 3;
         j in dom MD1 by A12,FINSEQ_1:def 3;
       then consider k such that
A15:   k in dom D1 & j=len <*inf A*>+k by A1,A14,FINSEQ_1:38;
A16:   k in Seg len D1 by A15,FINSEQ_1:def 3;
       then divset(D1,k)=divset(MD1,k+1) by A1,Lm13
       .=divset(MD1,j) by A15,FINSEQ_1:56;
       then delta(MD1) = (sup rng(chi(A,A)|divset(D1,k)))*vol(divset(D1,k))
         by A6,A12,INTEGRA1:def 7;
then A17:   delta(MD1)=upper_volume(chi(A,A),D1).k by A16,INTEGRA1:def 7;
         k in Seg len upper_volume(chi(A,A),D1) by A16,INTEGRA1:def 7;
       then k in dom upper_volume(chi(A,A),D1) by FINSEQ_1:def 3;
       then delta(MD1) in rng upper_volume(chi(A,A),D1) by A17,FUNCT_1:def 5;
       hence thesis by A3,PRE_CIRC:def 1;
     end;
     hence thesis by A11,AXIOMS:21;
    end;

theorem Th12:
for A be closed-interval Subset of REAL, f be Function of A,REAL,
D1,D2 be Element of divs A st x in divset(D1,len D1) & vol(A)<>0
& D1<=D2 & rng D2 = rng D1 \/ {x} & f is_bounded_on A & x > inf A
holds Sum lower_volume(f,D2)-Sum
lower_volume(f,D1)<=(sup rng f-inf rng f)*delta(D1)
proof
   let A be closed-interval Subset of REAL;
   let f be Function of A,REAL;
   let D1,D2 be Element of divs A;
   assume that A1:x in divset(D1,len D1) and A2:vol(A)<>0 and A3:D1 <= D2
   and A4:rng D2 = rng D1 \/ {x} and A5:f is_bounded_on A
   and A6:x > inf A;
     len D1 <> 0 by FINSEQ_1:25;
   then len D1 in Seg len D1 by FINSEQ_1:5;
then A7:1 <= len D1 by FINSEQ_1:3;
   then len D1 = 1 or len D1 > 1 by REAL_1:def 5;
then A8:len D1 = 1 or len D1 >= 1+1 by NAT_1:38;
     now per cases by A8;
    suppose A9:len D1 = 1;
then A10: D1.1=sup A by INTEGRA1:def 2;
      vol(A) >= 0 by INTEGRA1:11;
    then D1.1 - inf A > 0 by A2,A10,INTEGRA1:def 6;
then A11:inf A < D1.1 by REAL_2:106;
    reconsider MD1 = <*inf A*>^D1
      as non empty increasing FinSequence of REAL by A2,A9,Lm11;
      MD1 is DivisionPoint of A
    proof
       y in rng MD1 implies y in A
     proof
      assume y in rng MD1;
then A12:   y in rng <*inf A*> \/ rng D1 by FINSEQ_1:44;
      per cases by A12,XBOOLE_0:def 2;
       suppose y in rng <*inf A*>;
       then y in {inf A} by FINSEQ_1:55;
then A13:    y = inf A by TARSKI:def 1;
       consider a,b such that
A14:    a <= b & a = inf A & b = sup A by INTEGRA1:4;
       thus thesis by A13,A14,INTEGRA2:1;
       suppose A15:y in rng D1;
         rng D1 c= A by INTEGRA1:def 2;
       hence thesis by A15;
     end;
then A16: rng MD1 c= A by SUBSET_1:7;
       MD1.(len MD1) = sup A
     proof
A17:   len MD1 = len <*inf A*> + len D1 by FINSEQ_1:35;
        len <*inf A*> + 1 <= len <*inf A*> + len D1 by A7,AXIOMS:24;
      then MD1.(len MD1)=D1.(len <*inf A*>+len D1-len <*inf A*>) by A17,
FINSEQ_1:36
      .=D1.(len D1) by XCMPLX_1:26;
      hence thesis by INTEGRA1:def 2;
     end;
     hence thesis by A16,INTEGRA1:def 2;
    end;
    then reconsider MD1 as Element of divs A by INTEGRA1:def 4;
      rng D2 <> {};
then A18: 1 in dom D2 by FINSEQ_3:34;
then A19: 1 <= len D2 by FINSEQ_3:27;
A20: D2.1 in rng D2 by A18,FUNCT_1:def 5;
A21:inf A < D2.1
    proof
     per cases by A4,A20,XBOOLE_0:def 2;
      suppose D2.1 in rng D1;
      then consider k such that
A22:  k in dom D1 & D1.k = D2.1 by PARTFUN1:26;
A23:  1 <= k & k <= len D1 by A22,FINSEQ_3:27;
        rng D1 <> {};
      then 1 in dom D1 by FINSEQ_3:34;
      then D1.1 <= D2.1 by A22,A23,GOBOARD2:18;
      hence thesis by A11,AXIOMS:22;
      suppose D2.1 in {x};
      hence thesis by A6,TARSKI:def 1;
    end;
    set MD2=<*inf A*>^D2;
    reconsider MD2 as non empty increasing FinSequence of REAL by A21,Lm12;
      MD2 is DivisionPoint of A
    proof
       y in rng MD2 implies y in A
     proof
      assume y in rng MD2;
then A24:   y in rng <*inf A*> \/ rng D2 by FINSEQ_1:44;
      per cases by A24,XBOOLE_0:def 2;
       suppose y in rng <*inf A*>;
       then y in {inf A} by FINSEQ_1:55;
then A25:    y = inf A by TARSKI:def 1;
       consider a,b such that
A26:    a <= b & a = inf A & b = sup A by INTEGRA1:4;
       thus thesis by A25,A26,INTEGRA2:1;
       suppose A27:y in rng D2;
         rng D2 c= A by INTEGRA1:def 2;
       hence thesis by A27;
     end;
then A28: rng MD2 c= A by SUBSET_1:7;
       MD2.(len MD2) = sup A
     proof
A29:  len MD2 = len <*inf A*> + len D2 by FINSEQ_1:35;
        len <*inf A*> + 1 <= len <*inf A*> + len D2 by A19,AXIOMS:24;
      then MD2.(len MD2)=D2.(len <*inf A*>+len D2-len <*inf A*>) by A29,
FINSEQ_1:36
      .=D2.(len D2) by XCMPLX_1:26;
      hence thesis by INTEGRA1:def 2;
     end;
     hence thesis by A28,INTEGRA1:def 2;
    end;
    then reconsider MD2 as Element of divs A by INTEGRA1:def 4;
A30: len MD1=len <*inf A*> + len D1 by FINSEQ_1:35 .= 1+len D1 by FINSEQ_1:56;
A31: 1+len D1 >= 1+1 by A7,AXIOMS:24;
A32: x in divset(MD1,len MD1)
    proof
A33: inf divset(D1,len D1) <= x & x <= sup divset(D1,len D1) by A1,INTEGRA2:1;
A34: len D1 in dom D1 by SCMFSA_7:12;
A35: len MD1 in dom MD1 by SCMFSA_7:12;
A36: len MD1 <> 1 by A30,A31;
       len MD1 - 1 =len D1 by A30,XCMPLX_1:26;
     then inf divset(MD1,len MD1) = MD1.(len D1) by A35,A36,INTEGRA1:def 5
     .=inf A by A9,FINSEQ_1:58;
then A37: inf divset(D1,len D1) = inf divset(MD1,len MD1) by A9,A34,INTEGRA1:
def 5;
       MD1.(len MD1) = MD1.(len <*inf A*> + len D1) by FINSEQ_1:35
     .=D1.(len D1) by A34,FINSEQ_1:def 7;
     then sup divset(MD1,len MD1)=D1.(len D1) by A35,A36,INTEGRA1:def 5
     .= sup divset(D1,len D1)
     by A9,A34,INTEGRA1:def 5;
     hence thesis by A33,A37,INTEGRA2:1;
    end;
A38:MD1<=MD2
    proof
A39: len D1 <= len D2 & rng D1 c= rng D2 by A3,INTEGRA1:def 20;
     then len D1+len <*inf A*> <= len D2+len <*inf A*> by AXIOMS:24;
     then len MD1 <= len D2+len <*inf A*> by FINSEQ_1:35;
then A40: len MD1 <= len MD2 by FINSEQ_1:35;
       rng D1 \/ rng<*inf A*> c= rng D2 \/ rng <*inf A*> by A39,XBOOLE_1:9;
     then rng MD1 c= rng D2 \/ rng <*inf A*> by FINSEQ_1:44;
     then rng MD1 c= rng MD2 by FINSEQ_1:44;
     hence thesis by A40,INTEGRA1:def 20;
    end;
      rng MD2 = rng D2 \/ rng <*inf A*> by FINSEQ_1:44
     .=rng D1 \/ rng <*inf A*> \/ {x} by A4,XBOOLE_1:4;
    then rng MD2 = rng MD1 \/ {x} by FINSEQ_1:44;
then A41:Sum lower_volume(f,MD2)-Sum
    lower_volume(f,MD1)<=(sup rng f-inf rng f)*delta(MD1)
    by A5,A30,A31,A32,A38,Th9;
A42:vol(divset(MD1,1))=0 by Lm14;
      lower_volume(f,D1)=lower_volume(f,MD1)/^1 by Lm13;
    then lower_volume(f,MD1)=<*(lower_volume(f,MD1))/.1*>^lower_volume(f,D1)
    by FINSEQ_5:32;
then A43:Sum lower_volume(f,MD1)=((lower_volume(f,MD1))/.1)+Sum lower_volume(f,
D1)
    by RVSUM_1:106;
      rng MD1 <> {};
    then 1 in dom MD1 by FINSEQ_3:34;
then A44:1 in Seg len MD1 by FINSEQ_1:def 3;
then A45:lower_volume(f,MD1).1 = (inf rng(f|divset(MD1,1)))*vol(divset(MD1,1))
    by INTEGRA1:def 8;
      1 in Seg len lower_volume(f,MD1) by A44,INTEGRA1:def 8;
    then 1 in dom lower_volume(f,MD1) by FINSEQ_1:def 3;
    then A46: lower_volume(f,MD1)/.1 = 0 by A42,A45,FINSEQ_4:def 4;
A47:vol(divset(MD2,1))=0 by Lm14;
      lower_volume(f,D2)=lower_volume(f,MD2)/^1 by Lm13;
    then lower_volume(f,MD2)=<*(lower_volume(f,MD2))/.1*>^lower_volume(f,D2)
    by FINSEQ_5:32;
then A48:Sum lower_volume(f,MD2)=(lower_volume(f,MD2))/.1+Sum lower_volume(f,D2
)
    by RVSUM_1:106;
      rng MD2 <> {};
    then 1 in dom MD2 by FINSEQ_3:34;
then A49:1 in Seg len MD2 by FINSEQ_1:def 3;
    then A50: lower_volume(f,MD2).1 = (inf rng(f|divset(MD2,1)))*vol(divset(MD2
,1))
    by INTEGRA1:def 8;
      1 in Seg len lower_volume(f,MD2) by A49,INTEGRA1:def 8;
    then 1 in dom lower_volume(f,MD2) by FINSEQ_1:def 3;
    then lower_volume(f,MD2)/.1 = 0 by A47,A50,FINSEQ_4:def 4;
    hence Sum lower_volume(f,D2)-Sum lower_volume(f,D1)<=
    (sup rng f-inf rng f)*delta(D1) by A41,A43,A46,A48,Lm15;
    suppose len D1 >= 2;
    hence thesis by A1,A3,A4,A5,Th9;
   end;
   hence thesis;
end;

theorem Th13:
for A be closed-interval Subset of REAL, f be Function of A,REAL,
D1,D2 be Element of divs A st x in divset(D1,len D1) & vol(A)<>0
& D1<=D2 & rng D2 = rng D1 \/ {x} & f is_bounded_on A & x > inf A
holds Sum upper_volume(f,D1)-Sum
upper_volume(f,D2)<=(sup rng f-inf rng f)*delta(D1)
proof
   let A be closed-interval Subset of REAL;
   let f be Function of A,REAL;
   let D1,D2 be Element of divs A;
   assume that A1:x in divset(D1,len D1) and A2:vol(A)<>0 and A3:D1 <= D2
   and A4:rng D2 = rng D1 \/ {x} and A5:f is_bounded_on A
   and A6:x > inf A;
     len D1 <> 0 by FINSEQ_1:25;
   then len D1 in Seg len D1 by FINSEQ_1:5;
then A7:1 <= len D1 by FINSEQ_1:3;
   then len D1 = 1 or len D1 > 1 by REAL_1:def 5;
then A8:len D1 = 1 or len D1 >= 1+1 by NAT_1:38;
     now per cases by A8;
    suppose A9:len D1 = 1;
then A10: D1.1=sup A by INTEGRA1:def 2;
      vol(A) >= 0 by INTEGRA1:11;
    then D1.1 - inf A > 0 by A2,A10,INTEGRA1:def 6;
then A11:inf A < D1.1 by REAL_2:106;
    reconsider MD1 = <*inf A*>^D1 as non empty increasing FinSequence of REAL
      by A2,A9,Lm11;
      MD1 is DivisionPoint of A
    proof
       y in rng MD1 implies y in A
     proof
      assume y in rng MD1;
then A12:   y in rng <*inf A*> \/ rng D1 by FINSEQ_1:44;
      per cases by A12,XBOOLE_0:def 2;
       suppose y in rng <*inf A*>;
       then y in {inf A} by FINSEQ_1:55;
then A13:    y = inf A by TARSKI:def 1;
       consider a,b such that
A14:    a <= b & a = inf A & b = sup A by INTEGRA1:4;
       thus thesis by A13,A14,INTEGRA2:1;
       suppose A15:y in rng D1;
         rng D1 c= A by INTEGRA1:def 2;
       hence thesis by A15;
     end;
then A16: rng MD1 c= A by SUBSET_1:7;
       MD1.(len MD1) = sup A
     proof
A17:   len MD1 = len <*inf A*> + len D1 by FINSEQ_1:35;
        len <*inf A*> + 1 <= len <*inf A*> + len D1 by A7,AXIOMS:24;
      then MD1.(len MD1)=D1.(len <*inf A*>+len D1-len <*inf A*>) by A17,
FINSEQ_1:36
      .=D1.(len D1) by XCMPLX_1:26;
      hence thesis by INTEGRA1:def 2;
     end;
     hence thesis by A16,INTEGRA1:def 2;
    end;
    then reconsider MD1 as Element of divs A by INTEGRA1:def 4;
      rng D2 <> {};
then A18: 1 in dom D2 by FINSEQ_3:34;
then A19: 1 <= len D2 by FINSEQ_3:27;
A20:D2.1 in rng D2 by A18,FUNCT_1:def 5;
A21:inf A < D2.1
    proof
     per cases by A4,A20,XBOOLE_0:def 2;
      suppose D2.1 in rng D1;
      then consider k such that
A22:   k in dom D1 & D1.k = D2.1 by PARTFUN1:26;
A23:   1 <= k & k <= len D1 by A22,FINSEQ_3:27;
        rng D1 <> {};
      then 1 in dom D1 by FINSEQ_3:34;
      then D1.1 <= D2.1 by A22,A23,GOBOARD2:18;
      hence thesis by A11,AXIOMS:22;
      suppose D2.1 in {x};
      hence thesis by A6,TARSKI:def 1;
    end;
    set MD2=<*inf A*>^D2;
    reconsider MD2 as non empty increasing FinSequence of REAL by A21,Lm12;
      MD2 is DivisionPoint of A
    proof
       y in rng MD2 implies y in A
     proof
      assume y in rng MD2;
then A24:   y in rng <*inf A*> \/ rng D2 by FINSEQ_1:44;
      per cases by A24,XBOOLE_0:def 2;
       suppose y in rng <*inf A*>;
       then y in {inf A} by FINSEQ_1:55;
then A25:    y = inf A by TARSKI:def 1;
       consider a,b such that
A26:    a <= b & a = inf A & b = sup A by INTEGRA1:4;
       thus thesis by A25,A26,INTEGRA2:1;
       suppose A27:y in rng D2;
         rng D2 c= A by INTEGRA1:def 2;
       hence thesis by A27;
     end;
then A28: rng MD2 c= A by SUBSET_1:7;
       MD2.(len MD2) = sup A
     proof
A29:   len MD2 = len <*inf A*> + len D2 by FINSEQ_1:35;
        len <*inf A*> + 1 <= len <*inf A*> + len D2 by A19,AXIOMS:24;
      then MD2.(len MD2)=D2.(len <*inf A*>+len D2-len <*inf A*>) by A29,
FINSEQ_1:36
      .=D2.(len D2) by XCMPLX_1:26;
      hence thesis by INTEGRA1:def 2;
     end;
     hence thesis by A28,INTEGRA1:def 2;
    end;
    then reconsider MD2 as Element of divs A by INTEGRA1:def 4;
A30: len MD1=len <*inf A*> + len D1 by FINSEQ_1:35 .= 1+len D1 by FINSEQ_1:56;
A31:1+len D1 >= 1+1 by A7,AXIOMS:24;
A32: x in divset(MD1,len MD1)
    proof
A33:  inf divset(D1,len D1) <= x & x <= sup divset(D1,len D1) by A1,INTEGRA2:1;
A34:  len D1 in dom D1 by SCMFSA_7:12;
A35:  len MD1 in dom MD1 by SCMFSA_7:12;
A36: len MD1 <> 1 by A30,A31;
       len MD1 - 1 = len D1 by A30,XCMPLX_1:26;
     then inf divset(MD1,len MD1) = MD1.(len D1) by A35,A36,INTEGRA1:def 5
     .=inf A by A9,FINSEQ_1:58;
then A37:  inf divset(D1,len D1) = inf divset(MD1,len MD1) by A9,A34,INTEGRA1:
def 5;
       MD1.(len MD1) = MD1.(len <*inf A*> + len D1) by FINSEQ_1:35
     .=D1.(len D1) by A34,FINSEQ_1:def 7;
     then sup divset(MD1,len MD1)=D1.(len D1) by A35,A36,INTEGRA1:def 5
     .= sup divset(D1,len D1) by A9,A34,INTEGRA1:def 5;
     hence thesis by A33,A37,INTEGRA2:1;
    end;
A38:MD1<=MD2
    proof
A39: len D1 <= len D2 & rng D1 c= rng D2 by A3,INTEGRA1:def 20;
     then len D1+len <*inf A*> <= len D2+len <*inf A*> by AXIOMS:24;
     then len MD1 <= len D2+len <*inf A*> by FINSEQ_1:35;
then A40: len MD1 <= len MD2 by FINSEQ_1:35;
       rng D1 \/ rng<*inf A*> c= rng D2 \/ rng <*inf A*> by A39,XBOOLE_1:9;
     then rng MD1 c= rng D2 \/ rng <*inf A*> by FINSEQ_1:44;
     then rng MD1 c= rng MD2 by FINSEQ_1:44;
     hence thesis by A40,INTEGRA1:def 20;
    end;
      rng MD2 = rng MD1 \/ {x}
    proof
       rng MD2 = rng D2 \/ rng <*inf A*> by FINSEQ_1:44
     .=rng D1 \/ rng <*inf A*> \/ {x} by A4,XBOOLE_1:4;
     hence thesis by FINSEQ_1:44;
    end;
then A41:Sum upper_volume(f,MD1)-Sum upper_volume(f,MD2)
    <=(sup rng f-inf rng f)*delta(MD1) by A5,A30,A31,A32,A38,Th10;
A42:vol(divset(MD1,1))=0 by Lm14;
      upper_volume(f,D1)=upper_volume(f,MD1)/^1 by Lm13;
    then upper_volume(f,MD1)=<*upper_volume(f,MD1)/.1*>^upper_volume(f,D1)
    by FINSEQ_5:32;
then A43:Sum upper_volume(f,MD1)=(upper_volume(f,MD1)/.1)+Sum upper_volume(f,D1
)
    by RVSUM_1:106;
      rng MD1 <> {};
    then 1 in dom MD1 by FINSEQ_3:34;
then A44:1 in Seg len MD1 by FINSEQ_1:def 3;
then A45:upper_volume(f,MD1).1 = (sup rng(f|divset(MD1,1)))*vol(divset(MD1,1))
    by INTEGRA1:def 7;
      1 in Seg len upper_volume(f,MD1) by A44,INTEGRA1:def 7;
    then 1 in dom upper_volume(f,MD1) by FINSEQ_1:def 3;
    then A46: upper_volume(f,MD1)/.1 = 0 by A42,A45,FINSEQ_4:def 4;
A47:vol(divset(MD2,1))=0 by Lm14;
      upper_volume(f,D2)=upper_volume(f,MD2)/^1 by Lm13;
    then upper_volume(f,MD2)=<*upper_volume(f,MD2)/.1*>^upper_volume(f,D2)
    by FINSEQ_5:32;
then A48:Sum upper_volume(f,MD2)=(upper_volume(f,MD2)/.1)+Sum upper_volume(f,D2
)
    by RVSUM_1:106;
      rng MD2 <> {};
    then 1 in dom MD2 by FINSEQ_3:34;
then A49:1 in Seg len MD2 by FINSEQ_1:def 3;
then A50:upper_volume(f,MD2).1 = (sup rng(f|divset(MD2,1)))*vol(divset(MD2,1))
    by INTEGRA1:def 7;
      1 in Seg len upper_volume(f,MD2) by A49,INTEGRA1:def 7;
    then 1 in dom upper_volume(f,MD2) by FINSEQ_1:def 3;
    then upper_volume(f,MD2)/.1 = 0 by A47,A50,FINSEQ_4:def 4;
    hence Sum upper_volume(f,D1)-Sum upper_volume(f,D2)<=
    (sup rng f-inf rng f)*delta(D1) by A41,A43,A46,A48,Lm15;
    suppose len D1 >= 2;
    hence thesis by A1,A3,A4,A5,Th10;
   end;
   hence thesis;
end;

theorem Th14:
for A be closed-interval Subset of REAL, D1,D2 be Element of divs A,
r be Real, i,j be Nat st i in dom D1 & j in dom D1 & i<=j & D1 <= D2
& r < mid(D2,indx(D2,D1,i),indx(D2,D1,j)).1
holds ex B be closed-interval Subset of REAL, MD1,MD2 be Element of divs B
st r=inf B & sup B=MD2.(len MD2) & sup B=MD1.(len MD1) & MD1 <= MD2
& MD1=mid(D1,i,j) & MD2=mid(D2,indx(D2,D1,i),indx(D2,D1,j))
proof
   let A be closed-interval Subset of REAL;
   let D1,D2 be Element of divs A;
   let r be Real;
   let i,j;
   assume A1:i in dom D1;
   assume A2:j in dom D1;
   assume A3:i <= j;
   assume A4:D1 <= D2;
   assume A5:r < mid(D2,indx(D2,D1,i),indx(D2,D1,j)).1;
    set MD1=mid(D1,i,j);
    set MD2=mid(D2,indx(D2,D1,i),indx(D2,D1,j));
A6: indx(D2,D1,i) in dom D2 & D2.indx(D2,D1,i)=D1.i by A1,A4,INTEGRA1:def 21;
A7: indx(D2,D1,j) in dom D2 & D2.indx(D2,D1,j)=D1.j by A2,A4,INTEGRA1:def 21;
      D1.i <= D1.j by A1,A2,A3,GOBOARD2:18;
then A8:indx(D2,D1,i) <= indx(D2,D1,j) by A6,A7,GOBOARD1:def 1;
    then consider B being closed-interval Subset of REAL such that
A9: r = inf B & sup B=MD2.(len MD2) & len MD2=indx(D2,D1,j)-indx(D2,D1,i)+1
    &MD2 is DivisionPoint of B by A5,A6,A7,Th11;
    reconsider MD2 as Element of divs B by A9,INTEGRA1:def 3;
      indx(D2,D1,j)-indx(D2,D1,i) >= 0 by A8,SQUARE_1:12;
then A10:indx(D2,D1,j)-indx(D2,D1,i)+1 >= 0+1 by AXIOMS:24;
A11:1 <= indx(D2,D1,i) & indx(D2,D1,j) <= len D2 by A6,A7,FINSEQ_3:27;
then A12:MD2.1=D2.(1+indx(D2,D1,i)-1) by A8,A10,JORDAN3:31
    .=D2.indx(D2,D1,i) by XCMPLX_1:26 .=D1.i by A1,A4,INTEGRA1:def 21;
      j-i >= 0 by A3,SQUARE_1:12;
then A13:j-i+1 >= 0+1 by AXIOMS:24;
A14:1 <= i & j <= len D1 by A1,A2,FINSEQ_3:27;
then A15:MD1.1 = D1.(1+i-1) by A3,A13,JORDAN3:31 .= D1.i by XCMPLX_1:26;
    then consider C being closed-interval Subset of REAL such that
A16:r = inf C & sup C=MD1.(len MD1) & len MD1=j-i+1
    &MD1 is DivisionPoint of C by A1,A2,A3,A5,A12,Th11;
A17:MD1.(len MD1)=D1.(j-i+1-1+i) by A3,A13,A14,A16,JORDAN3:31
    .=D1.(j-i+i) by XCMPLX_1:26 .=D1.(j-(i-i)) by XCMPLX_1:37
 .=D1.j by XCMPLX_1:17;
A18: MD2.(len MD2)=D2.(indx(D2,D1,j)-indx(D2,D1,i)+1-1+indx(D2,D1,i))
    by A8,A9,A10,A11,JORDAN3:31
    .=D2.(indx(D2,D1,j)-indx(D2,D1,i)+indx(D2,D1,i)) by XCMPLX_1:26
    .=D2.(indx(D2,D1,j)-(indx(D2,D1,i)-indx(D2,D1,i))) by XCMPLX_1:37
    .=D2.indx(D2,D1,j) by XCMPLX_1:17 .= D1.j by A2,A4,INTEGRA1:def 21;
A19:B=[.inf B,sup B.] by INTEGRA1:5
    .=C by A9,A16,A17,A18,INTEGRA1:5;
    then reconsider MD1 as Element of divs B by A16,INTEGRA1:def 3;
A20:rng MD1 c= rng MD2
    proof
A21: rng MD1 c= rng D1 by JORDAN3:28;
       rng D1 c= rng D2 by A4,INTEGRA1:def 20;
then A22:  rng MD1 c= rng D2 by A21,XBOOLE_1:1;
      let x1;assume A23:x1 in rng MD1;
      then consider k2 being Nat such that
A24:  k2 in dom D2 & D2.k2=x1 by A22,PARTFUN1:26;
      consider k1 being Nat such that
A25:  k1 in dom MD1 & MD1.k1=x1 by A23,PARTFUN1:26;
A26:  1 <= k1 & k1 <= len MD1 by A25,FINSEQ_3:27;
      then 1 <= len MD1 by AXIOMS:22;
then A27:  1 in dom MD1 by FINSEQ_3:27;
        len MD1 in dom MD1 by SCMFSA_7:12;
      then MD1.1<=MD1.k1 & MD1.k1<=MD1.(len MD1) by A25,A26,A27,GOBOARD2:18;
then A28:  indx(D2,D1,i) <= k2 & k2 <= indx(D2,D1,j)
      by A6,A7,A15,A17,A24,A25,GOBOARD1:def 1;
      then indx(D2,D1,i)+1<=k2+1 & k2+1<=indx(D2,D1,j)+1 by AXIOMS:24;
then A29:  1<=k2+1-indx(D2,D1,i) & k2+1-indx(D2,D1,i)<=indx(D2,D1,j)+1-indx(D2,
D1,i)
      by REAL_1:49,84;
        indx(D2,D1,i) <= k2+1 by A28,NAT_1:37;
      then consider k3 being Nat such that
A30:  k2+1 = indx(D2,D1,i)+k3 by NAT_1:28;
A31:  1 <= k3 & k3 <= indx(D2,D1,j)+1-indx(D2,D1,i) by A29,A30,XCMPLX_1:26;
      then MD2.k3 = D2.(k3+indx(D2,D1,i)-1) by A8,A11,JORDAN3:31;
then A32:  MD2.k3=D2.k2 by A30,XCMPLX_1:26;
        1 <= k3 & k3 <= indx(D2,D1,j)-indx(D2,D1,i)+1 by A31,XCMPLX_1:29;
      then k3 in dom MD2 by A9,FINSEQ_3:27;
      hence thesis by A24,A32,FUNCT_1:def 5;
    end;
      len MD1 <= len MD2
    proof
       MD1 is one-to-one & MD2 is one-to-one by JORDAN7:17;
     then card(rng MD1) = len MD1 & card(rng MD2) = len MD2 by FINSEQ_4:77;
     hence thesis by A20,CARD_1:80;
    end;
    then MD1 <= MD2 by A20,INTEGRA1:def 20;
    hence thesis by A9,A16,A19;
end;

theorem Th15:
for A be closed-interval Subset of REAL, D be Element of divs A
st x in rng D holds D.1 <= x & x <= D.(len D)
proof
   let A be closed-interval Subset of REAL;
   let D be Element of divs A;
   assume x in rng D;
   then consider i such that
A1:i in dom D & x=D.i by PARTFUN1:26;
A2:1 <= i & i <= len D by A1,FINSEQ_3:27;
   then 1 <= len D by AXIOMS:22;
   then 1 in dom D & len D in dom D by FINSEQ_3:27;
   hence thesis by A1,A2,GOBOARD2:18;
end;

theorem Th16:
for p be FinSequence of REAL, i,j,k st p is increasing & i in dom p
& j in dom p & k in dom p & p.i <= p.k & p.k <= p.j holds
p.k in rng mid(p,i,j)
proof
   let p be FinSequence of REAL;
   let i,j,k;
   assume that A1:p is increasing and A2:i in dom p and A3:j in dom p
   and A4:k in dom p and A5:p.i <= p.k and A6:p.k <= p.j;
A7:1 <= i & i <= len p by A2,FINSEQ_3:27;
A8:1 <= j & j <= len p by A3,FINSEQ_3:27;
A9:i <= k by A1,A2,A4,A5,GOBOARD1:def 1;
A10:k <= j by A1,A3,A4,A6,GOBOARD1:def 1;
then A11:i <= j by A9,AXIOMS:22;
then len mid(p,i,j) = j-'i+1 by A7,A8,JORDAN3:27;
then A12:len mid(p,i,j) = j-i+1 by A11,SCMFSA_7:3;
     i <= k+1 by A9,NAT_1:37;
   then consider n such that
A13:k+1=i+n by NAT_1:28;
A14:n=k+1-i by A13,XCMPLX_1:26 .=k-i+1 by XCMPLX_1:29;
     k-i >= 0 by A9,SQUARE_1:12;
then A15:k-i+1 >= 0+1 by AXIOMS:24;
     k-i <= j-i by A10,REAL_1:49;
then A16:k-i+1 <= j-i+1 by AXIOMS:24;
then A17:n in dom mid(p,i,j) by A12,A14,A15,FINSEQ_3:27;
     mid(p,i,j).n = p.(n+i-1) by A7,A8,A11,A14,A15,A16,JORDAN3:31
   .=p.k by A13,XCMPLX_1:26;
   hence thesis by A17,FUNCT_1:def 5;
end;

theorem Th17:
for A be closed-interval Subset of REAL, f be Function of A,REAL,
D be Element of divs A st f is_bounded_on A & i in dom D
holds inf rng(f|divset(D,i)) <= sup rng f
proof
   let A be closed-interval Subset of REAL;
   let f be Function of A,REAL;
   let D be Element of divs A;
   assume A1:f is_bounded_on A;
   assume i in dom D;
   then divset(D,i) c= A by INTEGRA1:10;
   hence thesis by A1,Lm7;
end;

theorem Th18:
for A be closed-interval Subset of REAL, f be Function of A,REAL,
D be Element of divs A st f is_bounded_on A & i in dom D
holds sup rng(f|divset(D,i)) >= inf rng f
proof
   let A be closed-interval Subset of REAL;
   let f be Function of A,REAL;
   let D be Element of divs A;
   assume A1:f is_bounded_on A;
   assume i in dom D;
   then divset(D,i) c= A by INTEGRA1:10;
   hence thesis by A1,Lm7;
end;

begin :: Darboux's Theorem

theorem
  for A be closed-interval Subset of REAL, f be Function of A,REAL,
T be DivSequence of A
st f is_bounded_on A & delta(T) is convergent_to_0 & vol(A)<>0
holds lower_sum(f,T) is convergent & lim lower_sum(f,T) = lower_integral(f)
proof
   let A be closed-interval Subset of REAL;
   let f be Function of A,REAL;
   let T be DivSequence of A;
   assume A1:f is_bounded_on A;
   assume A2:delta(T) is convergent_to_0;
   assume A3:vol(A)<>0;
A4:delta(T) is_not_0 & delta(T) is convergent & lim delta(T) = 0
   by A2,FDIFF_1:def 1;
A5:for e st e>0 ex n st for m st n<=m holds
    0 < (delta(T)).m & (delta(T)).m < e
   proof
     let e; assume e>0;
     then consider n such that
A6:  for m st n<=m holds abs((delta(T)).m-0)<e by A4,SEQ_2:def 7;
       for m st n<=m holds 0 < (delta(T)).m & (delta(T)).m < e
     proof
       let m; assume n<=m;
then A7:    abs((delta(T)).m-0)<e by A6;
         (delta(T)).m-0<=abs((delta(T)).m-0) by ABSVALUE:11;
then A8:    (delta(T)).m+abs((delta(T)).m-0)<e+abs((delta(T)).m-0) by A7,REAL_1
:67;
        A9: (delta(T)).m<>0 by A4,SEQ_1:7;
A10:   (delta(T)).m = delta(T.m) by INTEGRA2:def 3;
         delta(T.m) = max rng upper_volume(chi(A,A),T.m) by INTEGRA1:def 19;
       then delta(T.m) in rng upper_volume(chi(A,A),T.m) by PRE_CIRC:def 1;
       then consider i such that
A11:   i in dom upper_volume(chi(A,A),T.m) &
       delta(T.m)=upper_volume(chi(A,A),T.m).i by PARTFUN1:26;
A12:   i in Seg len upper_volume(chi(A,A),T.m) by A11,FINSEQ_1:def 3;
       consider D being Element of divs A such that
A13:   D = T.m;
         i in Seg len D by A12,A13,INTEGRA1:def 7;
       then delta(T.m)=vol(divset(T.m,i)) by A11,A13,INTEGRA1:22;
       hence thesis by A8,A9,A10,AXIOMS:24,INTEGRA1:11;
     end;
     hence thesis;
   end;

A14:for D,D1 be Element of divs A holds ex D2 be Element of divs A st
   D<=D2 & D1<=D2 & rng D2=rng D1 \/
 rng D & 0<=lower_sum(f,D2)-lower_sum(f,D) &
   0<=lower_sum(f,D2)-lower_sum(f,D1)
   proof
     let D,D1 be Element of divs A;
     consider D2 be Element of divs A such that
A15: D<=D2 & D1<=D2 & rng D2=rng D1 \/ rng D by Th3;
A16: f is_bounded_below_on A by A1,RFUNCT_1:def 11;
     then lower_sum(f,D2)>=lower_sum(f,D) by A15,INTEGRA1:48;
then A17: lower_sum(f,D2)-lower_sum(f,D)>=0 by SQUARE_1:12;
       lower_sum(f,D2)>=lower_sum(f,D1) by A15,A16,INTEGRA1:48;
     then lower_sum(f,D2)-lower_sum(f,D1)>=0 by SQUARE_1:12;
     hence thesis by A15,A17;
   end;
A18:sup rng f >= inf rng f by A1,Lm6;
A19:for D,D1 be Element of divs A st delta(D1)<min rng upper_volume(chi(A,A),D)
  holds ex D2 be Element of divs A st D<=D2 & D1<=D2 & rng D2=rng D1 \/ rng D
  & lower_sum(f,D2)-lower_sum(f,D1) <=
  (len D)*(sup(rng f)-inf(rng f))*delta(D1)
  proof
   let D,D1 be Element of divs A;
   assume A20:delta(D1)<min rng upper_volume(chi(A,A),D);
     ex D2 be Element of divs A st D<=D2 & D1<=D2 & rng D2=rng D1 \/ rng D
   & lower_sum(f,D2)-lower_sum(f,D1)<=(len D)*(sup(rng f)-inf(rng f))*delta(D1)
   proof
    consider D2 be Element of divs A such that
A21: D<=D2 & D1<=D2 & rng D2=rng D1 \/
 rng D & 0<=lower_sum(f,D2)-lower_sum(f,D)
    & 0<=lower_sum(f,D2)-lower_sum(f,D1) by A14;
      lower_sum(f,D2)-lower_sum(f,D1) <=
    (len D)*(sup(rng f)-inf(rng f))*delta(D1)
    proof
     deffunc PLf(Element of divs A,Nat) = (PartSums(lower_volume(f,$1))).$2;
     deffunc LVf(Element of divs A) = lower_volume(f,$1);
A22:  for i st i in dom D holds ex j st j in dom D1 & D.i in divset(D1,j)
     & PLf(D2,indx(D2,D1,j))-PLf(D1,j)<=i*(sup(rng f)-inf(rng f))*delta(D1)
     proof
      let i; assume A23:i in dom D;
A24:   for i,j st i in dom D & j in dom D1 & D.i in divset(D1,j) holds j >= 2
      proof
       let i,j;
       assume A25:i in dom D;
       assume A26:j in dom D1 & D.i in divset(D1,j);
       assume j<2;
       then j<1+1;
then A27:   j <= 1 by NAT_1:38;
A28:   inf divset(D1,j)<=D.i & D.i<=sup divset(D1,j) by A26,INTEGRA2:1;
         j in Seg len D1 by A26,FINSEQ_1:def 3;
       then j >= 1 by FINSEQ_1:3;
       then j = 1 by A27,AXIOMS:21;
then A29:   inf divset(D1,j)=inf A & sup divset(D1,j)=D1.j by A26,INTEGRA1:def
5;
         delta(D1) >= min rng upper_volume(chi(A,A),D)
       proof
        per cases;
         suppose A30:i=1;
           len D <> 0 by FINSEQ_1:25;
         then len D in Seg len D by FINSEQ_1:5;
         then 1 <= len D by FINSEQ_1:3;
then A31:     1 in Seg len D by FINSEQ_1:3;
         then 1 in dom D by FINSEQ_1:def 3;
then A32:     inf divset(D,1)=inf A & sup divset(D,1)=D.1 by INTEGRA1:def 5;
           sup divset(D1,j)-inf A >= D.1-inf A by A28,A30,REAL_1:49;
         then vol(divset(D1,j)) >= sup divset(D,1)-inf divset(D,1)
         by A29,A32,INTEGRA1:def 6;
then A33:      vol(divset(D1,j)) >= vol(divset(D,1)) by INTEGRA1:def 6;
           vol(divset(D1,j)) <= delta(D1) by A26,Lm8;
then A34:     delta(D1) >= vol(divset(D,1)) by A33,AXIOMS:22;
           1 in Seg len upper_volume(chi(A,A),D) by A31,INTEGRA1:def 7;
then A35:     1 in dom upper_volume(chi(A,A),D) by FINSEQ_1:def 3;
           vol(divset(D,1)) = upper_volume(chi(A,A),D).1 by A31,INTEGRA1:22;
         then vol(divset(D,1)) in rng upper_volume(chi(A,A),D)
         by A35,FUNCT_1:def 5;
         then vol(divset(D,1))>=min rng upper_volume(chi(A,A),D) by SFMASTR3:
def 1;
         hence thesis by A34,AXIOMS:22;
         suppose A36:i<>1;
then A37:      inf divset(D,i)=D.(i-1) & sup divset(D,i)=D.i
         by A25,INTEGRA1:def 5;
then A38:      sup divset(D1,j)-inf divset(D1,j) >= sup divset(D,i)-inf A
         by A28,A29,REAL_1:49;
           D.(i-1) in A by A25,A36,INTEGRA1:9;
         then inf A <= D.(i-1) by INTEGRA2:1;
         then sup divset(D,i)-inf A >= sup divset(D,i)-inf divset(D,i)
         by A37,REAL_2:106;
         then sup divset(D1,j)-inf divset(D1,j) >= sup divset(D,i)-inf divset(
D,i)
         by A38,AXIOMS:22;
         then vol(divset(D1,j)) >= sup divset(D,i)-inf divset(D,i)
         by INTEGRA1:def 6;
then A39:      vol(divset(D1,j)) >= vol(divset(D,i)) by INTEGRA1:def 6;
           vol(divset(D1,j)) <= delta(D1) by A26,Lm8;
then A40:      delta(D1) >= vol(divset(D,i)) by A39,AXIOMS:22;
A41:      i in Seg len D by A25,FINSEQ_1:def 3;
         then i in Seg len upper_volume(chi(A,A),D) by INTEGRA1:def 7;
then A42:     i in dom upper_volume(chi(A,A),D) by FINSEQ_1:def 3;
           vol(divset(D,i)) = upper_volume(chi(A,A),D).i by A41,INTEGRA1:22;
         then vol(divset(D,i)) in rng upper_volume(chi(A,A),D)
         by A42,FUNCT_1:def 5;
         then vol(divset(D,i))>=min rng upper_volume(chi(A,A),D) by SFMASTR3:
def 1;
         hence thesis by A40,AXIOMS:22;
       end;
       hence contradiction by A20;
      end;

      defpred P[non empty Nat] means
      $1 in dom D implies ex j st j in dom D1 & D.$1 in divset(D1,j)
      & PLf(D2,indx(D2,D1,j))-PLf(D1,j)<=$1*(sup rng f-inf rng f)*delta(D1);
A43: P[1]
      proof
         len D <> 0 by FINSEQ_1:25;
       then len D in Seg len D by FINSEQ_1:5;
       then 1 <= len D by FINSEQ_1:3;
then A44:   1 in dom D by FINSEQ_3:27;
       then D.1 in A by INTEGRA1:8;
       then consider j such that
A45:    j in dom D1 & D.1 in divset(D1,j) by Th2;
         PLf(D2,indx(D2,D1,j))-PLf(D1,j)<=1*(sup rng f-inf rng f)*delta(D1)
       proof
A46:    j <> 1 by A24,A44,A45;
then A47:     j-1 in NAT & j-1 in dom D1 by A45,INTEGRA1:9;
        reconsider j1=j-1 as Element of NAT by A45,A46,INTEGRA1:9;
          inf divset(D1,j) <= D.1 & D.1 <= sup divset(D1,j)
        by A45,INTEGRA2:1;
then A48:    D1.j1 <= D.1 & D.1 <= D1.j by A45,A46,INTEGRA1:def 5;
A49:     indx(D2,D1,j1) in dom D2 & 1 <= indx(D2,D1,j1) &
         indx(D2,D1,j1) <= len D2
        proof
         thus indx(D2,D1,j1) in dom D2 by A21,A47,INTEGRA1:def 21;
         then indx(D2,D1,j1) in Seg len D2 by FINSEQ_1:def 3;
         hence thesis by FINSEQ_1:3;
        end;
        then mid(D2,1,indx(D2,D1,j1)) is increasing by INTEGRA1:37;
then A50:     D2|indx(D2,D1,j1) is increasing by A49,JORDAN3:25;
A51:     j1 in dom D1 & 1 <= j1 & j1 <= len D1
        proof
         thus j1 in dom D1 by A45,A46,INTEGRA1:9;
           j1 in Seg len D1 by A47,FINSEQ_1:def 3;
         hence thesis by FINSEQ_1:3;
        end;
        then mid(D1,1,j1) is increasing by INTEGRA1:37;
then A52:     D1|j1 is increasing by A51,JORDAN3:25;
A53:     rng (D2|indx(D2,D1,j1)) = rng (D1|j1)
        proof
           for x1 st x1 in rng(D2|indx(D2,D1,j1)) holds x1 in rng(D1|j1)
         proof
          let x1; assume x1 in rng(D2|indx(D2,D1,j1));
          then consider k such that
A54:      k in dom(D2|indx(D2,D1,j1)) & x1=(D2|indx(D2,D1,j1)).k
by PARTFUN1:26;
            k in Seg len(D2|indx(D2,D1,j1)) by A54,FINSEQ_1:def 3;
then A55:      k in Seg indx(D2,D1,j1) by A49,TOPREAL1:3;
then A56:      (D2|indx(D2,D1,j1)).k = D2.k & k in dom D2 by A49,RFINSEQ:19;
then A57:       D2.k in rng D2 by FUNCT_1:def 5;
            1 <= k & k <= indx(D2,D1,j1) by A55,FINSEQ_1:3;
          then D2.k <= D2.indx(D2,D1,j1) by A49,A56,GOBOARD2:18;
then A58:      D2.k <= D1.j1 by A21,A47,INTEGRA1:def 21;
A59:      len(D1|j1) = j1 by A51,TOPREAL1:3;
A60:      D2.k in rng D implies D2.k = D1.j1
          proof
           assume D2.k in rng D;
           then consider n such that
A61:       n in dom D & D2.k=D.n by PARTFUN1:26;
             1 <= n by A61,FINSEQ_3:27;
           then D.1 <= D2.k by A44,A61,GOBOARD2:18;
           then D1.j1 <= D2.k by A48,AXIOMS:22;
           hence thesis by A58,AXIOMS:21;
          end;
A62:      D2.k in rng D implies D2.k in rng(D1|j1)
          proof
           assume A63:D2.k in rng D;
             j1 in Seg len(D1|j1) by A51,A59,FINSEQ_1:3;
           then j1 in dom(D1|j1) by FINSEQ_1:def 3;
then A64:       (D1|j1).j1 in rng(D1|j1) by FUNCT_1:def 5;
             j1 in Seg j1 by A51,FINSEQ_1:3;
           hence thesis by A51,A60,A63,A64,RFINSEQ:19;
          end;
            D2.k in rng D1 implies D2.k in rng(D1|j1)
          proof
           assume D2.k in rng D1;
           then consider m such that
A65:       m in dom D1 & D2.k = D1.m by PARTFUN1:26;
             m in Seg len D1 by A65,FINSEQ_1:def 3;
then A66:       1 <= m & m <= j1 by A51,A58,A65,FINSEQ_1:3,GOBOARD1:def 1;
then A67:       m in dom (D1|j1) by A59,FINSEQ_3:27;
             m in Seg j1 by A66,FINSEQ_1:3;
           then D2.k = (D1|j1).m by A51,A65,RFINSEQ:19;
           hence thesis by A67,FUNCT_1:def 5;
          end;
          hence thesis by A21,A49,A54,A55,A57,A62,RFINSEQ:19,XBOOLE_0:def 2;
         end;
then A68:     rng(D2|indx(D2,D1,j1)) c= rng (D1|j1) by TARSKI:def 3;
           for x1 st x1 in rng(D1|j1) holds x1 in rng(D2|indx(D2,D1,j1))
         proof
          let x1; assume x1 in rng(D1|j1);
          then consider k such that
A69:      k in dom(D1|j1) & x1=(D1|j1).k by PARTFUN1:26;
            k in Seg len(D1|j1) by A69,FINSEQ_1:def 3;
then A70:      k in Seg j1 by A51,TOPREAL1:3;
then A71:      (D1|j1).k = D1.k & k in dom D1 by A51,RFINSEQ:19;
          then D1.k in rng D1 by FUNCT_1:def 5;
          then x1 in rng D2 by A21,A69,A71,XBOOLE_0:def 2;
          then consider n such that
A72:      n in dom D2 & x1=D2.n by PARTFUN1:26;
A73:      indx(D2,D1,k) in dom D2 & D2.indx(D2,D1,k)=D2.n
          by A21,A69,A71,A72,INTEGRA1:def 21;
            k <= j1 by A70,FINSEQ_1:3;
          then D1.k <= D1.j1 by A47,A71,GOBOARD2:18;
          then D2.indx(D2,D1,k) <= D1.j1 by A21,A71,INTEGRA1:def 21;
          then D2.indx(D2,D1,k)<=D2.indx(D2,D1,j1)
          by A21,A47,INTEGRA1:def 21;
then A74:       n <= indx(D2,D1,j1) by A49,A72,A73,GOBOARD1:def 1;
            1 <= n by A72,FINSEQ_3:27;
then A75:       n in Seg indx(D2,D1,j1) by A74,FINSEQ_1:3;
then A76:       D2.n = (D2|indx(D2,D1,j1)).n by A49,RFINSEQ:19;
            n in Seg len(D2|indx(D2,D1,j1)) by A49,A75,TOPREAL1:3;
          then n in dom(D2|indx(D2,D1,j1)) by FINSEQ_1:def 3;
          hence thesis by A72,A76,FUNCT_1:def 5;
         end;
         then rng(D1|j1) c= rng(D2|indx(D2,D1,j1)) by TARSKI:def 3;
         hence thesis by A68,XBOOLE_0:def 10;
        end;
then A77:    D2|indx(D2,D1,j1)=D1|j1 by A50,A52,Th5;
A78:   for k st 1 <= k & k <= j1 holds k=indx(D2,D1,k)
        proof
         let k; assume A79:1 <= k & k <= j1;
         assume A80:k<>indx(D2,D1,k);
           now per cases by A80,AXIOMS:21;
          suppose A81:k > indx(D2,D1,k);
            1 <= k & k <= len D1 by A51,A79,AXIOMS:22;
then A82:       k in dom D1 by FINSEQ_3:27;
then A83:       indx(D2,D1,k) in dom D2 & D1.k=D2.indx(D2,D1,k)
          by A21,INTEGRA1:def 21;
          then indx(D2,D1,k) in Seg len D2 by FINSEQ_1:def 3;
then A84:       1<=indx(D2,D1,k)&indx(D2,D1,k)<=indx(D2,D1,j1)
          by A21,A51,A79,A82,Th6,FINSEQ_1:3;
          then indx(D2,D1,k) in Seg indx(D2,D1,j1) by FINSEQ_1:3;
then A85:       (D2|indx(D2,D1,j1)).indx(D2,D1,k)=D2.indx(D2,D1,k) by A49,
RFINSEQ:19;
A86:      indx(D2,D1,k) < j1 by A79,A81,AXIOMS:22;
          then indx(D2,D1,k) <= len D1 by A51,AXIOMS:22;
          then indx(D2,D1,k) in dom D1 by A84,FINSEQ_3:27;
then A87:       D1.k > D1.indx(D2,D1,k) by A81,A82,GOBOARD1:def 1;
            indx(D2,D1,k) in Seg j1 by A84,A86,FINSEQ_1:3;
          hence contradiction by A51,A77,A83,A85,A87,RFINSEQ:19;

          suppose A88:k < indx(D2,D1,k);
            k in Seg j1 by A79,FINSEQ_1:3;
then A89:       D1.k = (D1|j1).k by A47,RFINSEQ:19;
            1 <= k & k <= len D1 by A51,A79,AXIOMS:22;
then A90:       k in dom D1 by FINSEQ_3:27;
then A91:       indx(D2,D1,k) in dom D2 & D1.k=D2.indx(D2,D1,k)
          by A21,INTEGRA1:def 21;
            indx(D2,D1,k) <= indx(D2,D1,j1) & indx(D2,D1,k) in dom D2 &
          indx(D2,D1,j1) in dom D2 by A21,A51,A79,A90,Th6;
then A92:      k <= indx(D2,D1,j1) by A88,AXIOMS:22;
          then k <= len D2 by A49,AXIOMS:22;
          then k in dom D2 by A79,FINSEQ_3:27;
then A93:      D2.k < D2.indx(D2,D1,k) by A88,A91,GOBOARD1:def 1;
            k in Seg indx(D2,D1,j1) by A79,A92,FINSEQ_1:3;
          hence contradiction by A49,A77,A89,A91,A93,RFINSEQ:19;
         end;
         hence contradiction;
        end;

A94:     len (D2|indx(D2,D1,j1))=len (D1|j1) by A50,A52,A53,Th5;
      len (D2|indx(D2,D1,j1))=indx(D2,D1,j1) by A49,TOPREAL1:3;
then A95:     indx(D2,D1,j1) =j1 by A51,A94,TOPREAL1:3;
          j1 <= len D1 by A47,FINSEQ_3:27;
        then j1 <= len lower_volume(f,D1) by INTEGRA1:def 8;
then A96:   len(lower_volume(f,D1)|j1)=indx(D2,D1,j1) by A95,TOPREAL1:3;
          indx(D2,D1,j1) in dom D2 by A21,A47,INTEGRA1:def 21;
        then indx(D2,D1,j1) <= len D2 by FINSEQ_3:27;
        then indx(D2,D1,j1) <= len lower_volume(f,D2) by INTEGRA1:def 8;
then A97:    len(lower_volume(f,D1)|j1)=len(lower_volume(f,D2)|indx(D2,D1,j1))
        by A96,TOPREAL1:3;
          for k st 1 <= k & k <= len(lower_volume(f,D1)|j1) holds
        (lower_volume(f,D1)|j1).k = (lower_volume(f,D2)|indx(D2,D1,j1)).k
        proof
         let k; assume A98:1 <= k & k <= len(lower_volume(f,D1)|j1);
A99:      len(lower_volume(f,D1)) = len D1 by INTEGRA1:def 8;
then A100:     1 <= k & k <= j1 by A51,A98,TOPREAL1:3;
then A101:      k in Seg j1 by FINSEQ_1:3;
           1 <= k & k <= len D1 by A51,A100,AXIOMS:22;
then A102:     k in Seg len D1 by FINSEQ_1:3;
A103:    divset(D1,k)=divset(D2,indx(D2,D1,k))
         proof
A104:       divset(D2,indx(D2,D1,k))= [. inf divset(D2,indx(D2,D1,k)),
          sup divset(D2,indx(D2,D1,k)).] by INTEGRA1:5;
A105:       k in dom D1 by A102,FINSEQ_1:def 3;
then A106:       indx(D2,D1,k) in dom D2 & D1.k=D2.indx(D2,D1,k) by A21,
INTEGRA1:def 21;
            inf divset(D1,k)=inf divset(D2,indx(D2,D1,k)) &
          sup divset(D1,k)=sup divset(D2,indx(D2,D1,k))
          proof
           per cases;
            suppose A107:k=1;
then A108:        inf divset(D1,k)=inf A&sup divset(D1,k)=D1.k by A105,INTEGRA1
:def 5;
              indx(D2,D1,k)=1 by A51,A78,A107;
            hence thesis by A106,A108,INTEGRA1:def 5;

            suppose A109:k<>1;
then A110:        inf divset(D1,k)=D1.(k-1) & sup divset(D1,k)=D1.k
            by A105,INTEGRA1:def 5;
A111:        k-1 in dom D1 & D1.(k-1) in A & k-1 in NAT
             by A105,A109,INTEGRA1:9;
            reconsider k1=k-1 as Nat by A105,A109,INTEGRA1:9;
              k <= k+1 by NAT_1:29;
            then k1 <= k by REAL_1:86;
then A112:       k1 <= j1 by A100,AXIOMS:22;
              k1 in Seg len D1 by A111,FINSEQ_1:def 3;
            then 1 <= k1 by FINSEQ_1:3;
then A113:       k1=indx(D2,D1,k1) by A78,A112;
              indx(D2,D1,k)<>1 by A78,A100,A109;
then A114:        inf divset(D2,indx(D2,D1,k))=D2.(indx(D2,D1,k)-1) &
            sup divset(D2,indx(D2,D1,k))=D2.indx(D2,D1,k) by A106,INTEGRA1:def
5;
              D2.(indx(D2,D1,k)-1)= D2.indx(D2,D1,k1) by A78,A100,A113;
            hence thesis by A21,A105,A110,A111,A114,INTEGRA1:def 21;
          end;
          hence thesis by A104,INTEGRA1:5;
         end;
           j1 in Seg len(lower_volume(f,D1)) by A51,A99,FINSEQ_1:def 3;
         then j1 in dom(lower_volume(f,D1)) by FINSEQ_1:def 3;
then A115:      (lower_volume(f,D1)|j1).k = lower_volume(f,D1).k by A101,
RFINSEQ:19
         .=(inf(rng(f|divset(D2,indx(D2,D1,k)))))*vol(divset(D2,indx(D2,D1,k)))
         by A102,A103,INTEGRA1:def 8;
           indx(D2,D1,k) in Seg j1 by A78,A100,A101;
then A116:     indx(D2,D1,k) in Seg indx(D2,D1,j1) by A51,A78;
         then 1<=indx(D2,D1,k) & indx(D2,D1,k)<=indx(D2,D1,j1) by FINSEQ_1:3;
         then 1<=indx(D2,D1,k) & indx(D2,D1,k)<=len D2 by A49,AXIOMS:22;
then A117:     indx(D2,D1,k) in Seg len D2 by FINSEQ_1:3;
           indx(D2,D1,j1) in Seg len D2 by A49,FINSEQ_1:def 3;
         then indx(D2,D1,j1) in Seg len lower_volume(f,D2) by INTEGRA1:def 8;
then A118:     indx(D2,D1,j1) in dom lower_volume(f,D2) by FINSEQ_1:def 3;
           (lower_volume(f,D2)|indx(D2,D1,j1)).k
          =(lower_volume(f,D2)|indx(D2,D1,j1)).indx(D2,D1,k) by A78,A100
         .=lower_volume(f,D2).indx(D2,D1,k) by A116,A118,RFINSEQ:19
         .=(inf(rng(f|divset(D2,indx(D2,D1,k)))))*vol(divset(D2,indx(D2,D1,k)))
         by A117,INTEGRA1:def 8;
         hence thesis by A115;
        end;
then A119:    lower_volume(f,D2)|indx(D2,D1,j1)=lower_volume(f,D1)|j1
        by A97,FINSEQ_1:18;
          indx(D2,D1,j1) in Seg len D2 by A49,FINSEQ_1:def 3;
then A120:     indx(D2,D1,j1) in Seg len lower_volume(f,D2) by INTEGRA1:def 8;
          j1 in Seg len D1 by A51,FINSEQ_1:def 3;
then A121:     j1 in Seg len lower_volume(f,D1) by INTEGRA1:def 8;
A122:    PLf(D2,indx(D2,D1,j1))=Sum(lower_volume(f,D2)|indx(D2,D1,j1))
        by A120,INTEGRA1:def 22
        .=PLf(D1,j1) by A119,A121,INTEGRA1:def 22;
A123:     indx(D2,D1,j1)+1 <= indx(D2,D1,j)
        proof
           j < j+1 by NAT_1:38;
         then j1 < j by REAL_1:84;
         then indx(D2,D1,j1) < indx(D2,D1,j) by A21,A45,A51,Th7;
         hence thesis by NAT_1:38;
        end;

A124:    Sum mid(lower_volume(f,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))
        -Sum mid(lower_volume(f,D1),j,j) <= (sup rng f-inf rng f)*delta(D1)
        proof
A125:      1 <= indx(D2,D1,j) & indx(D2,D1,j) <= len lower_volume(f,D2)
         proof
            indx(D2,D1,j) in dom D2 by A21,A45,INTEGRA1:def 21;
          then indx(D2,D1,j) in Seg len D2 by FINSEQ_1:def 3;
          then indx(D2,D1,j) in Seg len lower_volume(f,D2) by INTEGRA1:def 8;
          hence thesis by FINSEQ_1:3;
         end;
then A126:      1 <= indx(D2,D1,j1)+1 & indx(D2,D1,j1)+1 <= len lower_volume(f,
D2)
         by A49,A123,AXIOMS:22,NAT_1:38;
A127:     indx(D2,D1,j)-indx(D2,D1,j1) <= 2
         proof
          assume A128:indx(D2,D1,j)-indx(D2,D1,j1) > 2;
          reconsider ID1=indx(D2,D1,j1)+1 as Nat;
          reconsider ID2=ID1+1 as Nat;
A129:     indx(D2,D1,j1) < ID1 & ID1 < ID2 & ID2 < indx(D2,D1,j)
          proof
           thus indx(D2,D1,j1) < ID1 by NAT_1:38;
           thus ID1 < ID2 by NAT_1:38;
             indx(D2,D1,j1)+(1+1)<indx(D2,D1,j) by A128,REAL_1:86;
           hence thesis by XCMPLX_1:1;
          end;
A130:     indx(D2,D1,j) in dom D2 by A21,A45,INTEGRA1:def 21;
then A131:     indx(D2,D1,j) <= len D2 by FINSEQ_3:27;
A132:     ID1 in dom D2
          proof
             1 <= ID1 & ID1 <= indx(D2,D1,j) by A49,A129,AXIOMS:22;
           then 1 <= ID1 & ID1 <= len D2 by A131,AXIOMS:22;
           then ID1 in Seg len D2 by FINSEQ_1:3;
           hence thesis by FINSEQ_1:def 3;
          end;
A133:     ID2 in dom D2
          proof
             indx(D2,D1,j1) <= ID2 & ID2 <= len D2 by A129,A131,AXIOMS:22;
           then 1 <= ID2 & ID2 <= len D2 by A49,AXIOMS:22;
           then ID2 in Seg len D2 by FINSEQ_1:3;
           hence thesis by FINSEQ_1:def 3;
          end;
then A134:     D2.indx(D2,D1,j1)<D2.ID1 & D2.ID1<D2.ID2 & D2.ID2<D2.indx(D2,D1,
j)
          by A49,A129,A130,A132,GOBOARD1:def 1;
A135:     D2.ID1 in rng D & D2.ID2 in rng D
          proof
           A136: D2.ID1 in rng D \/ rng D1 & D2.ID2 in rng D \/ rng D1
           by A21,A132,A133,FUNCT_1:def 5;
A137:      D1.j1 = D2.indx(D2,D1,j1) & D1.j = D2.indx(D2,D1,j)
           by A21,A45,A51,INTEGRA1:def 21;
             not(D2.ID1 in rng D1) & not D2.ID2 in rng D1
           proof
            assume A138:D2.ID1 in rng D1 or D2.ID2 in rng D1;
            per cases by A138;
             suppose D2.ID1 in rng D1;
             then consider n such that
A139:        n in dom D1 & D1.n=D2.ID1 by PARTFUN1:26;
               D2.indx(D2,D1,j1)<D2.ID1 & D2.ID1<D2.indx(D2,D1,j)
             by A134,AXIOMS:22;
             then j1<n & n<j by A45,A51,A137,A139,GOBOARD2:18;
             then j<n+1 & n<j by REAL_1:84;
             hence contradiction by NAT_1:38;
             suppose D2.ID2 in rng D1;
             then consider n such that
A140:        n in dom D1 & D1.n=D2.ID2 by PARTFUN1:26;
               D2.indx(D2,D1,j1)<D2.ID2 & D2.ID2<D2.indx(D2,D1,j)
             by A134,AXIOMS:22;
             then j1<n & n<j by A45,A51,A137,A140,GOBOARD2:18;
             then j<n+1 & n<j by REAL_1:84;
             hence contradiction by NAT_1:38;
           end;
           hence thesis by A136,XBOOLE_0:def 2;
          end;
A141:     inf divset(D1,j)=D2.indx(D2,D1,j1)
          & sup divset(D1,j)=D2.indx(D2,D1,j)
          proof
             inf divset(D1,j)=D1.j1 & sup divset(D1,j)=D1.j
           by A45,A46,INTEGRA1:def 5;
           hence thesis by A21,A45,A51,INTEGRA1:def 21;
          end;
A142:     D2.ID1 in rng D /\ divset(D1,j)
          proof
             D2.indx(D2,D1,j1)<=D2.ID1&D2.ID1<=D2.indx(D2,D1,j)
           by A134,AXIOMS:22;
           then D2.ID1 in divset(D1,j) by A141,INTEGRA2:1;
           hence thesis by A135,XBOOLE_0:def 3;
          end;
      D2.ID2 in rng D /\ divset(D1,j)
          proof
             D2.indx(D2,D1,j1)<=D2.ID2&D2.ID2<=D2.indx(D2,D1,j)
           by A134,AXIOMS:22;
           then D2.ID2 in divset(D1,j) by A141,INTEGRA2:1;
           hence thesis by A135,XBOOLE_0:def 3;
          end;
          then D2.ID1=D2.ID2 by A20,A45,A142,Th4;
          hence contradiction by A129,A132,A133,GOBOARD2:19;
         end;
       1 <= indx(D2,D1,j)-'(indx(D2,D1,j1)+1)+1 &
         indx(D2,D1,j)-'(indx(D2,D1,j1)+1)+1 <= 2
         proof
A143:      indx(D2,D1,j)-'(indx(D2,D1,j1)+1)
           =indx(D2,D1,j)-(indx(D2,D1,j1)+1) by A123,SCMFSA_7:3;
          then indx(D2,D1,j)-'(indx(D2,D1,j1)+1) >= 0 by A123,SQUARE_1:12;
          then indx(D2,D1,j)-'(indx(D2,D1,j1)+1)+1 >= 0+1 by AXIOMS:24;
          hence indx(D2,D1,j)-'(indx(D2,D1,j1)+1)+1 >= 1;
            indx(D2,D1,j)-'(indx(D2,D1,j1)+1)+1
           =indx(D2,D1,j)-indx(D2,D1,j1)-1+1 by A143,XCMPLX_1:36
          .=indx(D2,D1,j)-indx(D2,D1,j1)+1-1 by XCMPLX_1:29
          .=indx(D2,D1,j)-indx(D2,D1,j1) by XCMPLX_1:26;
          hence thesis by A127;
         end;
then A144:      1 <= len mid(lower_volume(f,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j
)) &
         len mid(lower_volume(f,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))<=2
         by A123,A125,A126,JORDAN3:27;
A145:      1 <= j & j <= len lower_volume(f,D1)
         proof
            1 <= j & j <= len D1 by A45,FINSEQ_3:27;
          hence thesis by INTEGRA1:def 8;
         end;
     j-'j+1 = 1 by Lm3;
then A146:      len mid(lower_volume(f,D1),j,j)= 1 by A145,JORDAN3:27;
           mid(lower_volume(f,D1),j,j).1 = lower_volume(f,D1).j by A145,JORDAN3
:27;
         then mid(lower_volume(f,D1),j,j)
          =<*lower_volume(f,D1).j*> by A146,FINSEQ_1:57;
then A147:     Sum mid(lower_volume(f,D1),j,j)=lower_volume(f,D1).j by RVSUM_1:
103;

A148:     indx(D2,D1,j1)+1 in Seg len D2
         proof
            indx(D2,D1,j1)+1 in Seg len lower_volume(f,D2) by A126,FINSEQ_1:3;
          hence thesis by INTEGRA1:def 8;
         end;
A149:     j in Seg len D1 by A45,FINSEQ_1:def 3;
           now per cases by A144,Lm4;
          suppose
A150:      len mid(lower_volume(f,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))=1;
A151:      indx(D2,D1,j1)+1=indx(D2,D1,j)
          proof
             indx(D2,D1,j)-'(indx(D2,D1,j1)+1)+1=1
           by A123,A125,A126,A150,JORDAN3:27;
           then indx(D2,D1,j)-'(indx(D2,D1,j1)+1)=1-1 by XCMPLX_1:26;
           then indx(D2,D1,j)-(indx(D2,D1,j1)+1)=0 by A123,SCMFSA_7:3;
           then indx(D2,D1,j)=0+(indx(D2,D1,j1)+1) by XCMPLX_1:27;
           hence thesis;
          end;

A152:      divset(D2,indx(D2,D1,j))=divset(D1,j)
          proof
             inf divset(D1,j)=D2.indx(D2,D1,j1)
           & sup divset(D1,j)=D2.indx(D2,D1,j)
           proof
              inf divset(D1,j)=D1.j1 & sup divset(D1,j)=D1.j
            by A45,A46,INTEGRA1:def 5;
            hence thesis by A21,A45,A51,INTEGRA1:def 21;
           end;
then A153:      divset(D1,j)=[. D2.indx(D2,D1,j1),D2.indx(D2,D1,j).] by
INTEGRA1:5;
A154:      indx(D2,D1,j)-1=indx(D2,D1,j1) by A151,XCMPLX_1:26;
A155:      indx(D2,D1,j) in dom D2 by A21,A45,INTEGRA1:def 21;
             indx(D2,D1,j)<>1 by A49,A151,NAT_1:38;
           then inf divset(D2,indx(D2,D1,j))=D2.indx(D2,D1,j1)
           & sup divset(D2,indx(D2,D1,j))=D2.indx(D2,D1,j)
           by A154,A155,INTEGRA1:def 5;
           hence thesis by A153,INTEGRA1:5;
          end;

            mid(lower_volume(f,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j)).1
           =lower_volume(f,D2).(indx(D2,D1,j1)+1) by A125,A126,JORDAN3:27;
          then mid(lower_volume(f,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))
          =<*lower_volume(f,D2).(indx(D2,D1,j1)+1)*> by A150,FINSEQ_1:57;
          then A156: Sum mid(lower_volume(f,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j
))
           =lower_volume(f,D2).(indx(D2,D1,j1)+1) by RVSUM_1:103
          .=(inf(rng(f|divset(D2,(indx(D2,D1,j1)+1)))))
          *vol(divset(D2,(indx(D2,D1,j1)+1))) by A148,INTEGRA1:def 8
          .=Sum mid(lower_volume(f,D1),j,j)
            by A147,A149,A151,A152,INTEGRA1:def 8;
A157:      delta(D1) >= 0 by Th8;
            sup rng f - inf rng f >= 0 by A18,SQUARE_1:12;
          then (sup rng f - inf rng f)*delta(D1) >= 0*delta(D1) by A157,AXIOMS:
25;
          hence
            Sum mid(lower_volume(f,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))
          -Sum mid(lower_volume(f,D1),j,j) <= (sup rng f-inf rng f)*delta(D1)
          by A156,XCMPLX_1:14;
          suppose
A158:       len mid(lower_volume(f,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))=2;
A159:       mid(lower_volume(f,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j)).1
           =lower_volume(f,D2).(indx(D2,D1,j1)+1) by A125,A126,JORDAN3:27;
            mid(lower_volume(f,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j)).2
           =lower_volume(f,D2).(indx(D2,D1,j1)+2)
          proof
A160:       2+(indx(D2,D1,j1)+1)>=0+1 by A126,REAL_1:55;
             mid(lower_volume(f,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j)).2
            =LVf(D2).(2+(indx(D2,D1,j1)+1)-'1) by A123,A125,A126,A158,JORDAN3:
27
           .=LVf(D2).(2+(indx(D2,D1,j1)+1)-1) by A160,SCMFSA_7:3
           .=LVf(D2).((indx(D2,D1,j1)+1)+(2-1)) by XCMPLX_1:29
           .=LVf(D2).(indx(D2,D1,j1)+(1+1)) by XCMPLX_1:1;
           hence thesis;
          end;
          then mid(lower_volume(f,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))
          =<*lower_volume(f,D2).(indx(D2,D1,j1)+1),
             lower_volume(f,D2).(indx(D2,D1,j1)+2)*> by A158,A159,FINSEQ_1:61;
then A161:       Sum mid(lower_volume(f,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))
           =lower_volume(f,D2).(indx(D2,D1,j1)+1)
           +lower_volume(f,D2).(indx(D2,D1,j1)+2) by RVSUM_1:107;
A162:       vol(divset(D1,j))
          =vol(divset(D2,indx(D2,D1,j1)+1))+vol(divset(D2,indx(D2,D1,j1)+2))
          proof
A163:     inf divset(D1,j)=D2.indx(D2,D1,j1)&sup divset(D1,j)=D2.indx(D2,D1,j)
           proof
              inf divset(D1,j)=D1.j1 & sup divset(D1,j)=D1.j
            by A45,A46,INTEGRA1:def 5;
            hence thesis by A21,A45,A51,INTEGRA1:def 21;
           end;
A164:       indx(D2,D1,j)=indx(D2,D1,j1)+2
           proof
              indx(D2,D1,j)-'(indx(D2,D1,j1)+1)+1=2
            by A123,A125,A126,A158,JORDAN3:27;
            then indx(D2,D1,j)-(indx(D2,D1,j1)+1)+1=2 by A123,SCMFSA_7:3;
            then indx(D2,D1,j)-indx(D2,D1,j1)-1+1=2 by XCMPLX_1:36;
            then indx(D2,D1,j)-indx(D2,D1,j1)-(1-1)=2 by XCMPLX_1:37;
            hence thesis by XCMPLX_1:27;
           end;
A165:       inf divset(D2,(indx(D2,D1,j1)+2))=D2.(indx(D2,D1,j1)+1)
           & sup divset(D2,(indx(D2,D1,j1)+2))=D2.(indx(D2,D1,j1)+2)
           & inf divset(D2,(indx(D2,D1,j1)+1))=D2.indx(D2,D1,j1)
           & sup divset(D2,(indx(D2,D1,j1)+1))=D2.(indx(D2,D1,j1)+1)
           proof
A166:        indx(D2,D1,j1)+2 in dom D2 by A21,A45,A164,INTEGRA1:def 21;
              indx(D2,D1,j1)+1 in Seg len lower_volume(f,D2) by A126,FINSEQ_1:3
;
            then indx(D2,D1,j1)+1 in Seg len D2 by INTEGRA1:def 8;
then A167:        indx(D2,D1,j1)+1 in dom D2 by FINSEQ_1:def 3;
A168:        indx(D2,D1,j1)+1 <> 1 by A49,NAT_1:38;
              indx(D2,D1,j1)+1+1 > 1 by A126,NAT_1:38;
            then A169: indx(D2,D1,j1)+(1+1) > 1 by XCMPLX_1:1;
A170:        indx(D2,D1,j1)+2-1=indx(D2,D1,j1)+1 by Lm2,XCMPLX_1:29;
A171:        indx(D2,D1,j1)+1-1=indx(D2,D1,j1)+(1-1) by XCMPLX_1:29
            .=indx(D2,D1,j1)+0;
            thus inf divset(D2,(indx(D2,D1,j1)+2))=D2.(indx(D2,D1,j1)+1)
            & sup divset(D2,(indx(D2,D1,j1)+2))=D2.(indx(D2,D1,j1)+2)
            by A166,A169,A170,INTEGRA1:def 5;
            thus thesis by A167,A168,A171,INTEGRA1:def 5;
           end;
             vol(divset(D1,j))
            =sup divset(D1,j)-inf divset(D1,j) by INTEGRA1:def 6
           .=D2.indx(D2,D1,j)-(D2.(indx(D2,D1,j1)+1)
            -D2.(indx(D2,D1,j1)+1))-D2.indx(D2,D1,j1) by A163,XCMPLX_1:17
           .=D2.(indx(D2,D1,j1)+2)-D2.(indx(D2,D1,j1)+1)
            +D2.(indx(D2,D1,j1)+1)-D2.indx(D2,D1,j1) by A164,XCMPLX_1:37;
           then vol(divset(D1,j))
            =vol(divset(D2,indx(D2,D1,j1)+2))
            +D2.(indx(D2,D1,j1)+1)-D2.indx(D2,D1,j1) by A165,INTEGRA1:def 6
           .=vol(divset(D2,indx(D2,D1,j1)+2))
            +(sup divset(D2,indx(D2,D1,j1)+1)-inf divset(D2,indx(D2,D1,j1)+1))
           by A165,XCMPLX_1:29;
           hence thesis by INTEGRA1:def 6;
          end;

then A172:       lower_volume(f,D1).j=(inf(rng(f|divset(D1,j))))*
          (vol(divset(D2,indx(D2,D1,j1)+1))+vol(divset(D2,indx(D2,D1,j1)+2)))
          by A149,INTEGRA1:def 8;
A173:       vol(divset(D2,indx(D2,D1,j1)+1))>=0 by INTEGRA1:11;
A174:      vol(divset(D2,indx(D2,D1,j1)+2))>=0 by INTEGRA1:11;
          A175: Sum mid(LVf(D2),indx(D2,D1,j1)+1,indx(D2,D1,j))-Sum mid(LVf(D1)
,j,j)
          <=(sup rng f - inf rng f)*(vol(divset(D2,indx(D2,D1,j1)+2))
          +vol(divset(D2,indx(D2,D1,j1)+1)))
          proof
A176:      indx(D2,D1,j) in dom D2 by A21,A45,INTEGRA1:def 21;
A177:      indx(D2,D1,j)=indx(D2,D1,j1)+2
           proof
              indx(D2,D1,j)-'(indx(D2,D1,j1)+1)+1=2
            by A123,A125,A126,A158,JORDAN3:27;
            then indx(D2,D1,j)-(indx(D2,D1,j1)+1)+1=2 by A123,SCMFSA_7:3;
            then indx(D2,D1,j)-indx(D2,D1,j1)-1+1=2 by XCMPLX_1:36;
            then indx(D2,D1,j)-indx(D2,D1,j1)-(1-1)=2 by XCMPLX_1:37;
            hence thesis by XCMPLX_1:27;
           end;
then A178:       indx(D2,D1,j1)+2 in Seg len D2 by A176,FINSEQ_1:def 3;

           set ID1=indx(D2,D1,j1)+1;
           set ID2=indx(D2,D1,j1)+2;

A179:       Sum mid(LVf(D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))
            =(inf rng(f|divset(D2,indx(D2,D1,j1)+2)))
            *vol(divset(D2,indx(D2,D1,j1)+2))
            +LVf(D2).(indx(D2,D1,j1)+1) by A161,A178,INTEGRA1:def 8
           .=(inf rng(f|divset(D2,indx(D2,D1,j1)+2)))
            *vol(divset(D2,indx(D2,D1,j1)+2))
            +(inf rng(f|divset(D2,indx(D2,D1,j1)+1)))
            *vol(divset(D2,indx(D2,D1,j1)+1)) by A148,INTEGRA1:def 8;
              divset(D2,ID2)c=A by A176,A177,INTEGRA1:10;
           then inf rng(f|divset(D2,ID2)) <= sup rng f by A1,Lm7;
then A180:       (inf rng(f|divset(D2,ID2)))*vol(divset(D2,ID2))
           <=(sup rng f)*vol(divset(D2,ID2)) by A174,AXIOMS:25;
             ID1 in dom D2 by A148,FINSEQ_1:def 3;
           then divset(D2,ID1)c=A by INTEGRA1:10;
           then inf rng(f|divset(D2,ID1)) <= sup rng f by A1,Lm7;
then A181:       (inf rng(f|divset(D2,ID1)))*vol(divset(D2,ID1))
           <=(sup rng f)*vol(divset(D2,ID1)) by A173,AXIOMS:25;
             divset(D1,j) c=A by A45,INTEGRA1:10;
           then inf rng(f|divset(D1,j)) >= inf rng f by A1,Lm7;
then A182:      (inf rng(f|divset(D1,j)))*vol(divset(D2,ID2))
           >=(inf rng f)*vol(divset(D2,ID2))
           & (inf rng(f|divset(D1,j)))*vol(divset(D2,ID1))
           >=(inf rng f)*vol(divset(D2,ID1)) by A173,A174,AXIOMS:25;
             Sum mid(LVf(D2),ID1,indx(D2,D1,j))
           -(inf rng(f|divset(D2,ID1)))*vol(divset(D2,ID1))
           <=(sup rng f)*vol(divset(D2,ID2)) by A179,A180,XCMPLX_1:26;
           then Sum mid(LVf(D2),ID1,indx(D2,D1,j))
           <=(sup rng f)*vol(divset(D2,ID2))
           +(inf rng(f|divset(D2,ID1)))*vol(divset(D2,ID1)) by REAL_1:86;
           then Sum mid(LVf(D2),ID1,indx(D2,D1,j))-(sup rng f)*vol(divset(D2,
ID2))
           <=(inf rng(f|divset(D2,ID1)))*vol(divset(D2,ID1)) by REAL_1:86;
           then Sum mid(LVf(D2),ID1,indx(D2,D1,j))-(sup rng f)*vol(divset(D2,
ID2))
           <=(sup rng f)*vol(divset(D2,ID1)) by A181,AXIOMS:22;
then A183:    Sum mid(LVf(D2),ID1,indx(D2,D1,j))<=(sup rng f)*vol(divset(D2,ID2
))+
           (sup rng f)*vol(divset(D2,ID1)) by REAL_1:86;
             Sum mid(LVf(D1),j,j)
            =(inf rng(f|divset(D1,j)))*vol(divset(D2,indx(D2,D1,j1)+2))
            +(inf rng(f|divset(D1,j)))*vol(divset(D2,indx(D2,D1,j1)+1))
           by A147,A172,XCMPLX_1:8;
           then Sum mid(LVf(D1),j,j)-(inf rng(f|divset(D1,j)))*vol(divset(D2,
ID1))
           >=(inf rng f)*vol(divset(D2,ID2)) by A182,XCMPLX_1:26;
           then Sum mid(LVf(D1),j,j)>=(inf rng(f|divset(D1,j)))*vol(divset(D2,
ID1))
           +(inf rng f)*vol(divset(D2,ID2)) by REAL_1:84;
           then Sum mid(LVf(D1),j,j)-(inf rng f)*vol(divset(D2,ID2))
           >=(inf rng(f|divset(D1,j)))*vol(divset(D2,ID1)) by REAL_1:84;
           then Sum mid(LVf(D1),j,j)-(inf rng f)*vol(divset(D2,ID2))
           >=(inf rng f)*vol(divset(D2,ID1)) by A182,AXIOMS:22;
           then Sum mid(LVf(D1),j,j)
           >=(inf rng f)*vol(divset(D2,ID2))+(inf rng f)*vol(divset(D2,ID1))
           by REAL_1:84;
           then Sum mid(LVf(D2),ID1,indx(D2,D1,j))-Sum mid(LVf(D1),j,j)
           <=(sup rng f)*vol(divset(D2,ID2))+(sup rng f)*vol(divset(D2,ID1))
           -((inf rng f)*vol(divset(D2,ID2))+(inf rng f)*vol(divset(D2,ID1)))
           by A183,REAL_1:92;
           then Sum mid(LVf(D2),ID1,indx(D2,D1,j))-Sum mid(LVf(D1),j,j)
           <=((sup rng f)*vol(divset(D2,ID2))-(inf rng f)*vol(divset(D2,ID2)))
           +((sup rng f)*vol(divset(D2,ID1))-(inf rng f)*vol(divset(D2,ID1)))
           by Lm5;
           then Sum mid(LVf(D2),ID1,indx(D2,D1,j))-Sum mid(LVf(D1),j,j)
           <=(sup rng f - inf rng f)*vol(divset(D2,ID2))
           +((sup rng f)*vol(divset(D2,ID1))-(inf rng f)*vol(divset(D2,ID1)))
           by XCMPLX_1:40;
           then Sum mid(LVf(D2),ID1,indx(D2,D1,j))-Sum mid(LVf(D1),j,j)
           <=(sup rng f - inf rng f)*vol(divset(D2,ID2))
           +(sup rng f - inf rng f)*vol(divset(D2,ID1)) by XCMPLX_1:40;
           hence thesis by XCMPLX_1:8;
          end;
A184:      vol(divset(D1,j)) <= delta(D1) by A45,Lm8;
            sup rng f - inf rng f >= 0 by A18,SQUARE_1:12;
          then (sup rng f - inf rng f)*(vol(divset(D1,j)))
          <=(sup rng f - inf rng f)*delta(D1) by A184,AXIOMS:25;
          hence thesis by A162,A175,AXIOMS:22;
         end;
         hence thesis;
        end;

A185:    PLf(D2,indx(D2,D1,j1))
        +Sum mid(lower_volume(f,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))
        =PLf(D2,indx(D2,D1,j))
        proof
           indx(D2,D1,j) in dom D2 by A21,A45,INTEGRA1:def 21;
then A186:      indx(D2,D1,j) in Seg len D2 by FINSEQ_1:def 3;
         then A187: 1 <= indx(D2,D1,j) & indx(D2,D1,j) <= len D2 by FINSEQ_1:3;
then A188:      1 <= indx(D2,D1,j) & indx(D2,D1,j) <= len LVf(D2) by INTEGRA1:
def 8;
A189:      indx(D2,D1,j) in Seg len LVf(D2) by A186,INTEGRA1:def 8;
A190:      indx(D2,D1,j1) < indx(D2,D1,j) by A123,NAT_1:38;
           indx(D2,D1,j1) in Seg len D2 by A49,FINSEQ_1:def 3;
         then indx(D2,D1,j1) in Seg len LVf(D2) by INTEGRA1:def 8;
         then PLf(D2,indx(D2,D1,j1))
         =Sum(LVf(D2)|indx(D2,D1,j1)) by INTEGRA1:def 22;
         then PLf(D2,indx(D2,D1,j1))
         +Sum mid(lower_volume(f,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))
          =Sum(LVf(D2)|indx(D2,D1,j1)
          ^mid(LVf(D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))) by RVSUM_1:105
         .=Sum(mid(LVf(D2),1,indx(D2,D1,j1))
          ^mid(LVf(D2),indx(D2,D1,j1)+1,indx(D2,D1,j))) by A49,JORDAN3:25
         .=Sum(mid(LVf(D2),1,indx(D2,D1,j))) by A49,A188,A190,INTEGRA2:4
         .=Sum(LVf(D2)|indx(D2,D1,j)) by A187,JORDAN3:25;
         hence thesis by A189,INTEGRA1:def 22;
        end;

     PLf(D1,j1)+Sum mid(lower_volume(f,D1),j,j)=PLf(D1,j)
        proof
A191:      j in Seg len D1 by A45,FINSEQ_1:def 3;
         then A192: 1 <= j & j <= len D1 by FINSEQ_1:3;
then A193:      1 <= j & j <= len LVf(D1) by INTEGRA1:def 8;
A194:      j in Seg len LVf(D1) by A191,INTEGRA1:def 8;
A195:      j1+1=j by XCMPLX_1:27;
           j < j+1 by NAT_1:38;
then A196:      j1 < j by REAL_1:84;
           j1 in Seg len D1 by A51,FINSEQ_1:def 3;
         then j1 in Seg len LVf(D1) by INTEGRA1:def 8;
         then PLf(D1,j1)=Sum(LVf(D1)|j1) by INTEGRA1:def 22;
         then PLf(D1,j1)+Sum mid(LVf(D1),j,j)
          =Sum((LVf(D1)|j1)^mid(LVf(D1),j,j)) by RVSUM_1:105
         .=Sum(mid(LVf(D1),1,j1)^mid(LVf(D1),j1+1,j)) by A51,A195,JORDAN3:25
         .=Sum(mid(LVf(D1),1,j)) by A51,A193,A196,INTEGRA2:4
         .=Sum(LVf(D1)|j) by A192,JORDAN3:25;
         hence thesis by A194,INTEGRA1:def 22;
        end;

        then PLf(D2,indx(D2,D1,j))-PLf(D1,j)
         =(PLf(D2,indx(D2,D1,j1))-PLf(D1,j1))
         +(Sum mid(lower_volume(f,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))
          -Sum mid(lower_volume(f,D1),j,j)) by A185,Lm5
        .=0+(Sum mid(lower_volume(f,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))
          -Sum mid(lower_volume(f,D1),j,j)) by A122,XCMPLX_1:14;
        hence thesis by A124;
       end;
       hence thesis by A45;
      end;
A197: for i being non empty Nat st P[i] holds P[i+1]
      proof
       let i be non empty Nat;
       assume A198:P[i];
A199:    i>=1 by RLVECT_1:99;

         P[i+1]
       proof
        assume A200:i+1 in dom D;
        then D.(i+1) in A by INTEGRA1:8;
        then consider j such that
A201:     j in dom D1 & D.(i+1) in divset(D1,j) by Th2;
A202:     1 <= i+1 & i+1 <= len D by A200,FINSEQ_3:27;
          i <= i+1 by NAT_1:29;
        then i <= len D by A202,AXIOMS:22;
then A203:    i in Seg len D by A199,FINSEQ_1:3;
then A204:    i in dom D by FINSEQ_1:def 3;
        consider n1 being Nat such that
A205:     n1 in dom D1 & D.i in divset(D1,n1)
        & PLf(D2,indx(D2,D1,n1))-PLf(D1,n1)<=i*(sup rng f-inf rng f)*delta(D1)
        by A198,A203,FINSEQ_1:def 3;
A206:    indx(D2,D1,n1) in dom D2 & D2.indx(D2,D1,n1) = D1.n1
        by A21,A205,INTEGRA1:def 21;
then A207:    1 <= indx(D2,D1,n1) & indx(D2,D1,n1) <= len D2 by FINSEQ_3:27;

A208:     n1 < j
        proof
         assume A209:n1 >= j;
           now per cases by A209,REAL_1:def 5;
          suppose n1=j;
          then D.i in divset(D1,j) & D.i in rng D by A204,A205,FUNCT_1:def 5;
then A210:       D.i in rng D /\ divset(D1,j) by XBOOLE_0:def 3;
            D.(i+1) in rng D by A200,FUNCT_1:def 5;
          then D.(i+1) in rng D /\ divset(D1,j) by A201,XBOOLE_0:def 3;
then A211:       D.(i+1)=D.i by A20,A201,A210,Th4;
            i+1 > i by REAL_1:69;
          hence contradiction by A200,A204,A211,GOBOARD2:19;
          suppose n1>j;
then A212:       n1>=j+1 by NAT_1:38;
then A213:       n1-1 >= j by REAL_1:84;
A214:       inf divset(D1,n1) <= D.i by A205,INTEGRA2:1;
A215:       D.(i+1)<=sup divset(D1,j) by A201,INTEGRA2:1;
            1 <= j by A201,FINSEQ_3:27;
          then 1+1 <= j+1 by AXIOMS:24;
then A216:      n1 <> 1 by A212,AXIOMS:22;
          then n1-1 in dom D1 by A205,INTEGRA1:9;
then A217:       D1.j <= D1.(n1-1) by A201,A213,GOBOARD2:18;
A218:       sup divset(D1,j)=D1.j
          proof
           per cases;
            suppose j=1;
            hence thesis by A201,INTEGRA1:def 5;
            suppose j<>1;
            hence thesis by A201,INTEGRA1:def 5;
          end;
            D.i >= D1.(n1-1) by A205,A214,A216,INTEGRA1:def 5;
          then D.i >= D1.j by A217,AXIOMS:22;
then A219:      D.i >= D.(i+1) by A215,A218,AXIOMS:22;
            i < i+1 by REAL_1:69;
          hence contradiction by A200,A204,A219,GOBOARD1:def 1;
         end;
         hence thesis;
        end;
then A220:     n1+1 <= j by NAT_1:38;
then A221:     j-n1 >= 1 by REAL_1:84;
A222:    n1 >= 1 by A205,FINSEQ_3:27;
A223:    1 <= n1 & 1 <= j & j <= len D1 by A201,A205,FINSEQ_3:27;
then A224:    1 <= n1+1 & n1+1 <= len D1 by A220,AXIOMS:22,NAT_1:37;
then A225:     n1+1 in dom D1 by FINSEQ_3:27;
then A226:    indx(D2,D1,n1+1) in dom D2 & D2.indx(D2,D1,n1+1)=D1.(n1+1)
        by A21,INTEGRA1:def 21;
A227:    indx(D2,D1,j) in dom D2 & D2.indx(D2,D1,j)=D1.j
        by A21,A201,INTEGRA1:def 21;
        then D2.indx(D2,D1,n1+1) <= D2.indx(D2,D1,j)
        by A201,A220,A225,A226,GOBOARD2:18;
then A228:    indx(D2,D1,n1+1) <= indx(D2,D1,j) by A226,A227,GOBOARD1:def 1;
A229:    1 <= indx(D2,D1,n1+1) & indx(D2,D1,n1+1) <= len D2 by A226,FINSEQ_3:27
;
A230:    1 <= indx(D2,D1,j) & indx(D2,D1,j) <= len D2 by A227,FINSEQ_3:27;
          n1 < n1+1 by NAT_1:38;
        then D1.n1 < D1.(n1+1) by A205,A225,GOBOARD1:def 1;
then A231:   indx(D2,D1,n1) < indx(D2,D1,n1+1) by A206,A226,GOBOARD2:18;
          1+indx(D2,D1,n1+1) <= indx(D2,D1,j)+1 by A228,AXIOMS:24;
        then 1 <= indx(D2,D1,j)+1-indx(D2,D1,n1+1) by REAL_1:84;
then A232:     mid(D2,indx(D2,D1,n1+1),indx(D2,D1,j)).1
        =D2.(1-1+indx(D2,D1,n1+1)) by A228,A229,A230,JORDAN3:31
        .=D1.(n1+1) by A21,A225,INTEGRA1:def 21;
A233:    Sum mid(LVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j))
        -Sum mid(LVf(D1),n1+1,j) <= (sup rng f-inf rng f)*delta(D1)
        proof
          now per cases by A220,REAL_1:def 5;
        suppose A234:n1+1=j;
then A235:    n1=j-1 by XCMPLX_1:26;
A236:     1 <= n1+1 & n1+1 <= len LVf(D1) by A224,INTEGRA1:def 8;
A237:     n1+1 in Seg len D1 by A225,FINSEQ_1:def 3;
A238:     len mid(LVf(D1),n1+1,j)=j-'(n1+1)+1 by A234,A236,JORDAN3:27
         .=j-j+1 by A234,SCMFSA_7:3
        .= 1 by XCMPLX_1:25;
          (n1+1)+1 <= j+1 by A220,AXIOMS:24;
        then 1 <= j+1-(n1+1) by REAL_1:84;
        then mid(LVf(D1),n1+1,j).1
         =LVf(D1).(1-1+(n1+1)) by A234,A236,JORDAN3:31
        .=(inf rng(f|divset(D1,n1+1)))*vol(divset(D1,n1+1))
        by A237,INTEGRA1:def 8;
        then mid(LVf(D1),n1+1,j)
        =<*(inf rng(f|divset(D1,n1+1)))*vol(divset(D1,n1+1))*>
        by A238,FINSEQ_1:57;
then A239:     Sum mid(LVf(D1),n1+1,j)
        =(inf rng(f|divset(D1,n1+1)))*vol(divset(D1,n1+1)) by RVSUM_1:103;
          divset(D1,n1+1) c= A by A225,INTEGRA1:10;
then A240:   inf rng(f|divset(D1,n1+1)) >= inf rng f by A1,Lm7;
          vol(divset(D1,n1+1)) >= 0 by INTEGRA1:11;
then A241:    Sum mid(LVf(D1),n1+1,j)
        >=(inf rng f)*vol(divset(D1,n1+1)) by A239,A240,AXIOMS:25;
A242:    indx(D2,D1,n1)<indx(D2,D1,j)
        proof
           D1.n1 < D1.j by A201,A205,A208,GOBOARD1:def 1;
         hence thesis by A206,A227,GOBOARD2:18;
        end;
then A243:    indx(D2,D1,n1)+1 <= indx(D2,D1,j) by NAT_1:38;
        then indx(D2,D1,n1)+1 <= len D2 by A230,AXIOMS:22;
then A244:     indx(D2,D1,n1)+1 <= len LVf(D2) by INTEGRA1:def 8;
A245:     1<=indx(D2,D1,n1)+1 by NAT_1:37;
A246:    indx(D2,D1,j) <= len LVf(D2) by A230,INTEGRA1:def 8;
then A247:    len mid(LVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j))
        =indx(D2,D1,j)-'(indx(D2,D1,n1)+1)+1 by A230,A243,A244,A245,JORDAN3:27
        .=indx(D2,D1,j)-(indx(D2,D1,n1)+1)+1 by A243,SCMFSA_7:3
        .=indx(D2,D1,j)-indx(D2,D1,n1)-1+1 by XCMPLX_1:36
        .=indx(D2,D1,j)-indx(D2,D1,n1)-(1-1) by XCMPLX_1:37
        .=indx(D2,D1,j)-indx(D2,D1,n1);

A248:    indx(D2,D1,j)-indx(D2,D1,n1)<=2
        proof
         assume indx(D2,D1,j) - indx(D2,D1,n1) > 2;
then A249:     indx(D2,D1,n1)+2 < indx(D2,D1,j) by REAL_1:86;
A250:     indx(D2,D1,n1) < indx(D2,D1,n1)+1 by NAT_1:38;
A251:     indx(D2,D1,n1)+1 < indx(D2,D1,n1)+2 by REAL_1:53;
A252:     indx(D2,D1,n1)+1 < indx(D2,D1,j) & indx(D2,D1,n1)+1 in dom D2
         proof
          thus indx(D2,D1,n1)+1 < indx(D2,D1,j) by A249,A251,AXIOMS:22;
          then 1 <= indx(D2,D1,n1)+1 & indx(D2,D1,n1)+1 <= len D2
          by A207,A230,AXIOMS:22,NAT_1:38;
          hence thesis by FINSEQ_3:27;
         end;
A253:     D2.(indx(D2,D1,n1)+1) in rng D
         proof
          A254: D2.(indx(D2,D1,n1)+1) in rng D2 by A252,FUNCT_1:def 5;
            not( D2.(indx(D2,D1,n1)+1) in rng D1 )
          proof
           assume D2.(indx(D2,D1,n1)+1) in rng D1;
           then consider k1 being Nat such that
A255:       k1 in dom D1 & D2.(indx(D2,D1,n1)+1) = D1.k1 by PARTFUN1:26;
             D2.indx(D2,D1,n1) < D2.(indx(D2,D1,n1)+1)
           & D2.(indx(D2,D1,n1)+1) < D2.indx(D2,D1,j)
           by A206,A227,A250,A252,GOBOARD1:def 1;
           then n1 < k1 & k1 < j by A201,A205,A206,A227,A255,GOBOARD2:18;
           hence contradiction by A234,NAT_1:38;
          end;
          hence thesis by A21,A254,XBOOLE_0:def 2;
         end;
A256:     D2.(indx(D2,D1,n1)+1) in rng D /\ divset(D1,j)
         proof
A257:      inf divset(D1,j) = D1.(j-1) & sup divset(D1,j) = D1.j
          by A201,A208,A222,INTEGRA1:def 5;
            D2.(indx(D2,D1,n1)+1) >= D2.indx(D2,D1,n1)
          & D2.indx(D2,D1,j) >= D2.(indx(D2,D1,n1)+1)
          by A206,A227,A250,A252,GOBOARD2:18;
          then D2.(indx(D2,D1,n1)+1) in divset(D1,j)
          by A206,A227,A235,A257,INTEGRA2:1;
          hence thesis by A253,XBOOLE_0:def 3;
         end;
A258:     indx(D2,D1,n1) < indx(D2,D1,n1)+2 & indx(D2,D1,n1)+2 in dom D2
         proof
          thus indx(D2,D1,n1) < indx(D2,D1,n1)+2 by A251,NAT_1:38;
          then 1 <= indx(D2,D1,n1)+2 & indx(D2,D1,n1)+2 <= len D2
          by A207,A230,A249,AXIOMS:22;
          hence thesis by FINSEQ_3:27;
         end;
A259:     D2.(indx(D2,D1,n1)+2) in rng D
         proof
          A260: D2.(indx(D2,D1,n1)+2) in rng D2 by A258,FUNCT_1:def 5;
            not D2.(indx(D2,D1,n1)+2) in rng D1
          proof
           assume D2.(indx(D2,D1,n1)+2) in rng D1;
           then consider k1 being Nat such that
A261:       k1 in dom D1 & D2.(indx(D2,D1,n1)+2) = D1.k1 by PARTFUN1:26;
             D2.indx(D2,D1,n1) < D2.(indx(D2,D1,n1)+2)
           & D2.(indx(D2,D1,n1)+2) < D2.indx(D2,D1,j)
           by A206,A227,A249,A258,GOBOARD1:def 1;
           then n1 < k1 & k1 < j by A201,A205,A206,A227,A261,GOBOARD2:18;
           hence contradiction by A234,NAT_1:38;
          end;
          hence thesis by A21,A260,XBOOLE_0:def 2;
         end;
     D2.(indx(D2,D1,n1)+2) in rng D /\ divset(D1,j)
         proof
A262:     inf divset(D1,j) = D1.(j-1) & sup divset(D1,j) = D1.j
          by A201,A208,A222,INTEGRA1:def 5;
            D2.(indx(D2,D1,n1)+2) >= D2.indx(D2,D1,n1)
          & D2.indx(D2,D1,j) >= D2.(indx(D2,D1,n1)+2)
          by A206,A227,A249,A258,GOBOARD2:18;
          then D2.(indx(D2,D1,n1)+2) in divset(D1,j)
          by A206,A227,A235,A262,INTEGRA2:1;
          hence thesis by A259,XBOOLE_0:def 3;
         end;
         then D2.(indx(D2,D1,n1)+1) = D2.(indx(D2,D1,n1)+2) by A20,A201,A256,
Th4;
         hence contradiction by A251,A252,A258,GOBOARD1:def 1;
        end;
A263:    indx(D2,D1,j)-indx(D2,D1,n1)=1 or indx(D2,D1,j)-indx(D2,D1,n1)=2
        proof
           indx(D2,D1,n1)+1 <= indx(D2,D1,j) by A242,NAT_1:38;
then A264:     indx(D2,D1,n1)+1 = indx(D2,D1,j) or
         indx(D2,D1,n1)+1 < indx(D2,D1,j) by REAL_1:def 5;
           indx(D2,D1,n1)+1<indx(D2,D1,j) implies indx(D2,D1,n1)+2=indx(D2,D1,j
)
         proof
          assume indx(D2,D1,n1)+1 < indx(D2,D1,j);
          then indx(D2,D1,n1)+1+1 <= indx(D2,D1,j) by NAT_1:38;
then A265:      indx(D2,D1,n1)+(1+1) <= indx(D2,D1,j) by XCMPLX_1:1;
            indx(D2,D1,n1)+2 >= indx(D2,D1,j) by A248,REAL_1:86;
          hence thesis by A265,AXIOMS:21;
         end;
         hence thesis by A264,XCMPLX_1:26;
        end;
          Sum mid(LVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j))
        <=(sup rng f)*vol(divset(D1,n1+1))
        proof
         per cases by A263;
          suppose A266:indx(D2,D1,j)-indx(D2,D1,n1)=1;
          then 1=indx(D2,D1,j)-indx(D2,D1,n1)-1+1
          .=indx(D2,D1,j)-(indx(D2,D1,n1)+1)+1 by XCMPLX_1:36;
then A267:      mid(LVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j)).1
          =LVf(D2).(1+(indx(D2,D1,n1)+1)-1) by A243,A245,A246,JORDAN3:31
          .=LVf(D2).((indx(D2,D1,n1)+1)-1+1) by XCMPLX_1:29
          .=LVf(D2).((indx(D2,D1,n1)+1)-(1-1)) by XCMPLX_1:37
          .=LVf(D2).(indx(D2,D1,n1)+1);
A268:      indx(D2,D1,n1)+1=indx(D2,D1,j) by A266,XCMPLX_1:27;
then indx(D2,D1,n1)+1 in Seg len D2 by A227,FINSEQ_1:def 3;
then A269:      LVf(D2).(indx(D2,D1,n1)+1)
          =(inf rng(f|divset(D2,indx(D2,D1,n1)+1)))
           *vol(divset(D2,indx(D2,D1,n1)+1)) by INTEGRA1:def 8;
A270:      divset(D2,indx(D2,D1,n1)+1)=divset(D1,n1+1)
          proof
A271:       divset(D2,indx(D2,D1,n1)+1) =[.inf divset(D2,indx(D2,D1,n1)+1),
           sup divset(D2,indx(D2,D1,n1)+1).] by INTEGRA1:5;
A272:       divset(D1,n1+1)=[.inf divset(D1,n1+1), sup divset(D1,n1+1).]
           by INTEGRA1:5;
             indx(D2,D1,n1)+1 > 1 by A207,NAT_1:38;
           then inf divset(D2,indx(D2,D1,n1)+1)=D2.(indx(D2,D1,n1)+1-1)
           & sup divset(D2,indx(D2,D1,n1)+1)=D2.(indx(D2,D1,n1)+1)
           by A227,A268,INTEGRA1:def 5;
then A273:       inf divset(D2,indx(D2,D1,n1)+1)=D1.n1
           & sup divset(D2,indx(D2,D1,n1)+1)=D1.j by A21,A201,A206,A268,
INTEGRA1:def 21,XCMPLX_1:26;
             inf divset(D1,n1+1)=D1.(n1+1-1) & sup divset(D1,n1+1)=D1.(n1+1)
           by A208,A222,A225,A234,INTEGRA1:def 5;
           hence thesis by A234,A271,A272,A273,XCMPLX_1:26;
          end;
A274:      inf rng(f|divset(D2,indx(D2,D1,n1)+1))<=sup rng f by A1,A227,A268,
Th17;
            vol(divset(D2,indx(D2,D1,n1)+1))>=0 by INTEGRA1:11;
then A275:      LVf(D2).(indx(D2,D1,n1)+1)
          <=(sup rng f)*vol(divset(D1,n1+1)) by A269,A270,A274,AXIOMS:25;
            mid(LVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j))
          =<*LVf(D2).(indx(D2,D1,n1)+1)*> by A247,A266,A267,FINSEQ_1:57;
          hence thesis by A275,RVSUM_1:103;
          suppose A276:indx(D2,D1,j)-indx(D2,D1,n1)=2;
then A277:      indx(D2,D1,j)=indx(D2,D1,n1)+2 by XCMPLX_1:27;
A278:      indx(D2,D1,n1)+2-1=indx(D2,D1,n1)+(2-1) by XCMPLX_1:29
          .=indx(D2,D1,n1)+1;
          then indx(D2,D1,j)-(indx(D2,D1,n1)+1)=1 by A277,XCMPLX_1:18;
then A279:     indx(D2,D1,j)-(indx(D2,D1,n1)+1)+1>=1;
A280:     indx(D2,D1,j)-(indx(D2,D1,n1)+1)+1=1+1 by A277,A278,XCMPLX_1:18;

A281:      1 <= indx(D2,D1,n1)+1 & indx(D2,D1,n1)+1 <= indx(D2,D1,n1)+2
          by NAT_1:37,REAL_1:53;
          then indx(D2,D1,n1)+1 <= len D2 by A230,A277,AXIOMS:22;
then A282:      indx(D2,D1,n1)+1 in dom D2 by A281,FINSEQ_3:27;
A283:     indx(D2,D1,j) <= len LVf(D2) by A230,INTEGRA1:def 8;
then A284:      mid(LVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j)).1
          =LVf(D2).(1+(indx(D2,D1,n1)+1)-1)
          by A277,A279,A281,JORDAN3:31
          .=LVf(D2).((indx(D2,D1,n1)+1)-1+1) by XCMPLX_1:29
          .=LVf(D2).((indx(D2,D1,n1)+1)-(1-1)) by XCMPLX_1:37
          .=LVf(D2).(indx(D2,D1,n1)+1);
            mid(LVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j)).2
          =LVf(D2).(2+(indx(D2,D1,n1)+1)-1)
          by A277,A280,A281,A283,JORDAN3:31
          .=LVf(D2).((indx(D2,D1,n1)+1)-1+2) by XCMPLX_1:29
          .=LVf(D2).(indx(D2,D1,n1)+(1-1)+2) by XCMPLX_1:29
          .=LVf(D2).(indx(D2,D1,n1)+0+2);
          then mid(LVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j))
          =<*LVf(D2).(indx(D2,D1,n1)+1),LVf(D2).(indx(D2,D1,n1)+2)*>
          by A247,A276,A284,FINSEQ_1:61;
then A285:      Sum mid(LVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j))
          =LVf(D2).(indx(D2,D1,n1)+1)+LVf(D2).(indx(D2,D1,n1)+2)
          by RVSUM_1:107;

A286:      LVf(D2).(indx(D2,D1,n1)+1)
          <= (sup rng f)*vol(divset(D2,indx(D2,D1,n1)+1))
          proof
             indx(D2,D1,n1)+1 in Seg len D2 by A282,FINSEQ_1:def 3;
then A287:      LVf(D2).(indx(D2,D1,n1)+1)
           =(inf rng(f|divset(D2,indx(D2,D1,n1)+1)))
            *vol(divset(D2,indx(D2,D1,n1)+1)) by INTEGRA1:def 8;
A288:      inf rng(f|divset(D2,indx(D2,D1,n1)+1))
           <=sup rng f by A1,A282,Th17;
             vol(divset(D2,indx(D2,D1,n1)+1)) >= 0 by INTEGRA1:11;
           hence thesis by A287,A288,AXIOMS:25;
          end;
            LVf(D2).(indx(D2,D1,n1)+2)
          <= (sup rng f)*vol(divset(D2,indx(D2,D1,n1)+2))
          proof
             indx(D2,D1,n1)+2 in Seg len D2 by A227,A277,FINSEQ_1:def 3;
then A289:      LVf(D2).(indx(D2,D1,n1)+2)
           =(inf rng(f|divset(D2,indx(D2,D1,n1)+2)))
            *vol(divset(D2,indx(D2,D1,n1)+2)) by INTEGRA1:def 8;
A290:      inf rng(f|divset(D2,indx(D2,D1,n1)+2))
           <=sup rng f by A1,A227,A277,Th17;
             vol(divset(D2,indx(D2,D1,n1)+2)) >= 0 by INTEGRA1:11;
           hence thesis by A289,A290,AXIOMS:25;
          end;
then A291:      Sum mid(LVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j))
          <= (sup rng f)*vol(divset(D2,indx(D2,D1,n1)+1))
          + (sup rng f)*vol(divset(D2,indx(D2,D1,n1)+2)) by A285,A286,REAL_1:55
;
            vol(divset(D2,indx(D2,D1,n1)+1))+vol(divset(D2,indx(D2,D1,n1)+2))
          =vol(divset(D1,n1+1))
          proof
             indx(D2,D1,n1)+1 > 1 by A207,NAT_1:38;
then A292:       inf divset(D2,indx(D2,D1,n1)+1) = D2.(indx(D2,D1,n1)+1-1)
           & sup divset(D2,indx(D2,D1,n1)+1)=D2.(indx(D2,D1,n1)+1)
           by A282,INTEGRA1:def 5;
then A293:       inf divset(D2,indx(D2,D1,n1)+1) = D2.indx(D2,D1,n1) by
XCMPLX_1:26;
             indx(D2,D1,n1)+2 >= 2+1 by A207,AXIOMS:24;
           then indx(D2,D1,n1)+2 <> 1;
then A294:       inf divset(D2,indx(D2,D1,n1)+2) = D2.(indx(D2,D1,n1)+1)
           & sup divset(D2,indx(D2,D1,n1)+2)=D2.indx(D2,D1,j)
           by A227,A277,A278,INTEGRA1:def 5;
A295:      vol(divset(D2,indx(D2,D1,n1)+1))
            =D2.(indx(D2,D1,n1)+1)-D1.n1 by A206,A292,A293,INTEGRA1:def 6;
           A296: vol(divset(D2,indx(D2,D1,n1)+2))
            =D1.j-D2.(indx(D2,D1,n1)+1) by A227,A294,INTEGRA1:def 6;
             vol(divset(D1,n1+1))=D1.(n1+1)-D1.n1
           proof
A297:        inf divset(D1,n1+1)=D1.(n1+1-1) & sup divset(D1,n1+1)=D1.(n1+1)
            by A208,A222,A225,A234,INTEGRA1:def 5;
              vol(divset(D1,n1+1))=sup divset(D1,n1+1)-inf divset(D1,n1+1)
            by INTEGRA1:def 6;
            hence thesis by A297,XCMPLX_1:26;
           end;
           hence thesis by A234,A295,A296,XCMPLX_1:39;
          end;
          hence thesis by A291,XCMPLX_1:8;
        end;
        then Sum mid(LVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j))-Sum mid(LVf(D1),
n1+1,j)
        <=(sup rng f)*vol(divset(D1,n1+1))-(inf rng f)*vol(divset(D1,n1+1))
        by A241,REAL_1:92;
then A298:  Sum mid(LVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j))-Sum mid(LVf(D1),n1+
1,j)
        <=(sup rng f-inf rng f)*vol(divset(D1,n1+1)) by XCMPLX_1:40;
          sup rng f >= inf rng f by A1,Lm6;
then A299:    sup rng f-inf rng f >= 0 by SQUARE_1:12;
          vol(divset(D1,n1+1))<=delta(D1)
        proof
A300:     n1+1 in Seg len D1 by A225,FINSEQ_1:def 3;
then A301:     vol(divset(D1,n1+1))=upper_volume(chi(A,A),D1).(n1+1) by
INTEGRA1:22;
           n1+1 in Seg len upper_volume(chi(A,A),D1) by A300,INTEGRA1:def 7;
         then n1+1 in dom upper_volume(chi(A,A),D1) by FINSEQ_1:def 3;
then A302:     vol(divset(D1,n1+1)) in rng upper_volume(chi(A,A),D1)
         by A301,FUNCT_1:def 5;
           delta(D1)=max rng upper_volume(chi(A,A),D1) by INTEGRA1:def 19;
         hence thesis by A302,PRE_CIRC:def 1;
        end;
        then (sup rng f-inf rng f)*vol(divset(D1,n1+1))
        <=(sup rng f-inf rng f)*delta(D1) by A299,AXIOMS:25;
        hence Sum mid(LVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j))
        -Sum mid(LVf(D1),n1+1,j) <= (sup rng f-inf rng f)*delta(D1)
        by A298,AXIOMS:22;

        suppose A303:n1+1 < j;
A304:    n1 < n1+1 by NAT_1:38;
then A305:    D1.n1 < D1.(n1+1) by A205,A225,GOBOARD1:def 1;
        then consider B being closed-interval Subset of REAL,
        MD1,MD2 being Element of divs B such that
A306:    D1.n1=inf B & sup B=MD2.(len MD2) & sup B=MD1.(len MD1) & MD1 <= MD2
        & MD1=mid(D1,n1+1,j) & MD2=mid(D2,indx(D2,D1,n1+1),indx(D2,D1,j))
        by A21,A201,A220,A225,A232,Th14;
A307:   len MD1 = j-'(n1+1)+1 by A220,A223,A224,A306,JORDAN3:27;
          j-'(n1+1) = j-(n1+1) by A220,SCMFSA_7:3;
then A308:     j-'(n1+1)+1=j-n1-1+1 by XCMPLX_1:36 .= j-n1-(1-1) by XCMPLX_1:37
        .=j-n1;
then A309:    len MD1 = j-n1 by A220,A223,A224,A306,JORDAN3:27;
A310:    len MD1+(n1+1)-1 = j-(n1+1)+1+(n1+1)-1 by A220,A307,SCMFSA_7:3
        .=j-((n1+1)-1)+(n1+1)-1 by XCMPLX_1:37
        .=j-((n1+1)-1)+((n1+1)-1) by XCMPLX_1:29
        .=j-(((n1+1)-1)-((n1+1)-1)) by XCMPLX_1:37
        .=j by XCMPLX_1:17;
A311:   B c= A
        proof
          let x1; assume A312:x1 in B;
          then reconsider x1 as Real;
A313:       rng D1 c= A by INTEGRA1:def 2;
A314:       D1.n1 <= x1 & x1 <= MD1.(len MD1) by A306,A312,INTEGRA2:1;
            D1.n1 in rng D1 & D1.j in rng D1 by A201,A205,FUNCT_1:def 5;
then A315:       inf A <= D1.n1 & D1.j <= sup A by A313,INTEGRA2:1;
            MD1.(len MD1)=D1.(j-n1-1+(n1+1))
             by A220,A221,A223,A224,A306,A308,A309,JORDAN3:31
          .=D1.(j-(n1+1)+(n1+1)) by XCMPLX_1:36
          .=D1.(j-((n1+1)-(n1+1))) by XCMPLX_1:37
          .=D1.j by XCMPLX_1:17;
          then inf A <= x1 & x1 <= sup A by A314,A315,AXIOMS:22;
          hence thesis by INTEGRA2:1;
        end;
        then reconsider g=f|B as Function of B,REAL by FUNCT_2:38;

A316:    g is_bounded_on B
        proof
A317:     f is_bounded_above_on A&f is_bounded_below_on A by A1,RFUNCT_1:def 11
;
         then consider a be real number such that
A318:     for x being Element of A st x in A /\ dom f holds a<=f.x
         by RFUNCT_1:def 10;
           for x being Element of B st x in B /\ dom g holds a<=g.x
         proof
          let x be Element of B; assume x in B /\ dom g;
then A319:     x in dom g by XBOOLE_0:def 3;
then A320:     x in dom f /\ B by FUNCT_1:68;
          reconsider x as Element of A by A311,TARSKI:def 3;
            dom f /\ B c= dom f /\ A by A311,XBOOLE_1:26;
          then a <= f.x by A318,A320;
          hence thesis by A319,FUNCT_1:68;
         end;
then A321:     g is_bounded_below_on B by RFUNCT_1:def 10;
         consider a be real number such that
A322:     for x being Element of A st x in A /\ dom f holds f.x<=a
         by A317,RFUNCT_1:def 9;
           for x being Element of B st x in B /\ dom g holds g.x<=a
         proof
          let x be Element of B; assume x in B /\ dom g;
then A323:      x in dom g by XBOOLE_0:def 3;
then A324:      x in dom f /\ B by FUNCT_1:68;
          reconsider x as Element of A by A311,TARSKI:def 3;
            dom f /\ B c= dom f /\ A by A311,XBOOLE_1:26;
          then a >= f.x by A322,A324;
          hence thesis by A323,FUNCT_1:68;
         end;
         then g is_bounded_above_on B by RFUNCT_1:def 9;
         hence thesis by A321,RFUNCT_1:def 11;
        end;

          rng MD2 <> {};
        then 1 in dom MD2 by FINSEQ_3:34;
then A325:   1 <= len MD2 by FINSEQ_3:27;
A326:   len MD2=indx(D2,D1,j)-'indx(D2,D1,n1+1)+1
        by A228,A229,A230,A306,JORDAN3:27;
A327:     1 <= indx(D2,D1,j)-'indx(D2,D1,n1+1)+1
         by A228,A229,A230,A306,A325,JORDAN3:27;
A328:    len MD2 = indx(D2,D1,j)-indx(D2,D1,n1+1)+1 by A228,A326,SCMFSA_7:3;
        then len MD2-1=indx(D2,D1,j)-indx(D2,D1,n1+1) by XCMPLX_1:26;
then A329:     len MD2-1+indx(D2,D1,n1+1)=indx(D2,D1,j) by XCMPLX_1:27;
A330:    rng MD2 = rng MD1 \/ {D.(i+1)}
        proof
           x1 in rng MD2 implies x1 in (rng MD1 \/ {D.(i+1)})
         proof
          assume A331:x1 in rng MD2;
          then reconsider x1 as Real;
A332:     MD2.1=D2.(1+indx(D2,D1,n1+1)-1) by A228,A229,A230,A306,A327,JORDAN3:
31
          .=D2.indx(D2,D1,n1+1) by XCMPLX_1:26;
            MD2.(len MD2)=D2.indx(D2,D1,j)
             by A228,A229,A230,A306,A325,A326,A329,JORDAN3:31;
then A333:      D1.(n1+1) <= x1 & x1 <= D1.j by A226,A227,A331,A332,Th15;
          A334: rng MD2 c= rng D2 by A306,JORDAN3:28;
            now per cases by A21,A331,A334,XBOOLE_0:def 2;
           suppose x1 in rng D1;
           then consider k such that
A335:       k in dom D1 & D1.k = x1 by PARTFUN1:26;
A336:       n1+1 <= k & k <= j by A201,A225,A333,A335,GOBOARD1:def 1;
then A337:       1 <= k-n1 & k-n1 <= len MD1 by A309,REAL_1:49,84;
             j-(n1+1)+1=j-n1-1+1 by XCMPLX_1:36 .=j-n1-(1-1) by XCMPLX_1:37
           .=j-n1;
then A338:       k-n1 <= j-(n1+1)+1 by A336,REAL_1:49;
             n1 <= n1+1 by NAT_1:29;
           then n1 <= k by A336,AXIOMS:22;
           then consider n such that
A339:       k=n1+n by NAT_1:28;
A340:       n = k-n1 by A339,XCMPLX_1:26;
           then n in dom MD1 by A337,FINSEQ_3:27;
then A341:       MD1.n in rng MD1 by FUNCT_1:def 5;
             MD1.n = D1.(k-n1-1+(n1+1)) by A220,A223,A224,A306,A337,A338,A340,
JORDAN3:31
           .= D1.(k-(n1+1)+(n1+1)) by XCMPLX_1:36
           .= D1.(k-((n1+1)-(n1+1))) by XCMPLX_1:37
           .= D1.k by XCMPLX_1:17;
           hence x1 in (rng MD1 \/ {D.(i+1)}) by A335,A341,XBOOLE_0:def 2;
           suppose x1 in rng D;
           then consider n such that
A342:       n in dom D & D.n = x1 by PARTFUN1:26;
A343:       D.i <= sup divset(D1,n1) by A205,INTEGRA2:1;
             sup divset(D1,n1)=D1.n1
           proof
            per cases;
             suppose n1=1;
             hence thesis by A205,INTEGRA1:def 5;
             suppose n1<>1;
             hence thesis by A205,INTEGRA1:def 5;
           end;
           then D.i < D1.(n1+1) by A305,A343,AXIOMS:22;
           then D.i < D.n by A333,A342,AXIOMS:22;
           then i < n by A204,A342,GOBOARD2:18;
           then i+1 <= n by NAT_1:38;
then A344:      i+1 = n or i+1 < n by REAL_1:def 5;
             not i+1 < n
           proof
            assume i+1 < n;
then A345:       D.(i+1) < D.n by A200,A342,GOBOARD1:def 1;
              inf divset(D1,j) <= D.(i+1) by A201,INTEGRA2:1;
then A346:       inf divset(D1,j) <= D.n by A345,AXIOMS:22;
              sup divset(D1,j)=D1.j
            proof
             per cases;
              suppose j=1;
              hence thesis by A201,INTEGRA1:def 5;
              suppose j<>1;
              hence thesis by A201,INTEGRA1:def 5;
            end;
            then D.n in rng D&D.n in divset(D1,j)
            by A333,A342,A346,FUNCT_1:def 5,INTEGRA2:1;
then A347:        x1 in rng D /\ divset(D1,j) by A342,XBOOLE_0:def 3;
A348:        D.(i+1) in rng D by A200,FUNCT_1:def 5;
            consider y1 being Real such that
A349:        y1=D.(i+1);
              y1 in rng D /\ divset(D1,j) by A201,A348,A349,XBOOLE_0:def 3;
            hence contradiction by A20,A201,A342,A345,A347,A349,Th4;
           end;
           then x1 in {D.(i+1)} by A342,A344,TARSKI:def 1;
           hence x1 in (rng MD1 \/ {D.(i+1)}) by XBOOLE_0:def 2;
          end;
          hence thesis;
         end;
then A350:      rng MD2 c= rng MD1 \/ {D.(i+1)} by TARSKI:def 3;
           x1 in (rng MD1 \/ {D.(i+1)}) implies x1 in rng MD2
         proof
          assume A351:x1 in rng MD1 \/ {D.(i+1)};
          then reconsider x1 as Real;
            now per cases by A351,XBOOLE_0:def 2;
           suppose A352:x1 in rng MD1;
             rng MD1 c= rng D1 by A306,JORDAN3:28;
then A353:        x1 in rng D1 by A352;
             rng MD1 <> {};
           then 1 in dom MD1 by FINSEQ_3:34;
then A354:       1 <= len MD1 by FINSEQ_3:27;
A355:        len MD1=j-'(n1+1)+1 by A220,A223,A224,A306,JORDAN3:27;
then A356:       MD1.1=D1.(1+(n1+1)-1) by A220,A223,A224,A306,A354,JORDAN3:31
           .=D1.((n1+1)-1+1) by XCMPLX_1:29 .=D1.((n1+1)-(1-1)) by XCMPLX_1:37
           .=D1.(n1+1);
        len MD1+(n1+1)-1=j-(n1+1)+1+(n1+1)-1 by A220,A355,SCMFSA_7:3
           .=j-((n1+1)-1)+(n1+1)-1 by XCMPLX_1:37
           .=j-((n1+1)-1)+((n1+1)-1) by XCMPLX_1:29
           .=j-(((n1+1)-1)-((n1+1)-1)) by XCMPLX_1:37
           .=j by XCMPLX_1:17;
           then MD1.(len MD1)
            =D1.j by A220,A223,A224,A306,A354,A355,JORDAN3:31;
then A357:       D2.indx(D2,D1,n1+1) <= x1 & x1 <= D2.indx(D2,D1,j)
           by A226,A227,A352,A356,Th15;
             rng D1 c= rng D2 by A21,INTEGRA1:def 20;
           then consider k such that
A358:       k in dom D2 & D2.k = x1 by A353,PARTFUN1:26;
A359:       indx(D2,D1,n1+1)<=k & k<=indx(D2,D1,j)
           by A226,A227,A357,A358,GOBOARD1:def 1;
           then indx(D2,D1,n1+1)+1<=k+1 by AXIOMS:24;
           then 1 <= k+1-indx(D2,D1,n1+1) by REAL_1:84;
then A360:       1 <= k-indx(D2,D1,n1+1)+1 by XCMPLX_1:29;
             k-indx(D2,D1,n1+1)<=indx(D2,D1,j)-indx(D2,D1,n1+1)
           by A359,REAL_1:49;
then A361:      k-indx(D2,D1,n1+1)+1<=indx(D2,D1,j)-indx(D2,D1,n1+1)+1 by
AXIOMS:24;
             indx(D2,D1,n1+1)<=k+1 by A359,NAT_1:37;
           then consider n such that
A362:       k+1 = indx(D2,D1,n1+1)+n by NAT_1:28;
A363:        n=k+1-indx(D2,D1,n1+1) by A362,XCMPLX_1:26
           .=k-indx(D2,D1,n1+1)+1 by XCMPLX_1:29;
           then A364: n in dom MD2 by A328,A360,A361,FINSEQ_3:27;
             MD2.n=D2.(n+indx(D2,D1,n1+1)-1)
           by A228,A229,A230,A306,A360,A361,A363,JORDAN3:31
           .=D2.k by A362,XCMPLX_1:26;
           hence x1 in rng MD2 by A358,A364,FUNCT_1:def 5;
           suppose x1 in {D.(i+1)};
then A365:       x1 = D.(i+1) by TARSKI:def 1;
A366:       D.(i+1) in rng D by A200,FUNCT_1:def 5;
             rng D c= rng D2 by A21,INTEGRA1:def 20;
           then consider k such that
A367:       k in dom D2 & x1 = D2.k by A365,A366,PARTFUN1:26;
         inf divset(D1,j) <= D.(i+1) & D.(i+1) <= sup divset(D1,j)
           by A201,INTEGRA2:1;
then A368:       D1.(j-1) <= x1 & x1 <= D1.j by A201,A208,A222,A365,INTEGRA1:
def 5;
A369:       j-1 in dom D1 & j-1 in NAT by A201,A208,A222,INTEGRA1:9;
           reconsider j1 = j-1 as Nat by A201,A208,A222,INTEGRA1:9;
             n1<j1 by A303,REAL_1:86;
           then n1+1 <= j1 by NAT_1:38;
           then D1.(n1+1) <= D1.(j-1) by A225,A369,GOBOARD2:18;
           then D2.indx(D2,D1,n1+1) <= D2.k & D2.k <= D2.indx(D2,D1,j)
           by A21,A201,A226,A367,A368,AXIOMS:22,INTEGRA1:def 21;
           hence x1 in rng MD2 by A226,A227,A306,A367,Th16;
          end;
          hence thesis;
         end;
         then rng MD1 \/ {D.(i+1)} c= rng MD2 by TARSKI:def 3;
         hence thesis by A350,XBOOLE_0:def 10;
        end;
A370:    len MD1 in dom MD1 by SCMFSA_7:12;
then A371:    1 <= len MD1 by FINSEQ_3:27;
A372:    inf divset(MD1,len MD1)=inf divset(D1,j)
        & sup divset(MD1,len MD1)=sup divset(D1,j)
        proof
         per cases;
          suppose A373:len MD1=1;
then A374:      inf divset(MD1,len MD1)=inf B
          & sup divset(MD1,len MD1)=MD1.(len MD1) by A370,INTEGRA1:def 5;
            inf divset(D1,j)=D1.(j-1)
          & sup divset(D1,j)=D1.j by A201,A208,A222,INTEGRA1:def 5;
          hence thesis by A220,A223,A224,A306,A307,A308,A310,A373,A374,JORDAN3:
31,XCMPLX_1:18;
          suppose A375:len MD1<>1;
then A376:      inf divset(MD1,len MD1)=MD1.(len MD1-1)
          & sup divset(MD1,len MD1)=MD1.(len MD1) by A370,INTEGRA1:def 5;
A377:      len MD1-1+(n1+1)-1=j-(n1+1)+(n1+1)-1 by A309,XCMPLX_1:36
          .=j-((n1+1)-(n1+1))-1 by XCMPLX_1:37
          .=j-1 by XCMPLX_1:17;
A378:      len MD1-1 in dom MD1 & len MD1-1 in NAT
           by A370,A375,INTEGRA1:9;
then A379:      len MD1-1 >= 1 by FINSEQ_3:27;
            len MD1 <= len MD1+1 by NAT_1:29;
          then len MD1 -1 <= len MD1 by REAL_1:86;
then A380:      inf divset(MD1,len MD1)=D1.(j-1) by A220,A223,A224,A306,A307,
A376,A377,A378,A379,JORDAN3:31;
            sup divset(MD1,len MD1)
            =D1.j by A220,A223,A224,A306,A307,A310,A371,A376,JORDAN3:31;
          hence thesis by A201,A208,A222,A380,INTEGRA1:def 5;
        end;
          inf divset(D1,j)<=D.(i+1) & D.(i+1)<=sup divset(D1,j)
        by A201,INTEGRA2:1;
then A381:    D.(i+1) in divset(MD1,len MD1) by A372,INTEGRA2:1;
A382:     Sum lower_volume(g,MD2)-Sum lower_volume(g,MD1)<=
          (sup rng g-inf rng g)*delta(MD1)
        proof
            vol(B)<>0 & D.(i+1) > inf B
          proof
A383:      vol(B)=sup B-D1.n1 by A306,INTEGRA1:def 6;
A384:      len MD1 in dom MD1 by SCMFSA_7:12;
             sup divset(MD1,len MD1)=MD1.(len MD1)
           proof
            per cases;
             suppose len MD1 = 1;
             hence thesis by A384,INTEGRA1:def 5;
             suppose len MD1 <> 1;
             hence thesis by A384,INTEGRA1:def 5;
           end;
then A385:      vol(B)=D1.j-D1.n1 by A201,A208,A222,A306,A372,A383,INTEGRA1:def
5;
             D1.j>D1.n1 by A201,A205,A208,GOBOARD1:def 1;
           hence vol(B)<>0 by A385,SQUARE_1:11;
          inf divset(D1,j) <= D.(i+1) by A201,INTEGRA2:1;
then A386:        D1.(j-1) <= D.(i+1) by A201,A208,A222,INTEGRA1:def 5;
A387:        n1 < j-1 by A303,REAL_1:86;
             j-1 in dom D1 by A201,A208,A222,INTEGRA1:9;
           then D1.n1 <D1.(j-1) by A205,A387,GOBOARD1:def 1;
           hence thesis by A306,A386,AXIOMS:22;
          end;
          hence thesis by A306,A316,A330,A381,Th12;
        end;

          dom g = B by FUNCT_2:def 1;
then A388:   rng g <> {} by RELAT_1:65;
A389:   rng g c= rng f by FUNCT_1:76;
          f is_bounded_above_on A & f is_bounded_below_on A
        by A1,RFUNCT_1:def 11;
        then rng f is bounded_above & rng f is bounded_below
        by INTEGRA1:13,15;
        then sup rng f >= sup rng g & inf rng f <= inf rng g
        by A388,A389,PSCOMP_1:12,13;
then A390:    sup rng f-inf rng f>=sup rng g - inf rng g by REAL_1:92;
          delta(MD1) >= 0 by Th8;
        then (sup rng f-inf rng f)*delta(MD1)>=(sup rng g-inf rng g)*delta(MD1
)
        by A390,AXIOMS:25;
then A391:    Sum lower_volume(g,MD2)-Sum lower_volume(g,MD1)<=
          (sup rng f-inf rng f)*delta(MD1) by A382,AXIOMS:22;
          delta(MD1)=max rng upper_volume(chi(B,B),MD1) by INTEGRA1:def 19;
        then delta(MD1) in rng upper_volume(chi(B,B),MD1) by PRE_CIRC:def 1;
        then consider k such that
A392:    k in dom upper_volume(chi(B,B),MD1)
        & upper_volume(chi(B,B),MD1).k = delta(MD1) by PARTFUN1:26;
          k in Seg len upper_volume(chi(B,B),MD1) by A392,FINSEQ_1:def 3;
then A393:    k in Seg len MD1 by INTEGRA1:def 7;
then A394:    delta(MD1) = vol(divset(MD1,k)) by A392,INTEGRA1:22;
          n1+1>1 by A222,NAT_1:38;
        then n1>1-1 by REAL_1:84;
then A395:    1 <= k & k <= len MD1 & k < k+n1 by A393,FINSEQ_1:3,REAL_1:69;
then A396:    1 < k+n1 by AXIOMS:22;
A397:    k in dom MD1 by A393,FINSEQ_1:def 3;
          k+n1 <= j by A309,A395,REAL_1:84;
        then k+n1 <= len D1 by A223,AXIOMS:22;
then A398:    k+n1 in dom D1 by A396,FINSEQ_3:27;
        A399: divset(MD1,k)=divset(D1,k+n1)
        proof
      inf divset(MD1,k)=inf divset(D1,k+n1)
         & sup divset(MD1,k)=sup divset(D1,k+n1)
         proof
          per cases;
           suppose A400:k=1;
           then inf divset(MD1,k)=inf B & sup divset(MD1,k)=MD1.k
           by A397,INTEGRA1:def 5;
then A401:       inf divset(MD1,k)=D1.n1 & sup divset(MD1,k)=D1.(k+(n1+1)-1)
           by A220,A223,A224,A306,A307,A395,JORDAN3:31;
             inf divset(D1,k+n1)=D1.(k+n1-1) & sup divset(D1,k+n1)=D1.(k+n1)
           by A395,A398,INTEGRA1:def 5;
           hence thesis by A400,A401,XCMPLX_1:26;
           suppose A402:k<>1;
then A403:       k-1 in dom MD1 & k-1 in NAT by A397,INTEGRA1:9;
then A404:       1 <= k-1 & k-1 <= len MD1 by FINSEQ_3:27;
             inf divset(MD1,k)=MD1.(k-1) & sup divset(MD1,k)=MD1.k
           by A397,A402,INTEGRA1:def 5;
           then inf divset(MD1,k)=D1.(k-1+(n1+1)-1)
           & sup divset(MD1,k)=D1.(k+(n1+1)-1)
           by A220,A223,A224,A306,A307,A395,A403,A404,JORDAN3:31;
           then inf divset(MD1,k)=D1.(k-1+n1+1-1)
           & sup divset(MD1,k)=D1.(k+n1+1-1) by XCMPLX_1:1;
then A405:       inf divset(MD1,k)=D1.(k-1+n1) & sup divset(MD1,k)=D1.(k+n1)
           by XCMPLX_1:26;
             inf divset(D1,k+n1)=D1.(k+n1-1) & sup divset(D1,k+n1)=D1.(k+n1)
           by A395,A398,INTEGRA1:def 5;
           hence thesis by A405,XCMPLX_1:29;
         end;
         then divset(MD1,k)=[.inf divset(D1,k+n1),sup divset(D1,k+n1).]
           by INTEGRA1:5;
         hence thesis by INTEGRA1:5;
        end;
A406:    k+n1 in Seg len D1 by A398,FINSEQ_1:def 3;
then A407:    delta(MD1)=upper_volume(chi(A,A),D1).(k+n1) by A394,A399,INTEGRA1
:22;
          k+n1 in Seg len upper_volume(chi(A,A),D1) by A406,INTEGRA1:def 7;
        then k+n1 in dom upper_volume(chi(A,A),D1) by FINSEQ_1:def 3;
        then delta(MD1) in rng upper_volume(chi(A,A),D1) by A407,FUNCT_1:def 5
;
        then delta(MD1) <= max rng upper_volume(chi(A,A),D1) by PRE_CIRC:def 1
;
then A408:    delta(MD1) <= delta(D1) by INTEGRA1:def 19;
          inf rng f <= sup rng f by A1,Lm6;
        then sup rng f - inf rng f >= 0 by SQUARE_1:12;
        then A409: (sup rng f-inf rng f)*delta(MD1) <= (sup rng f-inf rng f)*
delta(D1)
        by A408,AXIOMS:25;
A410:    indx(D2,D1,n1) < indx(D2,D1,n1)+1 by NAT_1:38;
A411:    1 <= indx(D2,D1,n1)+1 by A207,NAT_1:38;
          D1.n1 < D1.(n1+1) by A205,A225,A304,GOBOARD1:def 1;
        then indx(D2,D1,n1) < indx(D2,D1,n1+1) by A206,A226,GOBOARD2:18;
then A412:    indx(D2,D1,n1)+1 <= indx(D2,D1,n1+1) by NAT_1:38;
then A413:    indx(D2,D1,n1)+1 <= len D2 by A229,AXIOMS:22;
then A414:    indx(D2,D1,n1)+1 <= len LVf(D2) by INTEGRA1:def 8;
A415:    indx(D2,D1,n1+1)=indx(D2,D1,n1)+1
        proof
         assume indx(D2,D1,n1+1)<> indx(D2,D1,n1)+1;
then A416:     indx(D2,D1,n1+1)>indx(D2,D1,n1)+1 by A412,REAL_1:def 5;
A417:     indx(D2,D1,n1)+1 in dom D2 by A411,A413,FINSEQ_3:27;
         then A418: D2.(indx(D2,D1,n1)+1) in rng D2 by FUNCT_1:def 5;
           now per cases by A21,A418,XBOOLE_0:def 2;
          suppose D2.(indx(D2,D1,n1)+1) in rng D1;
          then consider n2 being Nat such that
A419:      n2 in dom D1 & D2.(indx(D2,D1,n1)+1) = D1.n2 by PARTFUN1:26;
            D2.indx(D2,D1,n1) < D2.(indx(D2,D1,n1)+1)
          by A206,A410,A417,GOBOARD1:def 1;
          then n1 < n2 by A205,A206,A419,GOBOARD2:18;
then A420:      n1+1 <= n2 by NAT_1:38;
            D1.n2 < D1.(n1+1) by A226,A416,A417,A419,GOBOARD1:def 1;
          hence contradiction by A225,A419,A420,GOBOARD2:18;
          suppose D2.(indx(D2,D1,n1)+1) in rng D;
          then consider n2 being Nat such that
A421:      n2 in dom D & D2.(indx(D2,D1,n1)+1) = D.n2 by PARTFUN1:26;
A422:      D1.n1 < D.n2 by A206,A410,A417,A421,GOBOARD1:def 1;
A423:      D.i <= sup divset(D1,n1) by A205,INTEGRA2:1;
            sup divset(D1,n1)=D1.n1
          proof
           per cases;
            suppose n1=1;
            hence thesis by A205,INTEGRA1:def 5;
            suppose n1<>1;
            hence thesis by A205,INTEGRA1:def 5;
          end;
          then D.i < D.n2 by A422,A423,AXIOMS:22;
          then i < n2 by A204,A421,GOBOARD2:18;
then A424:      i+1 <= n2 by NAT_1:38;
A425:      D.n2 < D1.(n1+1) by A226,A416,A417,A421,GOBOARD1:def 1;
A426:      j-1 in dom D1 & j-1 in NAT by A201,A208,A222,INTEGRA1:9;
            n1+1 +1 <= j by A303,NAT_1:38;
          then n1+1 <= j-1 by REAL_1:84;
then A427:      D1.(n1+1) <= D1.(j-1) by A225,A426,GOBOARD2:18;
A428:      inf divset(D1,j) <= D.(i+1) by A201,INTEGRA2:1;
            inf divset(D1,j) = D1.(j-1) by A201,A208,A222,INTEGRA1:def 5;
          then D1.(n1+1) <= D.(i+1) by A427,A428,AXIOMS:22;
          then D.n2 < D.(i+1) by A425,AXIOMS:22;
          hence contradiction by A200,A421,A424,GOBOARD2:18;
         end;
         hence contradiction;
        end;
A429: Sum lower_volume(g,MD2)=Sum mid(LVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j))
        proof
           lower_volume(g,MD2)=mid(LVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j))
         proof
A430:      len lower_volume(g,MD2)=indx(D2,D1,j)-(indx(D2,D1,n1)+1)+1
             by A328,A415,INTEGRA1:def 8;
A431:      indx(D2,D1,j) <= len LVf(D2) by A230,INTEGRA1:def 8;
A432:      indx(D2,D1,n1)+1 <= indx(D2,D1,j) by A228,A412,AXIOMS:22;
then len mid(LVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j))
          = indx(D2,D1,j)-'(indx(D2,D1,n1)+1)+1 by A230,A411,A414,A431,JORDAN3:
27;
then A433:      len lower_volume(g,MD2)
          =len mid(LVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j))
          by A430,A432,SCMFSA_7:3;
            for k st 1<=k & k<=len lower_volume(g,MD2) holds
          lower_volume(g,MD2).k=mid(LVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j)).k
          proof
           let k; assume A434:1 <= k & k <= len lower_volume(g,MD2);
           then k in Seg len lower_volume(g,MD2) by FINSEQ_1:3;
then A435:       k in Seg len MD2 by INTEGRA1:def 8;
A436:      divset(MD2,k)=[.inf divset(MD2,k),sup divset(MD2,k).] by INTEGRA1:5;
A437:       mid(LVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j)).k
           =LVf(D2).(k+(indx(D2,D1,n1)+1)-1)
           by A411,A430,A431,A432,A434,JORDAN3:31;
             k <= indx(D2,D1,j)-((indx(D2,D1,n1)+1)-1) by A430,A434,XCMPLX_1:37
;
           then k+((indx(D2,D1,n1)+1)-1) <= indx(D2,D1,j) by REAL_1:84;
           then k+(indx(D2,D1,n1)+1)-1 <= indx(D2,D1,j) by XCMPLX_1:29;
then A438:       k+(indx(D2,D1,n1)+1)-1 <= len LVf(D2) by A431,AXIOMS:22;
             1<=indx(D2,D1,n1)+1 by NAT_1:37;
           then 1+1<=k+(indx(D2,D1,n1)+1) by A434,REAL_1:55;
then A439:       1 <= k+(indx(D2,D1,n1)+1)-1 by REAL_1:84;
           consider k2 being Nat such that
A440:       indx(D2,D1,n1)+1=1+k2;
A441:       k2=(indx(D2,D1,n1)+1)-1 by A440,XCMPLX_1:26;
then A442:       k+k2=k+(indx(D2,D1,n1)+1)-1 by XCMPLX_1:29;
           then k+k2 in Seg len LVf(D2) by A438,A439,FINSEQ_1:3;
then A443:       k+k2 in Seg len D2 by INTEGRA1:def 8;
then A444:       mid(LVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j)).k
           =(inf rng(f|divset(D2,k+k2)))*vol(divset(D2,k+k2))
           by A437,A442,INTEGRA1:def 8;
             inf divset(MD2,k)=inf divset(D2,k+k2)
           & sup divset(MD2,k)=sup divset(D2,k+k2)
           proof
              k2=indx(D2,D1,n1) by A441,XCMPLX_1:26;
            then k+k2>=1+1 by A207,A434,REAL_1:55;
then A445:        k+k2>1 by NAT_1:38;
A446:        k in dom MD2 by A435,FINSEQ_1:def 3;
A447:        k+k2 in dom D2 by A443,FINSEQ_1:def 3;
            per cases;
             suppose A448:k=1;
             then inf divset(MD2,k)=inf B & sup divset(MD2,k)=MD2.k
             by A446,INTEGRA1:def 5;
then A449:         inf divset(MD2,k)=D1.n1
             & sup divset(MD2,k)=D2.(k+(indx(D2,D1,n1)+1)-1)
             by A228,A230,A306,A411,A415,A430,A434,JORDAN3:31;
               inf divset(D2,k+k2)=D2.(k+k2-1) &sup divset(D2,k+k2)=D2.(k+k2)
             by A445,A447,INTEGRA1:def 5;
             hence thesis by A206,A440,A448,A449,XCMPLX_1:26;
             suppose A450:k<>1;
then A451:        k-1 in dom MD2 & k-1 in NAT by A446,INTEGRA1:9;
then A452:        1 <= k-1 by FINSEQ_3:27;
               k-1 <= k by Lm1;
then A453:        k-1 <= indx(D2,D1,j)-(indx(D2,D1,n1)+1)+1 by A430,A434,AXIOMS
:22;
               inf divset(MD2,k)=MD2.(k-1) & sup divset(MD2,k)=MD2.k
             by A446,A450,INTEGRA1:def 5;
then A454:         inf divset(MD2,k)=D2.(k-1+(indx(D2,D1,n1)+1)-1)
             & sup divset(MD2,k)=D2.(k+(indx(D2,D1,n1)+1)-1)
             by A228,A230,A306,A411,A415,A430,A434,A451,A452,A453,JORDAN3:31;
               inf divset(D2,k+k2)=D2.(k+k2-1) &sup divset(D2,k+k2)=D2.(k+k2)
             by A445,A447,INTEGRA1:def 5;
             then inf divset(D2,k+k2)=D2.(k-1+k2)
             & sup divset(D2,k+k2)=D2.(k+((indx(D2,D1,n1)+1)-1))
             by A440,XCMPLX_1:26,29;
             hence thesis by A441,A454,XCMPLX_1:29;
           end;
then A455:       divset(MD2,k)=divset(D2,k+k2) by A436,INTEGRA1:5;
             rng(f|divset(D2,k+k2))=rng(g|divset(D2,k+k2))
           proof
              k in dom MD2 by A435,FINSEQ_1:def 3;
            then divset(D2,k+k2) c= B by A455,INTEGRA1:10;
            hence thesis by FUNCT_1:82;
           end;
           hence thesis by A435,A444,A455,INTEGRA1:def 8;
          end;
          hence thesis by A433,FINSEQ_1:18;
         end;
         hence thesis;
        end;
          Sum lower_volume(g,MD1)=Sum mid(LVf(D1),n1+1,j)
        proof
A456:    len lower_volume(g,MD1)=len MD1 by INTEGRA1:def 8
         .=j-'(n1+1)+1 by A220,A223,A224,A306,JORDAN3:27
         .=j-(n1+1)+1 by A220,SCMFSA_7:3;
A457:    n1+1 <= len LVf(D1) by A224,INTEGRA1:def 8;
A458:    j <= len LVf(D1) by A223,INTEGRA1:def 8;
         then A459: len mid(LVf(D1),n1+1,j)
          =j-'(n1+1)+1 by A220,A223,A224,A457,JORDAN3:27
         .=j-(n1+1)+1 by A220,SCMFSA_7:3;
           lower_volume(g,MD1)=mid(LVf(D1),n1+1,j)
         proof
            for k st 1<=k & k<=len lower_volume(g,MD1) holds
          lower_volume(g,MD1).k=mid(LVf(D1),n1+1,j).k
          proof
           let k; assume A460:1 <= k & k <= len lower_volume(g,MD1);
           then k in Seg len lower_volume(g,MD1) by FINSEQ_1:3;
then A461:      k in Seg len MD1 by INTEGRA1:def 8;
then A462:      lower_volume(g,MD1).k
           =(inf rng(g|divset(MD1,k)))*vol(divset(MD1,k)) by INTEGRA1:def 8;
             k <= j-((n1+1)-1) by A456,A460,XCMPLX_1:37;
then A463:      k+((n1+1)-1) <= j by REAL_1:84;
           consider k2 being Nat such that
A464:       n1+1=1+k2;
A465:      k2=(n1+1)-1 by A464,XCMPLX_1:26;
A466:      1 <= k+k2 by A460,NAT_1:37;
             k+k2 <= len D1 by A223,A463,A465,AXIOMS:22;
then A467:      k+k2 in Seg len D1 by A466,FINSEQ_1:3;
A468:      mid(LVf(D1),n1+1,j).k
           =LVf(D1).(k+(n1+1)-1) by A220,A224,A456,A458,A460,JORDAN3:31
           .=LVf(D1).(k+((n1+1)-1)) by XCMPLX_1:29
           .=(inf rng(f|divset(D1,k+k2)))*vol(divset(D1,k+k2))
           by A465,A467,INTEGRA1:def 8;
A469:      k2=n1 by A465,XCMPLX_1:26;
           then 1+1 <= k+k2 by A223,A460,REAL_1:55;
then A470:      1 < k+k2 by NAT_1:38;
A471:      divset(MD1,k)=[.inf divset(MD1,k),sup divset(MD1,k).]
           by INTEGRA1:5;
A472:      k in dom MD1 by A461,FINSEQ_1:def 3;
             k+k2 in dom D1 by A467,FINSEQ_1:def 3;
then A473:      inf divset(D1,k+k2)=D1.(k+k2-1)
           & sup divset(D1,k+k2)=D1.(k+k2) by A470,INTEGRA1:def 5;
A474:      divset(D1,k+k2)=divset(MD1,k)
           proof
              inf divset(D1,k+k2)=inf divset(MD1,k)
            & sup divset(D1,k+k2)=sup divset(MD1,k)
            proof
             per cases;
              suppose A475:k=1;
              then inf divset(MD1,k)=inf B & sup divset(MD1,k)=MD1.k
              by A472,INTEGRA1:def 5;
              then inf divset(MD1,k)=D1.n1 & sup divset(MD1,k)=D1.(k+(n1+1)-1)
                by A220,A223,A224,A306,A456,A460,JORDAN3:31;
              hence thesis by A469,A473,A475,XCMPLX_1:26;
              suppose A476:k<>1;
then A477:         k-1 in dom MD1 & k-1 in NAT by A472,INTEGRA1:9;
then A478:         1 <= k-1 by FINSEQ_3:27;
                k-1 <= k by Lm1;
then A479:         k-1 <= j-(n1+1)+1 by A456,A460,AXIOMS:22;
                inf divset(MD1,k)=MD1.(k-1) & sup divset(MD1,k)=MD1.k
              by A472,A476,INTEGRA1:def 5;
              then inf divset(MD1,k)=D1.(k-1+(n1+1)-1)
              & sup divset(MD1,k)=D1.(k+(n1+1)-1)
              by A220,A223,A224,A306,A456,A460,A477,A478,A479,JORDAN3:31;
              then inf divset(MD1,k)=D1.(k-1+((n1+1)-1))
              & sup divset(MD1,k)=D1.(k+((n1+1)-1)) by XCMPLX_1:29;
              hence thesis by A465,A473,XCMPLX_1:29;
            end;
            hence thesis by A471,INTEGRA1:5;
           end;
             k in dom MD1 by A461,FINSEQ_1:def 3;
           then divset(D1,k+k2) c= B by A474,INTEGRA1:10;
           hence thesis by A462,A468,A474,FUNCT_1:82;
          end;
          hence thesis by A456,A459,FINSEQ_1:18;
         end;
         hence thesis;
        end;
        hence Sum mid(LVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j))
        -Sum
mid(LVf(D1),n1+1,j) <= (sup rng f-inf rng f)*delta(D1) by A391,A409,A429,AXIOMS
:22;
       end;
       hence thesis;
       end;
A480:    PLf(D2,indx(D2,D1,j))=
        PLf(D2,indx(D2,D1,n1))+Sum mid(LVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j))
        proof
A481:    indx(D2,D1,n1)<indx(D2,D1,j) by A228,A231,AXIOMS:22;
           indx(D2,D1,j) in Seg len D2 by A227,FINSEQ_1:def 3;
then A482:    indx(D2,D1,j) in Seg len LVf(D2) by INTEGRA1:def 8;
A483:    indx(D2,D1,j) <= len LVf(D2) by A230,INTEGRA1:def 8;
           indx(D2,D1,n1) in Seg len D2 by A206,FINSEQ_1:def 3;
         then indx(D2,D1,n1) in Seg len LVf(D2) by INTEGRA1:def 8;
         then PLf(D2,indx(D2,D1,n1))=Sum(LVf(D2)|indx(D2,D1,n1)) by INTEGRA1:
def 22
         .=Sum mid(LVf(D2),1,indx(D2,D1,n1)) by A207,JORDAN3:25;
         then PLf(D2,indx(D2,D1,n1))+Sum mid(LVf(D2),indx(D2,D1,n1)+1,indx(D2,
D1,j))
         =Sum(mid(LVf(D2),1,indx(D2,D1,n1))^
            mid(LVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j))) by RVSUM_1:105
         .=Sum mid(LVf(D2),1,indx(D2,D1,j)) by A207,A481,A483,INTEGRA2:4
         .=Sum(LVf(D2)|indx(D2,D1,j)) by A230,JORDAN3:25;
         hence thesis by A482,INTEGRA1:def 22;
        end;
A484:    PLf(D1,j)=PLf(D1,n1)+Sum mid(LVf(D1),n1+1,j)
        proof
A485:    j <= len LVf(D1) by A223,INTEGRA1:def 8;
then A486:    j in Seg len LVf(D1) by A223,FINSEQ_1:3;
           n1 in Seg len D1 by A205,FINSEQ_1:def 3;
         then n1 in Seg len LVf(D1) by INTEGRA1:def 8;
         then PLf(D1,n1)=Sum(LVf(D1)|n1) by INTEGRA1:def 22
         .=Sum mid(LVf(D1),1,n1) by A223,JORDAN3:25;
         then PLf(D1,n1)+Sum mid(LVf(D1),n1+1,j)
          =Sum(mid(LVf(D1),1,n1)^mid(LVf(D1),n1+1,j)) by RVSUM_1:105
         .=Sum mid(LVf(D1),1,j) by A208,A223,A485,INTEGRA2:4
         .=Sum(LVf(D1)|j) by A223,JORDAN3:25;
         hence thesis by A486,INTEGRA1:def 22;
        end;
A487:    i*(sup rng f-inf rng f)*delta(D1)+(sup rng f-inf rng f)*delta(D1)
        =i*((sup rng f-inf rng f)*delta(D1))+1*
          ((sup rng f-inf rng f)*delta(D1)) by XCMPLX_1:4
        .=(i+1)*((sup rng f-inf rng f)*delta(D1)) by XCMPLX_1:8
        .=(i+1)*(sup rng f-inf rng f)*delta(D1) by XCMPLX_1:4;
A488:    (PLf(D2,indx(D2,D1,n1))-PLf(D1,n1))+
        (Sum mid(LVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j))
         -Sum mid(LVf(D1),n1+1,j))
        <=i*(sup rng f-inf rng f)*delta(D1)+(sup rng f-inf rng f)*delta(D1)
        by A205,A233,REAL_1:55;
          (PLf(D2,indx(D2,D1,n1))-PLf(D1,n1))+
        (Sum mid(LVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j))
         -Sum mid(LVf(D1),n1+1,j))
         =PLf(D2,indx(D2,D1,j))-PLf(D1,j) by A480,A484,Lm5;
        hence thesis by A201,A487,A488;
       end;
       hence thesis;
      end;
A489: for k being non empty Nat holds P[k] from Ind_from_1(A43,A197);
        i in Seg len D by A23,FINSEQ_1:def 3;
      then reconsider i as non empty Nat by BINARITH:5;
        P[i] by A489;
      hence thesis by A23;
     end;
       len D in dom D by SCMFSA_7:12;
     then consider j such that
A490:  j in dom D1 & D.(len D) in divset(D1,j) &
       PLf(D2,indx(D2,D1,j))-PLf(D1,j)
     <= (len D)*(sup(rng f)-inf(rng f))*delta(D1) by A22;
A491:  len D1 in dom D1 by SCMFSA_7:12;
A492:  j = len D1
     proof
      assume A493:j<>len D1;
      A494: D.(len D) <= sup divset(D1,j) by A490,INTEGRA2:1;
        j <= len D1 by A490,FINSEQ_3:27;
      then j < len D1 by A493,REAL_1:def 5;
      then D1.j < D1.(len D1) by A490,A491,GOBOARD1:def 1;
then A495: D1.j < sup A by INTEGRA1:def 2;
        sup divset(D1,j) < sup A
      proof
       per cases;
       suppose j=1;
       hence thesis by A490,A495,INTEGRA1:def 5;
       suppose j<>1;
       hence thesis by A490,A495,INTEGRA1:def 5;
      end;
      hence contradiction by A494,INTEGRA1:def 2;
     end;
A496:len D2 in dom D2 by SCMFSA_7:12;
A497:indx(D2,D1,len D1) in dom D2 &
     D1.(len D1) = D2.indx(D2,D1,len D1) by A21,A491,INTEGRA1:def 21;
     then sup A = D2.indx(D2,D1,len D1) by INTEGRA1:def 2;
     then D2.(len D2) = D2.indx(D2,D1,len D1) by INTEGRA1:def 2;
     then indx(D2,D1,len D1)=len D2 by A496,A497,GOBOARD2:19;
     then PLf(D2,len D2)-lower_sum(f,D1)<=(len D)*(sup(rng f)-inf(rng f))*
delta(D1)
     by A490,A492,INTEGRA1:45;
     hence thesis by INTEGRA1:45;
    end;
    hence thesis by A21;
   end;
   hence thesis;
  end;

A498:for e be real number st e>0 ex n st for m st n<=m holds
   abs((lower_sum(f,T)).m-lower_integral(f))<e
   proof
     let e be real number;
     assume A499:e>0;
then A500:e/2>0 by REAL_2:127;
     reconsider e as Real by XREAL_0:def 1;
A501:lower_integral(f) = sup rng lower_sum_set(f) by INTEGRA1:def 16;
A502:rng lower_sum_set(f) is bounded_above by A1,INTEGRA2:36;
       dom lower_sum_set(f) is non empty by INTEGRA1:def 12;
     then rng lower_sum_set(f) is non empty by RELAT_1:65;
     then consider y be real number such that
A503: y in rng lower_sum_set(f) & lower_integral(f)-e/2<y
     by A500,A501,A502,SEQ_4:def 4;
     consider D being Element of divs A such that
A504: D in dom lower_sum_set(f) & y=(lower_sum_set(f)).D & D.1>inf A
     by A3,A503,Lm10;
       y=lower_sum(f,D) by A504,INTEGRA1:def 12;
then A505: lower_integral(f)-lower_sum(f,D)<e/2 by A503,REAL_2:165;

     set p=len D;
     set H=sup rng f;
     set h=inf rng f;
     deffunc F(Nat)=vol(divset(D,$1));
     consider v being FinSequence of REAL such that
A506:len v = len D & for j st j in Seg len D holds v.j=F(j)
     from SeqLambdaD;
     consider v1 being non-decreasing FinSequence of REAL such that
A507: v,v1 are_fiberwise_equipotent by INTEGRA2:3;
     defpred P[Nat] means $1 in dom v1 & v1.$1>0;
A508:ex k st P[k]
     proof
       consider H being Function such that
A509:  dom H = dom v & rng H = dom v1 & H is one-to-one & v=v1*H
       by A507,RFINSEQ:3;
       consider k such that
A510:  k in dom D & vol(divset(D,k)) > 0 by A3,Th1;
         dom D = Seg len v by A506,FINSEQ_1:def 3;
       then k in dom v & v.k > 0 by A506,A510,FINSEQ_1:def 3;
       then H.k in dom v1 & v1.(H.k) > 0 by A509,FUNCT_1:21,22;
       hence thesis;
     end;
     consider k such that
A511: P[k] & for n st P[n] holds k<=n
      from Min(A508);
       p <> 0 by FINSEQ_1:25;
then A512:p > 0 by NAT_1:19;
then A513: 2*p >0 by REAL_2:122;
       H >= h by A1,Lm6;
     then H-h >= 0 by SQUARE_1:12;
     then H-h+1 > 0+0 by REAL_1:67;
then A514: 2*p*(H-h+1) > 0 by A513,REAL_2:122;
       min(v1.k,e/(2*p*(H-h+1))) > 0
     proof
       per cases by SQUARE_1:38;
       suppose min(v1.k,e/(2*p*(H-h+1))) = v1.k;
       hence thesis by A511;
       suppose min(v1.k,e/(2*p*(H-h+1))) = e/(2*p*(H-h+1));
       hence thesis by A499,A514,REAL_2:127;
     end;
     then consider n such that
A515: for m st n<=m holds 0 < (delta(T)).m
     & (delta(T)).m < min(v1.k,e/(2*p*(H-h+1))) by A5;

A516: for m st n<=m holds abs((lower_sum(f,T)).m-lower_integral(f))<e
     proof
       let m; assume A517:n<=m;
then A518:  0 < (delta(T)).m & (delta(T)).m < min(v1.k,e/(2*p*(H-h+1))) by A515
;
       reconsider D1 = T.m as Element of divs A;
       consider D2 being Element of divs A such that
A519:   D <= D2 & D1 <= D2 & rng D2 = rng D1 \/ rng D &
       0 <= lower_sum(f,D2)-lower_sum(f,D) &
       0 <= lower_sum(f,D2)-lower_sum(f,D1) by A14;
         f is_bounded_below_on A by A1,RFUNCT_1:def 11;
       then lower_sum(f,D) <= lower_sum(f,D2) by A519,INTEGRA1:48;
then A520:   lower_sum(f,D)-lower_sum(f,D2)<=0 by REAL_2:106;
A521:  delta(D1)=(delta(T)).m by INTEGRA2:def 3;
A522:   delta(D1)<min (v1.k,e/(2*p*(H-h+1))) by A518,INTEGRA2:def 3;
         min (v1.k,e/(2*p*(H-h+1))) <= v1.k by SQUARE_1:35;
then A523:   delta(D1)<v1.k by A522,AXIOMS:22;
A524:  v1.1 > 0
       proof
A525:     for n1 be Element of NAT st n1 in dom D holds
        vol(divset(D,n1))>0
        proof
         let n1 be Element of NAT;
         assume A526:n1 in dom D;
         then A527: 1 <= n1 by FINSEQ_3:27;
         per cases by A527,REAL_1:def 5;
          suppose A528:n1=1;
          then inf divset(D,n1)=inf A & sup divset(D,n1)=D.n1
          by A526,INTEGRA1:def 5;
          then vol(divset(D,n1))=D.n1-inf A by INTEGRA1:def 6;
          hence thesis by A504,A528,SQUARE_1:11;
          suppose A529:n1>1;
          then inf divset(D,n1)=D.(n1-1) & sup divset(D,n1)=D.n1
          by A526,INTEGRA1:def 5;
then A530:     vol(divset(D,n1))=D.n1-D.(n1-1) by INTEGRA1:def 6;
A531:     n1-1 in dom D by A526,A529,INTEGRA1:9;
            n1 < n1+1 by REAL_1:69;
          then n1-1 < n1 by REAL_1:84;
          then D.(n1-1)<D.n1 by A526,A531,GOBOARD1:def 1;
          hence thesis by A530,SQUARE_1:11;
        end;
          1 <= k & k <= len v1 by A511,FINSEQ_3:27;
        then 1 <= len v1 by AXIOMS:22;
        then 1 in dom v1 by FINSEQ_3:27;
then A532:   v1.1 in rng v1 by FUNCT_1:def 5;
          rng v = rng v1 by A507,RFINSEQ:1;
        then consider n1 being Element of NAT such that
A533:   n1 in dom v & v1.1 = v.n1 by A532,PARTFUN1:26;
A534:   n1 in Seg len D by A506,A533,FINSEQ_1:def 3;
then A535:   v1.1 = vol(divset(D,n1)) by A506,A533;
          n1 in dom D by A534,FINSEQ_1:def 3;
        hence thesis by A525,A535;
       end;
         v1.k = min rng upper_volume(chi(A,A),D)
       proof
A536:   k=1
        proof
         assume A537:k <> 1;
A538:    len v1 = len v by A507,RFINSEQ:16;
A539:    k in Seg len v1 by A511,FINSEQ_1:def 3;
           k in Seg len v by A511,A538,FINSEQ_1:def 3;
then A540:    1 <= k & k <= len D by A506,FINSEQ_1:3;
then A541:    k > 1 by A537,REAL_1:def 5;
           k <= len v1 by A539,FINSEQ_1:3;
         then 1 <= len v1 by A540,AXIOMS:22;
         then 1 in dom v1 by FINSEQ_3:27;
         hence contradiction by A511,A524,A541;
        end;
     min rng upper_volume(chi(A,A),D) in rng upper_volume(chi(A,A),D)
        & for x st x in rng upper_volume(chi(A,A),D)
        holds min rng upper_volume(chi(A,A),D) <= x by SFMASTR3:def 1;
        then consider m such that
A542:    m in dom upper_volume(chi(A,A),D)
        & min rng upper_volume(chi(A,A),D)=upper_volume(chi(A,A),D).m
        by PARTFUN1:26;
          m in Seg len upper_volume(chi(A,A),D) by A542,FINSEQ_1:def 3;
then A543:    m in Seg len D by INTEGRA1:def 7;
        then min rng upper_volume(chi(A,A),D)=vol(divset(D,m))
        by A542,INTEGRA1:22;
then A544:    v.m=min rng upper_volume(chi(A,A),D) by A506,A543;
          m in dom v by A506,A543,FINSEQ_1:def 3;
then A545:    min rng upper_volume(chi(A,A),D) in rng v by A544,FUNCT_1:def 5;
A546:    rng v = rng v1 by A507,RFINSEQ:1;
        then consider m1 being Element of NAT such that
A547:    m1 in dom v1 & min rng upper_volume(chi(A,A),D)=v1.m1
        by A545,PARTFUN1:26;
          m1 >= 1 by A547,FINSEQ_3:27;
then A548:   v1.1 <= min rng upper_volume(chi(A,A),D) by A511,A536,A547,
INTEGRA2:2;
          v1.k in rng v1 by A511,FUNCT_1:def 5;
        then consider k2 being Element of NAT such that
A549:   k2 in dom v & v1.k = v.k2 by A546,PARTFUN1:26;
A550:   k2 in Seg len D by A506,A549,FINSEQ_1:def 3;
        then v1.k = vol(divset(D,k2)) by A506,A549;
then A551:   v1.k = upper_volume(chi(A,A),D).k2 by A550,INTEGRA1:22;
          k2 in Seg len upper_volume(chi(A,A),D) by A550,INTEGRA1:def 7;
        then k2 in dom upper_volume(chi(A,A),D) by FINSEQ_1:def 3;
        then v1.k in rng upper_volume(chi(A,A),D) by A551,FUNCT_1:def 5;
        then v1.k >= min rng upper_volume(chi(A,A),D) by SFMASTR3:def 1;
        hence thesis by A536,A548,AXIOMS:21;
       end;
       then consider D3 being Element of divs A such that
A552:  D<=D3 & D1<=D3 & rng D3=rng D1 \/
 rng D & lower_sum(f,D3)-lower_sum(f,D1)
       <=(len D)*(sup rng f-inf rng f)*delta(D1) by A19,A523;
A553:  lower_sum(f,D2)-lower_sum(f,D1)<=(len D)*(sup rng f-inf rng f)*delta(D1)
         by A519,A552,Th5;
         H-h <= H-h+1 by REAL_1:69;
       then p*(H-h)<=p*(H-h+1) by A512,AXIOMS:25;
then p*(H-h)*(delta(T)).m <= p*(H-h+1)*(delta(T)).m by A518,AXIOMS:25;
then A554:  lower_sum(f,D2)-lower_sum(f,T.m) <= p*(H-h+1)*(delta(T)).m
       by A521,A553,AXIOMS:22;
A555:  (delta(T)).m < min(v1.k,e/(2*p*(H-h+1))) by A515,A517;
         min(v1.k,e/(2*p*(H-h+1))) <= e/(2*p*(H-h+1)) by SQUARE_1:35;
       then (delta(T)).m < e/(2*p*(H-h+1)) by A555,AXIOMS:22;
       then (delta(T)).m*(2*p*(H-h+1))<e by A514,REAL_2:177;
       then (delta(T)).m*(2*(p*(H-h+1)))<e by XCMPLX_1:4;
       then ((delta(T)).m*(p*(H-h+1)))*2<e by XCMPLX_1:4;
then A556:  p*(H-h+1)*(delta(T)).m < e/2 by REAL_2:178;

       set s=lower_integral(f);
       set sD=lower_sum(f,D);
       set sD1=lower_sum(f,T.m);
       set sD2=lower_sum(f,D2);

         s+sD1-sD1-sD < e/2 by A505,XCMPLX_1:26;
       then s-sD1+sD1-sD < e/2 by XCMPLX_1:29;
       then s-sD1+sD1 < sD+e/2 by REAL_1:84;
       then s-sD1 < sD+e/2-sD1 by REAL_1:86;
then A557:  s-sD1 < sD-sD1+e/2 by XCMPLX_1:29;
         sD-sD1 = sD+sD2-sD2-sD1 by XCMPLX_1:26
        .= sD-sD2+sD2-sD1 by XCMPLX_1:29
        .= sD2-sD1+(sD-sD2) by XCMPLX_1:29;
       then (sD-sD1) - (sD2-sD1) = (sD-sD2) by XCMPLX_1:26;
       then sD-sD1 <= sD2-sD1 by A520,SQUARE_1:11;
       then sD-sD1 <= p*(H-h+1)*(delta(T)).m by A554,AXIOMS:22;
       then sD-sD1 < e/2 by A556,AXIOMS:22;
       then sD-sD1+e/2 < e/2+e/2 by REAL_1:53;
       then sD-sD1+e/2 <= e by XCMPLX_1:66;
       then s-sD1 < e by A557,AXIOMS:22;
then A558:   lower_integral(f)-(lower_sum(f,T)).m < e by INTEGRA2:def 5;
         T.m in divs A;
then A559:   T.m in dom lower_sum_set(f) by INTEGRA1:def 12;
         (lower_sum(f,T)).m = lower_sum(f,T.m) by INTEGRA2:def 5;
       then (lower_sum(f,T)).m = (lower_sum_set(f)).(T.m) by A559,INTEGRA1:def
12;
       then (lower_sum(f,T)).m in rng lower_sum_set(f) by A559,FUNCT_1:def 5;
       then sup rng lower_sum_set(f)>=(lower_sum(f,T)).m by A502,SEQ_4:def 4;
       then lower_integral(f)>=(lower_sum(f,T)).m by INTEGRA1:def 16;
       then lower_integral(f)-(lower_sum(f,T)).m >= 0 by SQUARE_1:12;
       then abs(lower_integral(f)-(lower_sum(f,T)).m) < e by A558,ABSVALUE:def
1
;
       then abs(-(lower_integral(f)-(lower_sum(f,T)).m)) < e by ABSVALUE:17;
       hence thesis by XCMPLX_1:143;
     end;
     take n;
     thus thesis by A516;
   end;
   hence lower_sum(f,T) is convergent by SEQ_2:def 6;
   hence thesis by A498,SEQ_2:def 7;
end;

theorem
  for A be closed-interval Subset of REAL, f be Function of A,REAL,
T be DivSequence of A
st f is_bounded_on A & delta(T) is convergent_to_0 & vol(A)<>0
holds upper_sum(f,T) is convergent & lim upper_sum(f,T) = upper_integral(f)
proof
   let A be closed-interval Subset of REAL;
   let f be Function of A,REAL;
   let T be DivSequence of A;
   assume A1:f is_bounded_on A;
   assume A2:delta(T) is convergent_to_0;
   assume A3:vol(A)<>0;
A4:delta(T) is_not_0 & delta(T) is convergent & lim delta(T) = 0
     by A2,FDIFF_1:def 1;
A5:for e st e>0 ex n st for m st n<=m holds
       0 < (delta(T)).m & (delta(T)).m < e
   proof
     let e; assume e>0;
     then consider n such that
A6:  for m st n<=m holds abs((delta(T)).m-0)<e by A4,SEQ_2:def 7;
     take n;
       let m; assume n<=m;
then A7:    abs((delta(T)).m-0)<e by A6;
         (delta(T)).m-0<=abs((delta(T)).m-0) by ABSVALUE:11;
then A8:    (delta(T)).m+abs((delta(T)).m-0)<e+abs((delta(T)).m-0) by A7,REAL_1
:67;
        A9: (delta(T)).m<>0 by A4,SEQ_1:7;
A10:   (delta(T)).m = delta(T.m) by INTEGRA2:def 3;
         delta(T.m) = max rng upper_volume(chi(A,A),T.m) by INTEGRA1:def 19;
       then delta(T.m) in rng upper_volume(chi(A,A),T.m) by PRE_CIRC:def 1;
       then consider i such that
A11:   i in dom upper_volume(chi(A,A),T.m) &
       delta(T.m)=upper_volume(chi(A,A),T.m).i by PARTFUN1:26;
A12:   i in Seg len upper_volume(chi(A,A),T.m) by A11,FINSEQ_1:def 3;
       reconsider D = T.m as Element of divs A;
         i in Seg len D by A12,INTEGRA1:def 7;
       then delta(T.m)=vol(divset(T.m,i)) by A11,INTEGRA1:22;
       hence thesis by A8,A9,A10,AXIOMS:24,INTEGRA1:11;
   end;
A13:for D,D1 be Element of divs A holds ex D2 be Element of divs A st
   D<=D2 & D1<=D2 & rng D2=rng D1 \/
 rng D & 0<=upper_sum(f,D)-upper_sum(f,D2) &
   0<=upper_sum(f,D1)-upper_sum(f,D2)
   proof
     let D,D1 be Element of divs A;
     consider D2 be Element of divs A such that
A14: D<=D2 & D1<=D2 & rng D2=rng D1 \/ rng D by Th3;
A15: f is_bounded_above_on A by A1,RFUNCT_1:def 11;
     then upper_sum(f,D2)<=upper_sum(f,D) by A14,INTEGRA1:47;
then A16: upper_sum(f,D)-upper_sum(f,D2)>=0 by SQUARE_1:12;
       upper_sum(f,D2)<=upper_sum(f,D1) by A14,A15,INTEGRA1:47;
     then upper_sum(f,D1)-upper_sum(f,D2)>=0 by SQUARE_1:12;
     hence thesis by A14,A16;
   end;
A17:sup rng f >= inf rng f by A1,Lm6;
A18:for D,D1 be Element of divs A st delta(D1)<min rng upper_volume(chi(A,A),D)
  holds ex D2 be Element of divs A st D<=D2 & D1<=D2 & rng D2=rng D1 \/ rng D
  & upper_sum(f,D1)-upper_sum(f,D2) <=
   (len D)*(sup(rng f)-inf(rng f))*delta(D1)
  proof
   let D,D1 be Element of divs A;
   assume A19:delta(D1)<min rng upper_volume(chi(A,A),D);
     ex D2 be Element of divs A st D<=D2 & D1<=D2 & rng D2=rng D1 \/ rng D
   & upper_sum(f,D1)-upper_sum(f,D2)<=(len D)*(sup(rng f)-inf(rng f))*delta(D1)
   proof
    consider D2 be Element of divs A such that
A20: D<=D2 & D1<=D2 & rng D2=rng D1 \/
 rng D & 0<=upper_sum(f,D)-upper_sum(f,D2)
    & 0<=upper_sum(f,D1)-upper_sum(f,D2) by A13;
      upper_sum(f,D1)-upper_sum(f,D2) <=
      (len D)*(sup(rng f)-inf(rng f))*delta(D1)
    proof
     deffunc PUf(Element of divs A,Nat) = (PartSums(upper_volume(f,$1))).$2;
     deffunc UVf(Element of divs A) = upper_volume(f,$1);
A21:  for i st i in dom D holds ex j st j in dom D1 & D.i in divset(D1,j)
     & PUf(D1,j)-PUf(D2,indx(D2,D1,j))<=i*(sup(rng f)-inf(rng f))*delta(D1)
     proof
      let i; assume A22:i in dom D;
A23:   for i,j st i in dom D & j in dom D1 & D.i in divset(D1,j) holds j >= 2
      proof
       let i,j;
       assume A24:i in dom D;
       assume A25:j in dom D1 & D.i in divset(D1,j);
       assume j<2;
       then j<1+1;
then A26:   j <= 1 by NAT_1:38;
A27:   inf divset(D1,j)<=D.i & D.i<=sup divset(D1,j) by A25,INTEGRA2:1;
         j in Seg len D1 by A25,FINSEQ_1:def 3;
       then j >= 1 by FINSEQ_1:3;
       then j = 1 by A26,AXIOMS:21;
then A28:   inf divset(D1,j)=inf A & sup divset(D1,j)=D1.j by A25,INTEGRA1:def
5;
         delta(D1) >= min rng upper_volume(chi(A,A),D)
       proof
        per cases;
         suppose A29:i=1;
           len D <> 0 by FINSEQ_1:25;
         then len D in Seg len D by FINSEQ_1:5;
         then 1 <= len D by FINSEQ_1:3;
then A30:     1 in dom D by FINSEQ_3:27;
then A31:      inf divset(D,1)=inf A & sup divset(D,1)=D.1 by INTEGRA1:def 5;
           sup divset(D1,j)-inf A >= D.1-inf A by A27,A29,REAL_1:49;
         then vol(divset(D1,j)) >= sup divset(D,1)-inf divset(D,1)
         by A28,A31,INTEGRA1:def 6;
then A32:      vol(divset(D1,j)) >= vol(divset(D,1)) by INTEGRA1:def 6;
           vol(divset(D1,j)) <= delta(D1) by A25,Lm8;
then A33:      delta(D1) >= vol(divset(D,1)) by A32,AXIOMS:22;
A34:      1 in Seg len D by A30,FINSEQ_1:def 3;
         then 1 in Seg len upper_volume(chi(A,A),D) by INTEGRA1:def 7;
then A35:     1 in dom upper_volume(chi(A,A),D) by FINSEQ_1:def 3;
           vol(divset(D,1)) = upper_volume(chi(A,A),D).1 by A34,INTEGRA1:22;
         then vol(divset(D,1)) in rng upper_volume(chi(A,A),D)
                          by A35,FUNCT_1:def 5;
         then vol(divset(D,1))>=min rng upper_volume(chi(A,A),D) by SFMASTR3:
def 1;
         hence thesis by A33,AXIOMS:22;
         suppose A36:i<>1;
then A37:     inf divset(D,i)=D.(i-1) & sup divset(D,i)=D.i by A24,INTEGRA1:def
5;
         then A38:      sup divset(D1,j)-inf divset(D1,j) >= sup divset(D,i)-
inf A
         by A27,A28,REAL_1:49;
           D.(i-1) in A by A24,A36,INTEGRA1:9;
         then inf A <= D.(i-1) by INTEGRA2:1;
         then sup divset(D,i)-inf A >= sup divset(D,i)-inf divset(D,i)
         by A37,REAL_2:106;
         then sup divset(D1,j)-inf divset(D1,j) >= sup divset(D,i)-inf divset(
D,i)
         by A38,AXIOMS:22;
         then vol(divset(D1,j)) >= sup divset(D,i)-inf divset(D,i)
         by INTEGRA1:def 6;
then A39:     vol(divset(D1,j)) >= vol(divset(D,i)) by INTEGRA1:def 6;
           vol(divset(D1,j)) <= delta(D1) by A25,Lm8;
then A40:     delta(D1) >= vol(divset(D,i)) by A39,AXIOMS:22;
A41:     i in Seg len D by A24,FINSEQ_1:def 3;
         then i in Seg len upper_volume(chi(A,A),D) by INTEGRA1:def 7;
then A42:     i in dom upper_volume(chi(A,A),D) by FINSEQ_1:def 3;
           vol(divset(D,i)) = upper_volume(chi(A,A),D).i by A41,INTEGRA1:22;
         then vol(divset(D,i)) in rng upper_volume(chi(A,A),D)
                          by A42,FUNCT_1:def 5;
         then vol(divset(D,i))>=min rng upper_volume(chi(A,A),D) by SFMASTR3:
def 1;
         hence thesis by A40,AXIOMS:22;
       end;
       hence contradiction by A19;
      end;
      defpred P[non empty Nat] means
      $1 in dom D implies
      ex j st j in dom D1 & D.$1 in divset(D1,j)
      & PUf(D1,j)-PUf(D2,indx(D2,D1,j))<=$1*(sup rng f-inf rng f)*delta(D1);

A43: P[1]
      proof
         len D <> 0 by FINSEQ_1:25;
       then len D in Seg len D by FINSEQ_1:5;
       then 1 <= len D by FINSEQ_1:3;
then A44:   1 in dom D by FINSEQ_3:27;
       then D.1 in A by INTEGRA1:8;
       then consider j such that
A45:   j in dom D1 & D.1 in divset(D1,j) by Th2;
         PUf(D1,j)-PUf(D2,indx(D2,D1,j))<=1*(sup rng f-inf rng f)*delta(D1)
       proof
A46:    j <> 1 by A23,A44,A45;
        then reconsider j1=j-1 as Element of NAT by A45,INTEGRA1:9;
A47:    j-1 in NAT & j-1 in dom D1 by A45,A46,INTEGRA1:9;
          inf divset(D1,j) <= D.1 & D.1 <= sup divset(D1,j) by A45,INTEGRA2:1;
        then A48:    D1.j1 <= D.1 & D.1 <= D1.j by A45,A46,INTEGRA1:def 5;
A49:    indx(D2,D1,j1) in dom D2 & 1 <= indx(D2,D1,j1) &
          indx(D2,D1,j1) <= len D2
        proof
         thus indx(D2,D1,j1) in dom D2 by A20,A47,INTEGRA1:def 21;
         then indx(D2,D1,j1) in Seg len D2 by FINSEQ_1:def 3;
         hence thesis by FINSEQ_1:3;
        end;
        then mid(D2,1,indx(D2,D1,j1)) is increasing by INTEGRA1:37;
then A50:    D2|indx(D2,D1,j1) is increasing by A49,JORDAN3:25;
A51:    j1 in dom D1 & 1 <= j1 & j1 <= len D1
        proof
         thus j1 in dom D1 by A45,A46,INTEGRA1:9;
           j1 in Seg len D1 by A47,FINSEQ_1:def 3;
         hence thesis by FINSEQ_1:3;
        end;
        then mid(D1,1,j1) is increasing by INTEGRA1:37;
then A52:    D1|j1 is increasing by A51,JORDAN3:25;
A53:    rng (D2|indx(D2,D1,j1)) = rng (D1|j1)
        proof
           for x1 st x1 in rng(D2|indx(D2,D1,j1)) holds x1 in rng(D1|j1)
         proof
          let x1; assume x1 in rng(D2|indx(D2,D1,j1));
          then consider k such that
A54:      k in dom(D2|indx(D2,D1,j1)) & x1=(D2|indx(D2,D1,j1)).k
          by PARTFUN1:26;
            k in Seg len(D2|indx(D2,D1,j1)) by A54,FINSEQ_1:def 3;
then A55:      k in Seg indx(D2,D1,j1) by A49,TOPREAL1:3;
then A56:      (D2|indx(D2,D1,j1)).k = D2.k & k in dom D2 by A49,RFINSEQ:19;
then A57:       D2.k in rng D2 by FUNCT_1:def 5;
            1 <= k & k <= indx(D2,D1,j1) by A55,FINSEQ_1:3;
          then D2.k <= D2.indx(D2,D1,j1) by A49,A56,GOBOARD2:18;
then A58:      D2.k <= D1.j1 by A20,A47,INTEGRA1:def 21;
A59:      len(D1|j1) = j1 by A51,TOPREAL1:3;
A60:      D2.k in rng D implies D2.k = D1.j1
          proof
           assume D2.k in rng D;
           then consider n such that
A61:       n in dom D & D2.k=D.n by PARTFUN1:26;
             1 <= n by A61,FINSEQ_3:27;
           then D.1 <= D2.k by A44,A61,GOBOARD2:18;
           then D1.j1 <= D2.k by A48,AXIOMS:22;
           hence thesis by A58,AXIOMS:21;
          end;
A62:      D2.k in rng D implies D2.k in rng(D1|j1)
          proof
           assume A63:D2.k in rng D;
             j1 in Seg len(D1|j1) by A51,A59,FINSEQ_1:3;
           then j1 in dom(D1|j1) by FINSEQ_1:def 3;
then A64:       (D1|j1).j1 in rng(D1|j1) by FUNCT_1:def 5;
             j1 in Seg j1 by A51,FINSEQ_1:3;
           hence thesis by A51,A60,A63,A64,RFINSEQ:19;
          end;
            D2.k in rng D1 implies D2.k in rng(D1|j1)
          proof
           assume D2.k in rng D1;
           then consider m such that
A65:       m in dom D1 & D2.k = D1.m by PARTFUN1:26;
             m in Seg len D1 by A65,FINSEQ_1:def 3;
then A66:       1 <= m & m <= j1 by A51,A58,A65,FINSEQ_1:3,GOBOARD1:def 1;
           then m in Seg len(D1|j1) by A59,FINSEQ_1:3;
then A67:       m in dom (D1|j1) by FINSEQ_1:def 3;
             m in Seg j1 by A66,FINSEQ_1:3;
           then D2.k = (D1|j1).m by A51,A65,RFINSEQ:19;
           hence thesis by A67,FUNCT_1:def 5;
          end;
          hence thesis by A20,A49,A54,A55,A57,A62,RFINSEQ:19,XBOOLE_0:def 2;
         end;
then A68:     rng(D2|indx(D2,D1,j1)) c= rng (D1|j1) by TARSKI:def 3;
           for x1 st x1 in rng(D1|j1) holds x1 in rng(D2|indx(D2,D1,j1))
         proof
          let x1; assume x1 in rng(D1|j1);
          then consider k such that
A69:      k in dom(D1|j1) & x1=(D1|j1).k by PARTFUN1:26;
            k in Seg len(D1|j1) by A69,FINSEQ_1:def 3;
then A70:      k in Seg j1 by A51,TOPREAL1:3;
then A71:      (D1|j1).k = D1.k & k in dom D1 by A51,RFINSEQ:19;
          then D1.k in rng D1 by FUNCT_1:def 5;
          then x1 in rng D2 by A20,A69,A71,XBOOLE_0:def 2;
          then consider n such that
A72:      n in dom D2 & x1=D2.n by PARTFUN1:26;
A73:      indx(D2,D1,k) in dom D2 & D2.indx(D2,D1,k)=D2.n
          by A20,A69,A71,A72,INTEGRA1:def 21;
            k <= j1 by A70,FINSEQ_1:3;
          then D1.k <= D1.j1 by A47,A71,GOBOARD2:18;
          then D2.indx(D2,D1,k) <= D1.j1 by A20,A71,INTEGRA1:def 21;
          then D2.indx(D2,D1,k)<=D2.indx(D2,D1,j1)
          by A20,A47,INTEGRA1:def 21;
then A74:      n <= indx(D2,D1,j1) by A49,A72,A73,GOBOARD1:def 1;
            1 <= n by A72,FINSEQ_3:27;
then A75:      n in Seg indx(D2,D1,j1) by A74,FINSEQ_1:3;
then A76:      D2.n = (D2|indx(D2,D1,j1)).n by A49,RFINSEQ:19;
            n in Seg len(D2|indx(D2,D1,j1)) by A49,A75,TOPREAL1:3;
          then n in dom(D2|indx(D2,D1,j1)) by FINSEQ_1:def 3;
          hence thesis by A72,A76,FUNCT_1:def 5;
         end;
         then rng(D1|j1) c= rng(D2|indx(D2,D1,j1)) by TARSKI:def 3;
         hence thesis by A68,XBOOLE_0:def 10;
        end;

then A77:   D2|indx(D2,D1,j1)=D1|j1 by A50,A52,Th5;
A78:   for k st 1 <= k & k <= j1 holds k=indx(D2,D1,k)
        proof
         let k; assume A79:1 <= k & k <= j1;
         assume A80:k<>indx(D2,D1,k);
           now per cases by A80,AXIOMS:21;
          suppose A81:k > indx(D2,D1,k);
            1 <= k & k <= len D1 by A51,A79,AXIOMS:22;
then A82:      k in dom D1 by FINSEQ_3:27;
then A83:      indx(D2,D1,k) in dom D2 & D1.k=D2.indx(D2,D1,k)
          by A20,INTEGRA1:def 21;
          then indx(D2,D1,k) in Seg len D2 by FINSEQ_1:def 3;
then A84:      1<=indx(D2,D1,k)&indx(D2,D1,k)<=indx(D2,D1,j1)
          by A20,A51,A79,A82,Th6,FINSEQ_1:3;
          then indx(D2,D1,k) in Seg indx(D2,D1,j1) by FINSEQ_1:3;
then A85:      (D2|indx(D2,D1,j1)).indx(D2,D1,k)=D2.indx(D2,D1,k) by A49,
RFINSEQ:19;
A86:      indx(D2,D1,k) < j1 by A79,A81,AXIOMS:22;
          then indx(D2,D1,k) <= len D1 by A51,AXIOMS:22;
          then indx(D2,D1,k) in dom D1 by A84,FINSEQ_3:27;
then A87:       D1.k > D1.indx(D2,D1,k) by A81,A82,GOBOARD1:def 1;
            indx(D2,D1,k) in Seg j1 by A84,A86,FINSEQ_1:3;
          hence contradiction by A51,A77,A83,A85,A87,RFINSEQ:19;

          suppose A88:k < indx(D2,D1,k);
            k in Seg j1 by A79,FINSEQ_1:3;
then A89:      D1.k = (D1|j1).k by A47,RFINSEQ:19;
       1 <= k & k <= len D1 by A51,A79,AXIOMS:22;
then A90:      k in dom D1 by FINSEQ_3:27;
then A91:      indx(D2,D1,k) in dom D2 & D1.k=D2.indx(D2,D1,k)
          by A20,INTEGRA1:def 21;
            indx(D2,D1,k) <= indx(D2,D1,j1) & indx(D2,D1,k) in dom D2 &
          indx(D2,D1,j1) in dom D2 by A20,A51,A79,A90,Th6;
then A92:      k <= indx(D2,D1,j1) by A88,AXIOMS:22;
          then k <= len D2 by A49,AXIOMS:22;
          then k in dom D2 by A79,FINSEQ_3:27;
then A93:      D2.k < D2.indx(D2,D1,k) by A88,A91,GOBOARD1:def 1;
            k in Seg indx(D2,D1,j1) by A79,A92,FINSEQ_1:3;
          hence contradiction by A49,A77,A89,A91,A93,RFINSEQ:19;
         end;
         hence contradiction;
        end;

A94:   len (D2|indx(D2,D1,j1))=len (D1|j1) by A50,A52,A53,Th5;
         len (D2|indx(D2,D1,j1))=indx(D2,D1,j1) by A49,TOPREAL1:3;
then A95:  indx(D2,D1,j1) =j1 by A51,A94,TOPREAL1:3;
         j1 <= len D1 by A47,FINSEQ_3:27;
        then j1 <= len upper_volume(f,D1) by INTEGRA1:def 7;
then A96:   len(upper_volume(f,D1)|j1)=indx(D2,D1,j1) by A95,TOPREAL1:3;
          indx(D2,D1,j1) in dom D2 by A20,A47,INTEGRA1:def 21;
        then indx(D2,D1,j1) <= len D2 by FINSEQ_3:27;
        then indx(D2,D1,j1) <= len upper_volume(f,D2) by INTEGRA1:def 7;
then A97:    len(upper_volume(f,D1)|j1)=len(upper_volume(f,D2)|indx(D2,D1,j1))
        by A96,TOPREAL1:3;
          for k st 1 <= k & k <= len(upper_volume(f,D1)|j1) holds
        (upper_volume(f,D1)|j1).k = (upper_volume(f,D2)|indx(D2,D1,j1)).k
        proof
         let k; assume A98:1 <= k & k <= len(upper_volume(f,D1)|j1);
A99:    len(upper_volume(f,D1)) = len D1 by INTEGRA1:def 7;
then A100:    1 <= k & k <= j1 by A51,A98,TOPREAL1:3;
then A101:    k in Seg j1 by FINSEQ_1:3;
           k <= len D1 by A51,A100,AXIOMS:22;
then A102:    k in Seg len D1 by A98,FINSEQ_1:3;
A103:    divset(D1,k)=divset(D2,indx(D2,D1,k))
         proof
A104:    divset(D2,indx(D2,D1,k))= [. inf divset(D2,indx(D2,D1,k)),
          sup divset(D2,indx(D2,D1,k)).] by INTEGRA1:5;
A105:     k in dom D1 by A102,FINSEQ_1:def 3;
then A106:     indx(D2,D1,k) in dom D2 & D1.k=D2.indx(D2,D1,k) by A20,INTEGRA1:
def 21;
            inf divset(D1,k)=inf divset(D2,indx(D2,D1,k)) &
          sup divset(D1,k)=sup divset(D2,indx(D2,D1,k))
          proof
           per cases;
            suppose A107:k=1;
then A108:       inf divset(D1,k)=inf A&sup divset(D1,k)=D1.k by A105,INTEGRA1:
def 5;
              indx(D2,D1,k)=1 by A51,A78,A107;
            hence thesis by A106,A108,INTEGRA1:def 5;

            suppose A109:k<>1;
then A110:       inf divset(D1,k)=D1.(k-1) & sup divset(D1,k)=D1.k
            by A105,INTEGRA1:def 5;
A111:       k-1 in dom D1 & D1.(k-1) in A & k-1 in NAT
            by A105,A109,INTEGRA1:9;
            reconsider k1=k-1 as Nat by A105,A109,INTEGRA1:9;
              k <= k+1 by NAT_1:29;
            then k1 <= k by REAL_1:86;
then A112:       k1 <= j1 by A100,AXIOMS:22;
              1 <= k1 by A111,FINSEQ_3:27;
then A113:       k1=indx(D2,D1,k1) by A78,A112;
              indx(D2,D1,k)<>1 by A78,A100,A109;
then A114:        inf divset(D2,indx(D2,D1,k))=D2.(indx(D2,D1,k)-1) &
            sup divset(D2,indx(D2,D1,k))=D2.indx(D2,D1,k) by A106,INTEGRA1:def
5;
              D2.(indx(D2,D1,k)-1)= D2.indx(D2,D1,k1) by A78,A100,A113;
            hence thesis by A20,A105,A110,A111,A114,INTEGRA1:def 21;
          end;
          hence thesis by A104,INTEGRA1:5;
         end;
           j1 in Seg len(upper_volume(f,D1)) by A51,A99,FINSEQ_1:def 3;
         then j1 in dom(upper_volume(f,D1)) by FINSEQ_1:def 3;
then A115:    (upper_volume(f,D1)|j1).k = upper_volume(f,D1).k by A101,RFINSEQ:
19
         .=(sup(rng(f|divset(D2,indx(D2,D1,k)))))*vol(divset(D2,indx(D2,D1,k)))
         by A102,A103,INTEGRA1:def 7;
           indx(D2,D1,k) in Seg j1 by A78,A100,A101;
then A116:    indx(D2,D1,k) in Seg indx(D2,D1,j1) by A51,A78;
         then 1<=indx(D2,D1,k) & indx(D2,D1,k)<=indx(D2,D1,j1) by FINSEQ_1:3;
         then 1<=indx(D2,D1,k) & indx(D2,D1,k)<=len D2 by A49,AXIOMS:22;
then A117:    indx(D2,D1,k) in Seg len D2 by FINSEQ_1:3;
           indx(D2,D1,j1) in Seg len D2 by A49,FINSEQ_1:def 3;
         then indx(D2,D1,j1) in Seg len upper_volume(f,D2) by INTEGRA1:def 7;
then A118:    indx(D2,D1,j1) in dom upper_volume(f,D2) by FINSEQ_1:def 3;
           (upper_volume(f,D2)|indx(D2,D1,j1)).k
          =(upper_volume(f,D2)|indx(D2,D1,j1)).indx(D2,D1,k) by A78,A100
         .=upper_volume(f,D2).indx(D2,D1,k) by A116,A118,RFINSEQ:19
         .=(sup(rng(f|divset(D2,indx(D2,D1,k)))))*vol(divset(D2,indx(D2,D1,k)))
         by A117,INTEGRA1:def 7;
         hence thesis by A115;
        end;
then A119:    upper_volume(f,D2)|indx(D2,D1,j1)=upper_volume(f,D1)|j1
        by A97,FINSEQ_1:18;
          indx(D2,D1,j1) in Seg len D2 by A49,FINSEQ_1:def 3;
then A120:   indx(D2,D1,j1) in Seg len upper_volume(f,D2) by INTEGRA1:def 7;
          j1 in Seg len D1 by A51,FINSEQ_1:def 3;
then A121:   j1 in Seg len upper_volume(f,D1) by INTEGRA1:def 7;
A122:   indx(D2,D1,j1)+1 <= indx(D2,D1,j)
        proof
           j < j+1 by NAT_1:38;
         then j1 < j by REAL_1:84;
         then indx(D2,D1,j1) < indx(D2,D1,j) by A20,A45,A51,Th7;
         hence thesis by NAT_1:38;
        end;
A123:    PUf(D2,indx(D2,D1,j1))=Sum(upper_volume(f,D2)|indx(D2,D1,j1))
        by A120,INTEGRA1:def 22
        .=PUf(D1,j1) by A119,A121,INTEGRA1:def 22;
A124:    Sum mid(upper_volume(f,D1),j,j)
        -Sum mid(upper_volume(f,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))
        <= (sup rng f-inf rng f)*delta(D1)
        proof
A125:   1 <= indx(D2,D1,j) & indx(D2,D1,j) <= len upper_volume(f,D2)
         proof
            indx(D2,D1,j) in dom D2 by A20,A45,INTEGRA1:def 21;
          then indx(D2,D1,j) in Seg len D2 by FINSEQ_1:def 3;
          then indx(D2,D1,j) in Seg len upper_volume(f,D2) by INTEGRA1:def 7;
          hence thesis by FINSEQ_1:3;
         end;
then A126:    1 <= indx(D2,D1,j1)+1 & indx(D2,D1,j1)+1 <= len upper_volume(f,D2
)
         by A49,A122,AXIOMS:22,NAT_1:38;
A127:     indx(D2,D1,j)-indx(D2,D1,j1) <= 2
         proof
          assume A128:indx(D2,D1,j)-indx(D2,D1,j1) > 2;
          reconsider ID1=indx(D2,D1,j1)+1 as Nat;
          reconsider ID2=ID1+1 as Nat;
A129:     indx(D2,D1,j1) < ID1 & ID1 < ID2 & ID2 < indx(D2,D1,j)
          proof
           thus indx(D2,D1,j1) < ID1 by NAT_1:38;
           thus ID1 < ID2 by NAT_1:38;
             indx(D2,D1,j1)+(1+1)<indx(D2,D1,j) by A128,REAL_1:86;
           hence thesis by XCMPLX_1:1;
          end;
A130:     indx(D2,D1,j) in dom D2 by A20,A45,INTEGRA1:def 21;
then A131:     indx(D2,D1,j) <= len D2 by FINSEQ_3:27;
A132:     ID1 in dom D2
          proof
A133:         1 <= ID1 & ID1 <= indx(D2,D1,j) by A49,A129,AXIOMS:22;
           then ID1 <= len D2 by A131,AXIOMS:22;
           hence thesis by A133,FINSEQ_3:27;
          end;
A134:     ID2 in dom D2
          proof
A135:         indx(D2,D1,j1) <= ID2 & ID2 <= len D2 by A129,A131,AXIOMS:22;
           then 1 <= ID2 by A49,AXIOMS:22;
           hence thesis by A135,FINSEQ_3:27;
          end;
then A136:     D2.indx(D2,D1,j1)<D2.ID1 & D2.ID1<D2.ID2 & D2.ID2<D2.indx(D2,D1,
j)
          by A49,A129,A130,A132,GOBOARD1:def 1;
A137:     D2.ID1 in rng D & D2.ID2 in rng D
          proof
           A138: D2.ID1 in rng D2 & D2.ID2 in rng D2 by A132,A134,FUNCT_1:def 5
;
A139:      D1.j1 = D2.indx(D2,D1,j1) & D1.j = D2.indx(D2,D1,j)
           by A20,A45,A51,INTEGRA1:def 21;
             not(D2.ID1 in rng D1) & not D2.ID2 in rng D1
           proof
            assume A140:D2.ID1 in rng D1 or D2.ID2 in rng D1;
            per cases by A140;
             suppose D2.ID1 in rng D1;
             then consider n such that
A141:        n in dom D1 & D1.n=D2.ID1 by PARTFUN1:26;
               D2.indx(D2,D1,j1)<D2.ID1 & D2.ID1<D2.indx(D2,D1,j)
             by A136,AXIOMS:22;
             then j1<n & n<j by A45,A51,A139,A141,GOBOARD2:18;
             then j<n+1 & n<j by REAL_1:84;
             hence contradiction by NAT_1:38;
             suppose D2.ID2 in rng D1;
             then consider n such that
A142:        n in dom D1 & D1.n=D2.ID2 by PARTFUN1:26;
               D2.indx(D2,D1,j1)<D2.ID2 & D2.ID2<D2.indx(D2,D1,j)
             by A136,AXIOMS:22;
             then j1<n & n<j by A45,A51,A139,A142,GOBOARD2:18;
             then j<n+1 & n<j by REAL_1:84;
             hence contradiction by NAT_1:38;
           end;
           hence thesis by A20,A138,XBOOLE_0:def 2;
          end;
A143:     inf divset(D1,j)=D2.indx(D2,D1,j1)
          & sup divset(D1,j)=D2.indx(D2,D1,j)
          proof
             inf divset(D1,j)=D1.j1 & sup divset(D1,j)=D1.j
           by A45,A46,INTEGRA1:def 5;
           hence thesis by A20,A45,A51,INTEGRA1:def 21;
          end;
A144:     D2.ID1 in rng D /\ divset(D1,j)
          proof
             D2.indx(D2,D1,j1)<=D2.ID1&D2.ID1<=D2.indx(D2,D1,j)
           by A136,AXIOMS:22;
           then D2.ID1 in divset(D1,j) by A143,INTEGRA2:1;
           hence thesis by A137,XBOOLE_0:def 3;
          end;
      D2.ID2 in rng D /\ divset(D1,j)
          proof
             D2.indx(D2,D1,j1)<=D2.ID2&D2.ID2<=D2.indx(D2,D1,j)
           by A136,AXIOMS:22;
           then D2.ID2 in divset(D1,j) by A143,INTEGRA2:1;
           hence thesis by A137,XBOOLE_0:def 3;
          end;
          then D2.ID1=D2.ID2 by A19,A45,A144,Th4;
          hence contradiction by A129,A132,A134,GOBOARD2:19;
         end;
       1 <= indx(D2,D1,j)-'(indx(D2,D1,j1)+1)+1 &
         indx(D2,D1,j)-'(indx(D2,D1,j1)+1)+1 <= 2
         proof
A145:     indx(D2,D1,j)-'(indx(D2,D1,j1)+1)
           =indx(D2,D1,j)-(indx(D2,D1,j1)+1) by A122,SCMFSA_7:3;
          then indx(D2,D1,j)-'(indx(D2,D1,j1)+1) >= 0 by A122,SQUARE_1:12;
          then indx(D2,D1,j)-'(indx(D2,D1,j1)+1)+1 >= 0+1 by AXIOMS:24;
          hence indx(D2,D1,j)-'(indx(D2,D1,j1)+1)+1 >= 1;
            indx(D2,D1,j)-'(indx(D2,D1,j1)+1)+1
           =indx(D2,D1,j)-indx(D2,D1,j1)-1+1 by A145,XCMPLX_1:36
          .=indx(D2,D1,j)-indx(D2,D1,j1)+1-1 by XCMPLX_1:29
          .=indx(D2,D1,j)-indx(D2,D1,j1) by XCMPLX_1:26;
          hence thesis by A127;
         end;
then A146:      1 <= len mid(upper_volume(f,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j
)) &
         len mid(upper_volume(f,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))<=2
         by A122,A125,A126,JORDAN3:27;
           1 <= j & j <= len D1 by A45,FINSEQ_3:27;
then A147:    1 <= j & j <= len upper_volume(f,D1) by INTEGRA1:def 7;
     j-'j+1 = 1 by Lm3;
then A148:    len mid(upper_volume(f,D1),j,j) = 1 by A147,JORDAN3:27;
           mid(upper_volume(f,D1),j,j).1 = upper_volume(f,D1).j
           by A147,JORDAN3:27;
         then mid(upper_volume(f,D1),j,j)
          =<*upper_volume(f,D1).j*> by A148,FINSEQ_1:57;
then A149:     Sum mid(upper_volume(f,D1),j,j)=upper_volume(f,D1).j by RVSUM_1:
103;
A150:     indx(D2,D1,j1)+1 in Seg len D2
         proof
            indx(D2,D1,j1)+1 in Seg len upper_volume(f,D2) by A126,FINSEQ_1:3;
          hence thesis by INTEGRA1:def 7;
         end;
A151:    j in Seg len D1 by A45,FINSEQ_1:def 3;
           now per cases by A146,Lm4;
          suppose
A152:      len mid(upper_volume(f,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))=1;
A153:      indx(D2,D1,j1)+1=indx(D2,D1,j)
          proof
             len mid(upper_volume(f,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))
           = indx(D2,D1,j)-'(indx(D2,D1,j1)+1)+1 by A122,A125,A126,JORDAN3:27;
           then indx(D2,D1,j)-'(indx(D2,D1,j1)+1)=1-1 by A152,XCMPLX_1:26;
           then indx(D2,D1,j)-(indx(D2,D1,j1)+1)=0 by A122,SCMFSA_7:3;
           then indx(D2,D1,j)=0+(indx(D2,D1,j1)+1) by XCMPLX_1:27;
           hence thesis;
          end;
A154:     divset(D2,indx(D2,D1,j))=divset(D1,j)
          proof
             inf divset(D1,j)=D2.indx(D2,D1,j1) &
           sup divset(D1,j)=D2.indx(D2,D1,j)
           proof
              inf divset(D1,j)=D1.j1 & sup divset(D1,j)=D1.j
            by A45,A46,INTEGRA1:def 5;
            hence thesis by A20,A45,A51,INTEGRA1:def 21;
           end;
then A155:      divset(D1,j)=[. D2.indx(D2,D1,j1),D2.indx(D2,D1,j).] by
INTEGRA1:5;
A156:      indx(D2,D1,j)-1=indx(D2,D1,j1) by A153,XCMPLX_1:26;
A157:      indx(D2,D1,j) in dom D2 by A20,A45,INTEGRA1:def 21;
             indx(D2,D1,j)<>1 by A49,A153,NAT_1:38;
           then inf divset(D2,indx(D2,D1,j))=D2.indx(D2,D1,j1)
           & sup divset(D2,indx(D2,D1,j))=D2.indx(D2,D1,j)
           by A156,A157,INTEGRA1:def 5;
           hence thesis by A155,INTEGRA1:5;
          end;
            mid(upper_volume(f,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j)).1
           =upper_volume(f,D2).(indx(D2,D1,j1)+1) by A125,A126,JORDAN3:27;
          then mid(upper_volume(f,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))
          =<*upper_volume(f,D2).(indx(D2,D1,j1)+1)*> by A152,FINSEQ_1:57;
          then A158: Sum mid(upper_volume(f,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j
))
           =upper_volume(f,D2).(indx(D2,D1,j1)+1) by RVSUM_1:103
          .=(sup(rng(f|divset(D2,(indx(D2,D1,j1)+1)))))
          *vol(divset(D2,(indx(D2,D1,j1)+1))) by A150,INTEGRA1:def 7
          .=Sum mid(upper_volume(f,D1),j,j)
            by A149,A151,A153,A154,INTEGRA1:def 7;
A159:      delta(D1) >= 0 by Th8;
            sup rng f - inf rng f >= 0 by A17,SQUARE_1:12;
          then (sup rng f - inf rng f)*delta(D1) >= 0*delta(D1) by A159,AXIOMS:
25;
          hence Sum mid(upper_volume(f,D1),j,j)
          -Sum mid(upper_volume(f,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))
          <= (sup rng f-inf rng f)*delta(D1) by A158,XCMPLX_1:14;
          suppose
A160:       len mid(upper_volume(f,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))=2;
A161:       mid(upper_volume(f,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j)).1
           =upper_volume(f,D2).(indx(D2,D1,j1)+1) by A125,A126,JORDAN3:27;
            mid(upper_volume(f,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j)).2
           =upper_volume(f,D2).(indx(D2,D1,j1)+2)
          proof
A162:       2+(indx(D2,D1,j1)+1)>=0+1 by A126,REAL_1:55;
             mid(upper_volume(f,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j)).2
            =UVf(D2).(2+(indx(D2,D1,j1)+1)-'1) by A122,A125,A126,A160,JORDAN3:
27
           .=UVf(D2).(2+(indx(D2,D1,j1)+1)-1) by A162,SCMFSA_7:3
           .=UVf(D2).((indx(D2,D1,j1)+1)+(2-1)) by XCMPLX_1:29
           .=UVf(D2).(indx(D2,D1,j1)+(1+1)) by XCMPLX_1:1;
           hence thesis;
          end;
          then mid(upper_volume(f,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))
          =<*upper_volume(f,D2).(indx(D2,D1,j1)+1),
             upper_volume(f,D2).(indx(D2,D1,j1)+2)*> by A160,A161,FINSEQ_1:61;
then A163:       Sum mid(upper_volume(f,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))
           =upper_volume(f,D2).(indx(D2,D1,j1)+1)
           +upper_volume(f,D2).(indx(D2,D1,j1)+2) by RVSUM_1:107;
A164:       vol(divset(D1,j))
          =vol(divset(D2,indx(D2,D1,j1)+1))+vol(divset(D2,indx(D2,D1,j1)+2))
          proof
A165:    inf divset(D1,j)=D2.indx(D2,D1,j1)&sup divset(D1,j)=D2.indx(D2,D1,j)
           proof
              inf divset(D1,j)=D1.j1 & sup divset(D1,j)=D1.j
            by A45,A46,INTEGRA1:def 5;
            hence thesis by A20,A45,A51,INTEGRA1:def 21;
           end;
A166:       indx(D2,D1,j)=indx(D2,D1,j1)+2
           proof
              indx(D2,D1,j)-'(indx(D2,D1,j1)+1)+1=2
            by A122,A125,A126,A160,JORDAN3:27;
            then 2=indx(D2,D1,j)-(indx(D2,D1,j1)+1)+1 by A122,SCMFSA_7:3
            .=indx(D2,D1,j)-indx(D2,D1,j1)-1+1 by XCMPLX_1:36
            .=indx(D2,D1,j)-indx(D2,D1,j1)-(1-1) by XCMPLX_1:37
            .=indx(D2,D1,j)-indx(D2,D1,j1);
            hence thesis by XCMPLX_1:27;
           end;
A167:       inf divset(D2,(indx(D2,D1,j1)+2))=D2.(indx(D2,D1,j1)+1)
           & sup divset(D2,(indx(D2,D1,j1)+2))=D2.(indx(D2,D1,j1)+2)
           & inf divset(D2,(indx(D2,D1,j1)+1))=D2.indx(D2,D1,j1)
           & sup divset(D2,(indx(D2,D1,j1)+1))=D2.(indx(D2,D1,j1)+1)
           proof
A168:        indx(D2,D1,j1)+2 in dom D2 by A20,A45,A166,INTEGRA1:def 21;
              indx(D2,D1,j1)+1 in Seg len upper_volume(f,D2) by A126,FINSEQ_1:3
;
            then indx(D2,D1,j1)+1 in Seg len D2 by INTEGRA1:def 7;
then A169:        indx(D2,D1,j1)+1 in dom D2 by FINSEQ_1:def 3;
A170:        indx(D2,D1,j1)+1 <> 1 by A49,NAT_1:38;
              indx(D2,D1,j1)+1+1 > 1 by A126,NAT_1:38;
            then A171: indx(D2,D1,j1)+(1+1) > 1 by XCMPLX_1:1;
A172:        indx(D2,D1,j1)+2-1=indx(D2,D1,j1)+1 by Lm2,XCMPLX_1:29;
A173:        indx(D2,D1,j1)+1-1=indx(D2,D1,j1)+(1-1) by XCMPLX_1:29
            .=indx(D2,D1,j1)+0;
            thus inf divset(D2,(indx(D2,D1,j1)+2))=D2.(indx(D2,D1,j1)+1)
            & sup divset(D2,(indx(D2,D1,j1)+2))=D2.(indx(D2,D1,j1)+2)
            by A168,A171,A172,INTEGRA1:def 5;
            thus thesis by A169,A170,A173,INTEGRA1:def 5;
           end;
             vol(divset(D1,j))
            =sup divset(D1,j)-inf divset(D1,j) by INTEGRA1:def 6
           .=D2.indx(D2,D1,j)-(D2.(indx(D2,D1,j1)+1)
            -D2.(indx(D2,D1,j1)+1))-D2.indx(D2,D1,j1) by A165,XCMPLX_1:17
           .=D2.(indx(D2,D1,j1)+2)-D2.(indx(D2,D1,j1)+1)
            +D2.(indx(D2,D1,j1)+1)-D2.indx(D2,D1,j1) by A166,XCMPLX_1:37;
           then vol(divset(D1,j))=vol(divset(D2,indx(D2,D1,j1)+2))
            +D2.(indx(D2,D1,j1)+1)-D2.indx(D2,D1,j1) by A167,INTEGRA1:def 6
           .=vol(divset(D2,indx(D2,D1,j1)+2))
            +(sup divset(D2,indx(D2,D1,j1)+1)-inf divset(D2,indx(D2,D1,j1)+1))
           by A167,XCMPLX_1:29;
           hence thesis by INTEGRA1:def 6;
          end;
then A174:     upper_volume(f,D1).j=(sup(rng(f|divset(D1,j))))*
          (vol(divset(D2,indx(D2,D1,j1)+1))+vol(divset(D2,indx(D2,D1,j1)+2)))
          by A151,INTEGRA1:def 7;
A175:       vol(divset(D2,indx(D2,D1,j1)+1))>=0 by INTEGRA1:11;
A176:      vol(divset(D2,indx(D2,D1,j1)+2))>=0 by INTEGRA1:11;
          A177: Sum mid(UVf(D1),j,j)-Sum mid(UVf(D2),indx(D2,D1,j1)+1,indx(D2,
D1,j))
          <=(sup rng f - inf rng f)*(vol(divset(D2,indx(D2,D1,j1)+2))
          +vol(divset(D2,indx(D2,D1,j1)+1)))
          proof
A178:      indx(D2,D1,j) in dom D2 by A20,A45,INTEGRA1:def 21;
then A179:       indx(D2,D1,j) in Seg len D2 by FINSEQ_1:def 3;
A180:      indx(D2,D1,j)=indx(D2,D1,j1)+2
           proof
              indx(D2,D1,j)-'(indx(D2,D1,j1)+1)+1=2
            by A122,A125,A126,A160,JORDAN3:27;
            then 2=indx(D2,D1,j)-(indx(D2,D1,j1)+1)+1 by A122,SCMFSA_7:3
            .=indx(D2,D1,j)-indx(D2,D1,j1)-1+1 by XCMPLX_1:36
            .=indx(D2,D1,j)-indx(D2,D1,j1)-(1-1) by XCMPLX_1:37
            .=indx(D2,D1,j)-indx(D2,D1,j1);
            hence thesis by XCMPLX_1:27;
           end;

           set ID1=indx(D2,D1,j1)+1;
           set ID2=indx(D2,D1,j1)+2;

A181:       Sum mid(UVf(D2),ID1,indx(D2,D1,j))
            =(sup rng(f|divset(D2,ID2)))*vol(divset(D2,ID2))
            +UVf(D2).ID1 by A163,A179,A180,INTEGRA1:def 7
           .=(sup rng(f|divset(D2,ID2)))*vol(divset(D2,ID2))
            +(sup rng(f|divset(D2,ID1)))
            *vol(divset(D2,ID1)) by A150,INTEGRA1:def 7;
             divset(D2,ID2) c= A by A178,A180,INTEGRA1:10;
           then sup rng(f|divset(D2,ID2)) >= inf rng f by A1,Lm7;
then A182:       (sup rng(f|divset(D2,ID2)))*vol(divset(D2,ID2))
           >=(inf rng f)*vol(divset(D2,ID2)) by A176,AXIOMS:25;
             ID1 in dom D2 by A150,FINSEQ_1:def 3;
           then divset(D2,ID1)c=A by INTEGRA1:10;
           then sup rng(f|divset(D2,ID1)) >= inf rng f by A1,Lm7;
then A183:       (sup rng(f|divset(D2,ID1)))*vol(divset(D2,ID1))
           >=(inf rng f)*vol(divset(D2,ID1)) by A175,AXIOMS:25;
             divset(D1,j)c=A by A45,INTEGRA1:10;
           then sup rng(f|divset(D1,j)) <= sup rng f by A1,Lm7;
then A184:      (sup rng(f|divset(D1,j)))*vol(divset(D2,ID2))
           <=(sup rng f)*vol(divset(D2,ID2))
           & (sup rng(f|divset(D1,j)))*vol(divset(D2,ID1))
           <=(sup rng f)*vol(divset(D2,ID1)) by A175,A176,AXIOMS:25;
           set SR = sup rng(f|divset(D2,ID1)), VR = vol(divset(D2,ID1));
             Sum mid(UVf(D2),ID1,indx(D2,D1,j)) - SR*VR
           >=(inf rng f)*vol(divset(D2,ID2)) by A181,A182,XCMPLX_1:26;
           then Sum mid(UVf(D2),ID1,indx(D2,D1,j))
           >=(inf rng f)*vol(divset(D2,ID2))+SR*VR by REAL_1:84;
           then Sum mid(UVf(D2),ID1,indx(D2,D1,j))-(inf rng f)*vol(divset(D2,
ID2))
           >=SR*VR by REAL_1:84;
           then Sum mid(UVf(D2),ID1,indx(D2,D1,j))-(inf rng f)*vol(divset(D2,
ID2))
           >=(inf rng f)*VR by A183,AXIOMS:22;
then A185:      Sum mid(UVf(D2),ID1,indx(D2,D1,j))>=(inf rng f)*vol(divset(D2,
ID2))+
           (inf rng f)*VR by REAL_1:84;
             Sum mid(UVf(D1),j,j)
            =(sup rng(f|divset(D1,j)))*vol(divset(D2,ID2))
            +(sup rng(f|divset(D1,j)))*vol(divset(D2,ID1))
           by A149,A174,XCMPLX_1:8;
           then Sum mid(UVf(D1),j,j)-(sup rng(f|divset(D1,j)))*vol(divset(D2,
ID1))
           =(sup rng(f|divset(D1,j)))*vol(divset(D2,ID2)) by XCMPLX_1:26;
           then Sum mid(UVf(D1),j,j)<=(sup rng(f|divset(D1,j)))*vol(divset(D2,
ID1))
           +(sup rng f)*vol(divset(D2,ID2)) by A184,REAL_1:86;
           then Sum mid(UVf(D1),j,j)-(sup rng f)*vol(divset(D2,ID2))
           <=(sup rng(f|divset(D1,j)))*vol(divset(D2,ID1)) by REAL_1:86;
           then Sum mid(UVf(D1),j,j)-(sup rng f)*vol(divset(D2,ID2))
           <=(sup rng f)*vol(divset(D2,ID1)) by A184,AXIOMS:22;
           then Sum mid(UVf(D1),j,j)
           <=(sup rng f)*vol(divset(D2,ID2))+(sup rng f)*vol(divset(D2,ID1))
           by REAL_1:86;
           then Sum mid(UVf(D1),j,j)-Sum mid(UVf(D2),ID1,indx(D2,D1,j))
           <=(sup rng f)*vol(divset(D2,ID2))+(sup rng f)*vol(divset(D2,ID1))
           -((inf rng f)*vol(divset(D2,ID2))+(inf rng f)*vol(divset(D2,ID1)))
           by A185,REAL_1:92;
           then Sum mid(UVf(D1),j,j)-Sum mid(UVf(D2),ID1,indx(D2,D1,j))
           <=((sup rng f)*vol(divset(D2,ID2))-(inf rng f)*vol(divset(D2,ID2)))
           +((sup rng f)*vol(divset(D2,ID1))-(inf rng f)*vol(divset(D2,ID1)))
           by Lm5;
           then Sum mid(UVf(D1),j,j)-Sum mid(UVf(D2),ID1,indx(D2,D1,j))
           <=(sup rng f - inf rng f)*vol(divset(D2,ID2))
           +((sup rng f)*vol(divset(D2,ID1))-(inf rng f)*vol(divset(D2,ID1)))
           by XCMPLX_1:40;
           then Sum mid(UVf(D1),j,j)-Sum mid(UVf(D2),ID1,indx(D2,D1,j))
           <=(sup rng f - inf rng f)*vol(divset(D2,ID2))
           +(sup rng f - inf rng f)*vol(divset(D2,ID1)) by XCMPLX_1:40;
           hence thesis by XCMPLX_1:8;
          end;
A186:      vol(divset(D1,j)) <= delta(D1) by A45,Lm8;
            sup rng f - inf rng f >= 0 by A17,SQUARE_1:12;
          then (sup rng f - inf rng f)*(vol(divset(D1,j)))
          <=(sup rng f - inf rng f)*delta(D1) by A186,AXIOMS:25;
          hence thesis by A164,A177,AXIOMS:22;
         end;
         hence thesis;
        end;

A187:    PUf(D2,indx(D2,D1,j1))
        +Sum mid(upper_volume(f,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))
        =PUf(D2,indx(D2,D1,j))
        proof
           indx(D2,D1,j) in dom D2 by A20,A45,INTEGRA1:def 21;
then A188:    indx(D2,D1,j) in Seg len D2 by FINSEQ_1:def 3;
         then A189: 1 <= indx(D2,D1,j) & indx(D2,D1,j) <= len D2 by FINSEQ_1:3;
then A190:    1 <= indx(D2,D1,j) & indx(D2,D1,j) <= len UVf(D2) by INTEGRA1:def
7;
A191:    indx(D2,D1,j) in Seg len UVf(D2) by A188,INTEGRA1:def 7;
A192:    indx(D2,D1,j1) < indx(D2,D1,j) by A122,NAT_1:38;
           indx(D2,D1,j1) in Seg len D2 by A49,FINSEQ_1:def 3;
         then indx(D2,D1,j1) in Seg len UVf(D2) by INTEGRA1:def 7;
         then PUf(D2,indx(D2,D1,j1))
         =Sum(UVf(D2)|indx(D2,D1,j1)) by INTEGRA1:def 22;
         then PUf(D2,indx(D2,D1,j1))
         +Sum mid(upper_volume(f,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))
          =Sum(UVf(D2)|indx(D2,D1,j1)
          ^mid(UVf(D2),(indx(D2,D1,j1)+1),indx(D2,D1,j))) by RVSUM_1:105
         .=Sum(mid(UVf(D2),1,indx(D2,D1,j1))
          ^mid(UVf(D2),indx(D2,D1,j1)+1,indx(D2,D1,j))) by A49,JORDAN3:25
         .=Sum(mid(UVf(D2),1,indx(D2,D1,j))) by A49,A190,A192,INTEGRA2:4
         .=Sum(UVf(D2)|indx(D2,D1,j)) by A189,JORDAN3:25;
         hence thesis by A191,INTEGRA1:def 22;
        end;
     PUf(D1,j1)+Sum mid(upper_volume(f,D1),j,j)=PUf(D1,j)
        proof
A193:    j in Seg len D1 by A45,FINSEQ_1:def 3;
         then A194: 1 <= j & j <= len D1 by FINSEQ_1:3;
then A195:    1 <= j & j <= len UVf(D1) by INTEGRA1:def 7;
A196:    j in Seg len UVf(D1) by A193,INTEGRA1:def 7;
A197:    j1+1=j by XCMPLX_1:27;
           j < j+1 by NAT_1:38;
then A198:    j1 < j by REAL_1:84;
           j1 in Seg len D1 by A51,FINSEQ_1:def 3;
         then j1 in Seg len UVf(D1) by INTEGRA1:def 7;
         then PUf(D1,j1)=Sum(UVf(D1)|j1) by INTEGRA1:def 22;
         then PUf(D1,j1)+Sum mid(UVf(D1),j,j)
          =Sum((UVf(D1)|j1)^mid(UVf(D1),j,j)) by RVSUM_1:105
         .=Sum(mid(UVf(D1),1,j1)^mid(UVf(D1),j1+1,j)) by A51,A197,JORDAN3:25
         .=Sum(mid(UVf(D1),1,j)) by A51,A195,A198,INTEGRA2:4
         .=Sum(UVf(D1)|j) by A194,JORDAN3:25;
         hence thesis by A196,INTEGRA1:def 22;
        end;
        then PUf(D1,j)-PUf(D2,indx(D2,D1,j))=(PUf(D1,j1)-PUf(D2,indx(D2,D1,j1)
))
         +(Sum mid(upper_volume(f,D1),j,j)
         -Sum mid(upper_volume(f,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j)))
           by A187,Lm5
        .=0+(Sum mid(upper_volume(f,D1),j,j)-
        Sum mid(upper_volume(f,D2),(indx(D2,D1,j1)+1),indx(D2,D1,j)))
        by A123,XCMPLX_1:14;
        hence thesis by A124;
       end;
       hence thesis by A45;
      end;
A199: for i being non empty Nat st P[i] holds P[i+1]
      proof
       let i be non empty Nat;
       assume A200:P[i];
A201:  i>=1 by RLVECT_1:99;
         P[i+1]
       proof
        assume A202:i+1 in dom D;
        then D.(i+1) in A by INTEGRA1:8;
        then consider j such that
A203:   j in dom D1 & D.(i+1) in divset(D1,j) by Th2;
          i+1 in Seg len D by A202,FINSEQ_1:def 3;
then A204:   1 <= i+1 & i+1 <= len D by FINSEQ_1:3;
          i <= i+1 by NAT_1:29;
        then i <= len D by A204,AXIOMS:22;
then A205:   i in Seg len D by A201,FINSEQ_1:3;
then A206:   i in dom D by FINSEQ_1:def 3;

        consider n1 being Nat such that
A207:     n1 in dom D1 & D.i in divset(D1,n1)
        & PUf(D1,n1)-PUf(D2,indx(D2,D1,n1))<=i*(sup rng f-inf rng f)*delta(D1)
        by A200,A205,FINSEQ_1:def 3;
A208:   indx(D2,D1,n1) in dom D2 & D2.indx(D2,D1,n1) = D1.n1
        by A20,A207,INTEGRA1:def 21;
then A209:   1 <= indx(D2,D1,n1) & indx(D2,D1,n1) <= len D2 by FINSEQ_3:27;
A210:   n1 < j
        proof
         assume A211:n1 >= j;
           now per cases by A211,REAL_1:def 5;
          suppose n1=j;
          then D.i in divset(D1,j) & D.i in rng D by A206,A207,FUNCT_1:def 5;
then A212:     D.i in rng D /\ divset(D1,j) by XBOOLE_0:def 3;
            D.(i+1) in rng D by A202,FUNCT_1:def 5;
          then D.(i+1) in rng D /\ divset(D1,j) by A203,XBOOLE_0:def 3;
then A213:     D.(i+1)=D.i by A19,A203,A212,Th4;
            i+1 > i by REAL_1:69;
          hence contradiction by A202,A206,A213,GOBOARD2:19;
          suppose n1>j;
then A214:       n1>=j+1 by NAT_1:38;
then A215:       n1-1 >= j by REAL_1:84;
A216:       inf divset(D1,n1) <= D.i by A207,INTEGRA2:1;
A217:       D.(i+1)<=sup divset(D1,j) by A203,INTEGRA2:1;
            1 <= j by A203,FINSEQ_3:27;
          then 1+1 <= j+1 by AXIOMS:24;
then A218:     n1 <> 1 by A214,AXIOMS:22;
          then n1-1 in dom D1 by A207,INTEGRA1:9;
then A219:     D1.j <= D1.(n1-1) by A203,A215,GOBOARD2:18;
A220:     sup divset(D1,j)=D1.j
          proof
           per cases;
            suppose j=1;
            hence thesis by A203,INTEGRA1:def 5;
            suppose j<>1;
            hence thesis by A203,INTEGRA1:def 5;
          end;
            inf divset(D1,n1)=D1.(n1-1) by A207,A218,INTEGRA1:def 5;
          then D.i >= D1.j by A216,A219,AXIOMS:22;
then A221:     D.i >= D.(i+1) by A217,A220,AXIOMS:22;
            i < i+1 by REAL_1:69;
          hence contradiction by A202,A206,A221,GOBOARD1:def 1;
         end;
         hence thesis;
        end;
then A222:    n1+1 <= j by NAT_1:38;
then A223:    j-n1 >= 1 by REAL_1:84;
A224:    n1 >= 1 by A207,FINSEQ_3:27;
A225:    1 <= n1 & 1 <= j & j <= len D1 by A203,A207,FINSEQ_3:27;
then A226:    1 <= n1+1 & n1+1 <= len D1 by A222,AXIOMS:22,NAT_1:37;
then A227:    n1+1 in dom D1 by FINSEQ_3:27;
then A228:    indx(D2,D1,n1+1) in dom D2 & D2.indx(D2,D1,n1+1)=D1.(n1+1)
        by A20,INTEGRA1:def 21;
A229:    indx(D2,D1,j) in dom D2 & D2.indx(D2,D1,j)=D1.j
        by A20,A203,INTEGRA1:def 21;
          D1.(n1+1) <= D1.j by A203,A222,A227,GOBOARD2:18;
then A230:    indx(D2,D1,n1+1) <= indx(D2,D1,j) by A228,A229,GOBOARD1:def 1;
A231:    1 <= indx(D2,D1,n1+1) & indx(D2,D1,n1+1) <= len D2 by A228,FINSEQ_3:27
;
A232:    1 <= indx(D2,D1,j) & indx(D2,D1,j) <= len D2 by A229,FINSEQ_3:27;
          n1 < n1+1 by NAT_1:38;
        then D1.n1 < D1.(n1+1) by A207,A227,GOBOARD1:def 1;
then A233:   indx(D2,D1,n1) < indx(D2,D1,n1+1) by A208,A228,GOBOARD2:18;
          1+indx(D2,D1,n1+1) <= indx(D2,D1,j)+1 by A230,AXIOMS:24;
        then 1 <= indx(D2,D1,j)+1-indx(D2,D1,n1+1) by REAL_1:84;
then A234:     mid(D2,indx(D2,D1,n1+1),indx(D2,D1,j)).1
        =D2.(1-1+indx(D2,D1,n1+1)) by A230,A231,A232,JORDAN3:31
        .=D1.(n1+1) by A20,A227,INTEGRA1:def 21;
A235: Sum mid(UVf(D1),n1+1,j)-Sum mid(UVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j))
        <= (sup rng f-inf rng f)*delta(D1)
        proof
        per cases by A222,REAL_1:def 5;
        suppose A236:n1+1=j;
then A237:    n1=j-1 by XCMPLX_1:26;
A238:     1 <= n1+1 & n1+1 <= len UVf(D1) by A226,INTEGRA1:def 7;
A239:     j-'(n1+1)+1=j-(n1+1)+1 by A236,SCMFSA_7:3;
A240:     n1+1 in Seg len D1 by A227,FINSEQ_1:def 3;
A241:     len mid(UVf(D1),n1+1,j)=j-'(n1+1)+1 by A236,A238,JORDAN3:27
        .= 1 by A236,A239,XCMPLX_1:25;
          (n1+1)+1 <= j+1 by A222,AXIOMS:24;
        then 1 <= j+1-(n1+1) by REAL_1:84;
        then mid(UVf(D1),n1+1,j).1 = UVf(D1).(1+(n1+1)-1)
        by A236,A238,JORDAN3:31
        .= UVf(D1).(n1+1) by XCMPLX_1:26
        .=(sup rng(f|divset(D1,n1+1)))*vol(divset(D1,n1+1))
        by A240,INTEGRA1:def 7;
        then mid(UVf(D1),n1+1,j)
        =<*(sup rng(f|divset(D1,n1+1)))*vol(divset(D1,n1+1))*>
        by A241,FINSEQ_1:57;
then A242:     Sum mid(UVf(D1),n1+1,j)
        =(sup rng(f|divset(D1,n1+1)))*vol(divset(D1,n1+1)) by RVSUM_1:103;
           divset(D1,n1+1) c= A by A227,INTEGRA1:10;
then A243:    sup rng(f|divset(D1,n1+1)) <= sup rng f by A1,Lm7;
          vol(divset(D1,n1+1)) >= 0 by INTEGRA1:11;
then A244:    Sum mid(UVf(D1),n1+1,j)
        <=(sup rng f)*vol(divset(D1,n1+1)) by A242,A243,AXIOMS:25;
          D1.n1 < D1.j by A203,A207,A210,GOBOARD1:def 1;
then A245:    indx(D2,D1,n1)<indx(D2,D1,j) by A208,A229,GOBOARD2:18;
then A246:   indx(D2,D1,n1)+1 <= indx(D2,D1,j) by NAT_1:38;
        then indx(D2,D1,n1)+1 <= len D2 by A232,AXIOMS:22;
then A247:   indx(D2,D1,n1)+1 <= len UVf(D2) by INTEGRA1:def 7;
A248:   1<=indx(D2,D1,n1)+1 by NAT_1:37;
A249:   indx(D2,D1,j) <= len UVf(D2) by A232,INTEGRA1:def 7;
then A250:   len mid(UVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j))
        =indx(D2,D1,j)-'(indx(D2,D1,n1)+1)+1 by A232,A246,A247,A248,JORDAN3:27
        .=indx(D2,D1,j)-(indx(D2,D1,n1)+1)+1 by A246,SCMFSA_7:3
        .=indx(D2,D1,j)-indx(D2,D1,n1)-1+1 by XCMPLX_1:36
        .=indx(D2,D1,j)-indx(D2,D1,n1)-(1-1) by XCMPLX_1:37
        .=indx(D2,D1,j)-indx(D2,D1,n1);
A251:    indx(D2,D1,j)-indx(D2,D1,n1)<=2
        proof
         assume indx(D2,D1,j) - indx(D2,D1,n1) > 2;
then A252:     indx(D2,D1,n1)+2 < indx(D2,D1,j) by REAL_1:86;
A253:     indx(D2,D1,n1) < indx(D2,D1,n1)+1 by NAT_1:38;
A254:     indx(D2,D1,n1)+1 < indx(D2,D1,n1)+2 by REAL_1:53;
A255:     indx(D2,D1,n1)+1 < indx(D2,D1,j) & indx(D2,D1,n1)+1 in dom D2
         proof
          thus indx(D2,D1,n1)+1 < indx(D2,D1,j) by A252,A254,AXIOMS:22;
          then 1 <= indx(D2,D1,n1)+1 & indx(D2,D1,n1)+1 <= len D2
          by A209,A232,AXIOMS:22,NAT_1:38;
          hence thesis by FINSEQ_3:27;
         end;
A256:    D2.(indx(D2,D1,n1)+1) in rng D
         proof
          A257: D2.(indx(D2,D1,n1)+1) in rng D2 by A255,FUNCT_1:def 5;
            not D2.(indx(D2,D1,n1)+1) in rng D1
          proof
           assume D2.(indx(D2,D1,n1)+1) in rng D1;
           then consider k1 being Nat such that
A258:       k1 in dom D1 & D2.(indx(D2,D1,n1)+1) = D1.k1 by PARTFUN1:26;
             D2.indx(D2,D1,n1) < D2.(indx(D2,D1,n1)+1)
           & D2.(indx(D2,D1,n1)+1) < D2.indx(D2,D1,j)
           by A208,A229,A253,A255,GOBOARD1:def 1;
           then n1 < k1 & k1 < j by A203,A207,A208,A229,A258,GOBOARD2:18;
           hence contradiction by A236,NAT_1:38;
          end;
          hence thesis by A20,A257,XBOOLE_0:def 2;
         end;
A259:    D2.(indx(D2,D1,n1)+1) in rng D /\ divset(D1,j)
         proof
A260:      inf divset(D1,j) = D1.(j-1) & sup divset(D1,j) = D1.j
          by A203,A210,A224,INTEGRA1:def 5;
            D2.(indx(D2,D1,n1)+1) >= D2.indx(D2,D1,n1)
          & D2.indx(D2,D1,j) >= D2.(indx(D2,D1,n1)+1)
          by A208,A229,A253,A255,GOBOARD2:18;
          then D2.(indx(D2,D1,n1)+1) in divset(D1,j) by A208,A229,A237,A260,
INTEGRA2:1;
          hence thesis by A256,XBOOLE_0:def 3;
         end;
A261:     indx(D2,D1,n1) < indx(D2,D1,n1)+2 & indx(D2,D1,n1)+2 in dom D2
         proof
          thus indx(D2,D1,n1) < indx(D2,D1,n1)+2 by A254,NAT_1:38;
          then 1 <= indx(D2,D1,n1)+2 & indx(D2,D1,n1)+2 <= len D2
          by A209,A232,A252,AXIOMS:22;
          hence thesis by FINSEQ_3:27;
         end;
A262:     D2.(indx(D2,D1,n1)+2) in rng D
         proof
          A263: D2.(indx(D2,D1,n1)+2) in rng D2 by A261,FUNCT_1:def 5;
            not D2.(indx(D2,D1,n1)+2) in rng D1
          proof
           assume D2.(indx(D2,D1,n1)+2) in rng D1;
           then consider k1 being Nat such that
A264:       k1 in dom D1 & D2.(indx(D2,D1,n1)+2) = D1.k1 by PARTFUN1:26;
             D2.indx(D2,D1,n1) < D2.(indx(D2,D1,n1)+2)
           & D2.(indx(D2,D1,n1)+2) < D2.indx(D2,D1,j)
           by A208,A229,A252,A261,GOBOARD1:def 1;
           then n1 < k1 & k1 < j by A203,A207,A208,A229,A264,GOBOARD2:18;
           hence contradiction by A236,NAT_1:38;
          end;
          hence thesis by A20,A263,XBOOLE_0:def 2;
         end;
     D2.(indx(D2,D1,n1)+2) in rng D /\ divset(D1,j)
         proof
A265:      inf divset(D1,j) = D1.(j-1) & sup divset(D1,j) = D1.j
          by A203,A210,A224,INTEGRA1:def 5;
            D2.(indx(D2,D1,n1)+2) >= D2.indx(D2,D1,n1)
          & D2.indx(D2,D1,j) >= D2.(indx(D2,D1,n1)+2)
          by A208,A229,A252,A261,GOBOARD2:18;
          then D2.(indx(D2,D1,n1)+2) in divset(D1,j) by A208,A229,A237,A265,
INTEGRA2:1;
          hence thesis by A262,XBOOLE_0:def 3;
         end;
         then D2.(indx(D2,D1,n1)+1) = D2.(indx(D2,D1,n1)+2) by A19,A203,A259,
Th4;
         hence contradiction by A254,A255,A261,GOBOARD1:def 1;
        end;
A266:    indx(D2,D1,j)-indx(D2,D1,n1)=1 or indx(D2,D1,j)-indx(D2,D1,n1)=2
        proof
           indx(D2,D1,n1)+1 <= indx(D2,D1,j) by A245,NAT_1:38;
then A267:     indx(D2,D1,n1)+1 = indx(D2,D1,j) or
         indx(D2,D1,n1)+1 < indx(D2,D1,j) by REAL_1:def 5;
           indx(D2,D1,n1)+1<indx(D2,D1,j) implies indx(D2,D1,n1)+2=indx(D2,D1,j
)
         proof
          assume indx(D2,D1,n1)+1 < indx(D2,D1,j);
          then indx(D2,D1,n1)+1+1 <= indx(D2,D1,j) by NAT_1:38;
then A268:      indx(D2,D1,n1)+(1+1) <= indx(D2,D1,j) by XCMPLX_1:1;
            indx(D2,D1,n1)+2 >= indx(D2,D1,j) by A251,REAL_1:86;
          hence thesis by A268,AXIOMS:21;
         end;
         hence thesis by A267,XCMPLX_1:26;
        end;
          Sum mid(UVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j))
        >=(inf rng f)*vol(divset(D1,n1+1))
        proof
           now per cases by A266;
          suppose A269:indx(D2,D1,j)-indx(D2,D1,n1)=1;
          then 1=indx(D2,D1,j)-indx(D2,D1,n1)-1+1
          .=indx(D2,D1,j)-(indx(D2,D1,n1)+1)+1 by XCMPLX_1:36;
then A270:      mid(UVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j)).1
          =UVf(D2).(1+(indx(D2,D1,n1)+1)-1) by A246,A248,A249,JORDAN3:31
          .=UVf(D2).((indx(D2,D1,n1)+1)-1+1) by XCMPLX_1:29
          .=UVf(D2).((indx(D2,D1,n1)+1)-(1-1)) by XCMPLX_1:37
          .=UVf(D2).(indx(D2,D1,n1)+1);
A271:      indx(D2,D1,n1)+1=indx(D2,D1,j) by A269,XCMPLX_1:27;
then indx(D2,D1,n1)+1 in Seg len D2 by A229,FINSEQ_1:def 3;
then A272:      UVf(D2).(indx(D2,D1,n1)+1)
          =(sup rng(f|divset(D2,indx(D2,D1,n1)+1)))
           *vol(divset(D2,indx(D2,D1,n1)+1)) by INTEGRA1:def 7;
A273:      divset(D2,indx(D2,D1,n1)+1)=divset(D1,n1+1)
          proof
A274:       divset(D2,indx(D2,D1,n1)+1) =[.inf divset(D2,indx(D2,D1,n1)+1),
           sup divset(D2,indx(D2,D1,n1)+1).] by INTEGRA1:5;
A275:       divset(D1,n1+1)=[.inf divset(D1,n1+1), sup divset(D1,n1+1).]
           by INTEGRA1:5;
             indx(D2,D1,n1)+1 >= 1+1 by A209,AXIOMS:24;
           then indx(D2,D1,n1)+1 <>1;
           then inf divset(D2,indx(D2,D1,n1)+1)=D2.(indx(D2,D1,n1)+1-1)
           & sup divset(D2,indx(D2,D1,n1)+1)=D2.(indx(D2,D1,n1)+1)
           by A229,A271,INTEGRA1:def 5;
then A276:       inf divset(D2,indx(D2,D1,n1)+1)=D1.n1
           & sup divset(D2,indx(D2,D1,n1)+1)=D1.j by A20,A203,A208,A271,
INTEGRA1:def 21,XCMPLX_1:26;
             inf divset(D1,n1+1)=D1.(n1+1-1) & sup divset(D1,n1+1)=D1.(n1+1)
           by A210,A224,A227,A236,INTEGRA1:def 5;
           hence thesis by A236,A274,A275,A276,XCMPLX_1:26;
          end;
A277:      sup rng(f|divset(D2,indx(D2,D1,n1)+1))>=inf rng f by A1,A229,A271,
Th18;
            vol(divset(D2,indx(D2,D1,n1)+1))>=0 by INTEGRA1:11;
then A278:      UVf(D2).(indx(D2,D1,n1)+1)
          >=(inf rng f)*vol(divset(D1,n1+1)) by A272,A273,A277,AXIOMS:25;
            mid(UVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j))
          =<*UVf(D2).(indx(D2,D1,n1)+1)*> by A250,A269,A270,FINSEQ_1:57;
          hence Sum mid(UVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j))
          >=(inf rng f)*vol(divset(D1,n1+1)) by A278,RVSUM_1:103;
          suppose A279:indx(D2,D1,j)-indx(D2,D1,n1)=2;
then A280:      indx(D2,D1,j)=indx(D2,D1,n1)+2 by XCMPLX_1:27;
A281:      indx(D2,D1,n1)+2-1=indx(D2,D1,n1)+(2-1) by XCMPLX_1:29
          .=indx(D2,D1,n1)+1;
then indx(D2,D1,j)-(indx(D2,D1,n1)+1)=1 by A280,XCMPLX_1:18;
then A282:     indx(D2,D1,j)-(indx(D2,D1,n1)+1)+1>=1;
A283:     indx(D2,D1,j)-(indx(D2,D1,n1)+1)+1=1+1 by A280,A281,XCMPLX_1:18;
A284:      1 <= indx(D2,D1,n1)+1 & indx(D2,D1,n1)+1 <= indx(D2,D1,n1)+2
          by NAT_1:37,REAL_1:53;
          then indx(D2,D1,n1)+1 <= len D2 by A232,A280,AXIOMS:22;
then A285:      indx(D2,D1,n1)+1 in dom D2 by A284,FINSEQ_3:27;
A286:     indx(D2,D1,j) <= len UVf(D2) by A232,INTEGRA1:def 7;
then A287:      mid(UVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j)).1
          =UVf(D2).(1+(indx(D2,D1,n1)+1)-1) by A280,A282,A284,JORDAN3:31
          .=UVf(D2).((indx(D2,D1,n1)+1)-1+1) by XCMPLX_1:29
          .=UVf(D2).((indx(D2,D1,n1)+1)-(1-1)) by XCMPLX_1:37
          .=UVf(D2).(indx(D2,D1,n1)+1);
            mid(UVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j)).2
          =UVf(D2).(2+(indx(D2,D1,n1)+1)-1)
          by A280,A283,A284,A286,JORDAN3:31
          .=UVf(D2).((indx(D2,D1,n1)+1)-1+2) by XCMPLX_1:29
          .=UVf(D2).(indx(D2,D1,n1)+(1-1)+2) by XCMPLX_1:29
          .=UVf(D2).(indx(D2,D1,n1)+0+2);
          then mid(UVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j))
          =<*UVf(D2).(indx(D2,D1,n1)+1),UVf(D2).(indx(D2,D1,n1)+2)*>
          by A250,A279,A287,FINSEQ_1:61;
then A288:      Sum mid(UVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j))
          =UVf(D2).(indx(D2,D1,n1)+1)+UVf(D2).(indx(D2,D1,n1)+2)
          by RVSUM_1:107;
A289:      UVf(D2).(indx(D2,D1,n1)+1)
          >= (inf rng f)*vol(divset(D2,indx(D2,D1,n1)+1))
          proof
             indx(D2,D1,n1)+1 in Seg len D2 by A285,FINSEQ_1:def 3;
then A290:      UVf(D2).(indx(D2,D1,n1)+1)
           =(sup rng(f|divset(D2,indx(D2,D1,n1)+1)))
            *vol(divset(D2,indx(D2,D1,n1)+1)) by INTEGRA1:def 7;
A291:      sup rng(f|divset(D2,indx(D2,D1,n1)+1))
           >=inf rng f by A1,A285,Th18;
             vol(divset(D2,indx(D2,D1,n1)+1)) >= 0 by INTEGRA1:11;
           hence thesis by A290,A291,AXIOMS:25;
          end;
            UVf(D2).(indx(D2,D1,n1)+2)
          >= (inf rng f)*vol(divset(D2,indx(D2,D1,n1)+2))
          proof
             indx(D2,D1,n1)+2 in Seg len D2 by A229,A280,FINSEQ_1:def 3;
then A292:      UVf(D2).(indx(D2,D1,n1)+2)
           =(sup rng(f|divset(D2,indx(D2,D1,n1)+2)))
            *vol(divset(D2,indx(D2,D1,n1)+2)) by INTEGRA1:def 7;
A293:      sup rng(f|divset(D2,indx(D2,D1,n1)+2))
           >=inf rng f by A1,A229,A280,Th18;
             vol(divset(D2,indx(D2,D1,n1)+2)) >= 0 by INTEGRA1:11;
           hence thesis by A292,A293,AXIOMS:25;
          end;
then A294:      Sum mid(UVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j))
          >= (inf rng f)*vol(divset(D2,indx(D2,D1,n1)+1))
          + (inf rng f)*vol(divset(D2,indx(D2,D1,n1)+2)) by A288,A289,REAL_1:55
;
       vol(divset(D2,indx(D2,D1,n1)+1))+vol(divset(D2,indx(D2,D1,n1)+2))
          =vol(divset(D1,n1+1))
          proof
             indx(D2,D1,n1)+1 > 1 by A209,NAT_1:38;
then A295:       inf divset(D2,indx(D2,D1,n1)+1) = D2.(indx(D2,D1,n1)+1-1)
           & sup divset(D2,indx(D2,D1,n1)+1)=D2.(indx(D2,D1,n1)+1)
           by A285,INTEGRA1:def 5;
then A296:       inf divset(D2,indx(D2,D1,n1)+1) = D2.indx(D2,D1,n1) by
XCMPLX_1:26;
             indx(D2,D1,n1)+2 >= 2+1 by A209,AXIOMS:24;
           then indx(D2,D1,n1)+2 <> 1;
then A297:       inf divset(D2,indx(D2,D1,n1)+2) = D2.(indx(D2,D1,n1)+1)
           & sup divset(D2,indx(D2,D1,n1)+2)=D2.indx(D2,D1,j)
           by A229,A280,A281,INTEGRA1:def 5;
A298:       vol(divset(D2,indx(D2,D1,n1)+1))
           =D2.(indx(D2,D1,n1)+1)-D1.n1 by A208,A295,A296,INTEGRA1:def 6;
           A299: vol(divset(D2,indx(D2,D1,n1)+2))
           =D1.j-D2.(indx(D2,D1,n1)+1) by A229,A297,INTEGRA1:def 6;
             vol(divset(D1,n1+1))=D1.(n1+1)-D1.n1
           proof
A300:       inf divset(D1,n1+1)=D1.(n1+1-1) & sup divset(D1,n1+1)=D1.(n1+1)
            by A210,A224,A227,A236,INTEGRA1:def 5;
            then inf divset(D1,n1+1)=D1.n1 by XCMPLX_1:26;
            hence thesis by A300,INTEGRA1:def 6;
           end;
           hence thesis by A236,A298,A299,XCMPLX_1:39;
          end;
          hence Sum mid(UVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j))
          >=(inf rng f)*vol(divset(D1,n1+1)) by A294,XCMPLX_1:8;
         end;
         hence thesis;
        end;
        then Sum mid(UVf(D1),n1+1,j)-Sum mid(UVf(D2),indx(D2,D1,n1)+1,indx(D2,
D1,j))
        <=(sup rng f)*vol(divset(D1,n1+1))-(inf rng f)*vol(divset(D1,n1+1))
        by A244,REAL_1:92;
then A301: Sum mid(UVf(D1),n1+1,j)-Sum mid(UVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,
j))
        <=(sup rng f-inf rng f)*vol(divset(D1,n1+1)) by XCMPLX_1:40;
          sup rng f >= inf rng f by A1,Lm6;
then A302:    sup rng f-inf rng f >= 0 by SQUARE_1:12;
          vol(divset(D1,n1+1))<=delta(D1)
        proof
A303:     n1+1 in Seg len D1 by A227,FINSEQ_1:def 3;
then A304:     vol(divset(D1,n1+1))=upper_volume(chi(A,A),D1).(n1+1) by
INTEGRA1:22;
           n1+1 in Seg len upper_volume(chi(A,A),D1) by A303,INTEGRA1:def 7;
         then n1+1 in dom upper_volume(chi(A,A),D1) by FINSEQ_1:def 3;
then A305:     vol(divset(D1,n1+1)) in rng upper_volume(chi(A,A),D1)
         by A304,FUNCT_1:def 5;
           delta(D1)=max rng upper_volume(chi(A,A),D1) by INTEGRA1:def 19;
         hence thesis by A305,PRE_CIRC:def 1;
        end;
        then (sup rng f-inf rng f)*vol(divset(D1,n1+1))
        <=(sup rng f-inf rng f)*delta(D1) by A302,AXIOMS:25;
        hence thesis by A301,AXIOMS:22;

        suppose A306:n1+1 < j;
A307:    n1 < n1+1 by NAT_1:38;
then A308:    D1.n1 < D1.(n1+1) by A207,A227,GOBOARD1:def 1;
        then consider B being closed-interval Subset of REAL,
        MD1,MD2 being Element of divs B such that
A309:    D1.n1=inf B & sup B=MD2.(len MD2) & sup B=MD1.(len MD1) & MD1 <= MD2
        & MD1=mid(D1,n1+1,j) & MD2=mid(D2,indx(D2,D1,n1+1),indx(D2,D1,j))
        by A20,A203,A222,A227,A234,Th14;
A310:    len MD1 = j-'(n1+1)+1 by A222,A225,A226,A309,JORDAN3:27;
A311:    j-'(n1+1) = j-(n1+1) by A222,SCMFSA_7:3;
A312:    len MD1 = j-(n1+1)+1 by A222,A310,SCMFSA_7:3;
A313:     j-'(n1+1)+1=j-n1-1+1 by A311,XCMPLX_1:36 .= j-n1-(1-1) by XCMPLX_1:37
        .=j-n1;
A314:    len MD1+(n1+1)-1 =j-((n1+1)-1)+(n1+1)-1 by A312,XCMPLX_1:37
        .=j-((n1+1)-1)+((n1+1)-1) by XCMPLX_1:29
        .=j-(((n1+1)-1)-((n1+1)-1)) by XCMPLX_1:37
        .=j by XCMPLX_1:17;
A315:   B c= A
        proof
          let x1; assume A316:x1 in B;
          then reconsider x1 as Real;
A317:     rng D1 c= A by INTEGRA1:def 2;
A318:     D1.n1 <= x1 & x1 <= MD1.(len MD1) by A309,A316,INTEGRA2:1;
            D1.n1 in rng D1 & D1.j in rng D1 by A203,A207,FUNCT_1:def 5;
then A319:     inf A <= D1.n1 & D1.j <= sup A by A317,INTEGRA2:1;
            MD1.(len MD1)=D1.(j-n1-1+(n1+1))
            by A222,A223,A225,A226,A309,A310,A313,JORDAN3:31
          .=D1.(j-(n1+1)+(n1+1)) by XCMPLX_1:36
          .=D1.(j-((n1+1)-(n1+1))) by XCMPLX_1:37
          .=D1.j by XCMPLX_1:17;
          then inf A <= x1 & x1 <= sup A by A318,A319,AXIOMS:22;
          hence thesis by INTEGRA2:1;
        end;
        then reconsider g=f|B as Function of B,REAL by FUNCT_2:38;
A320:   g is_bounded_on B
        proof
A321:     f is_bounded_above_on A&f is_bounded_below_on A by A1,RFUNCT_1:def 11
;
         then consider a be real number such that
A322:     for x being Element of A st x in A /\ dom f holds a<=f.x
         by RFUNCT_1:def 10;
           for x being Element of B st x in B /\ dom g holds a<=g.x
         proof
          let x be Element of B; assume x in B /\ dom g;
then A323:      x in dom g by XBOOLE_0:def 3;
then A324:      x in dom f /\ B by FUNCT_1:68;
          reconsider x as Element of A by A315,TARSKI:def 3;
            dom f /\ B c= dom f /\ A by A315,XBOOLE_1:26;
          then a <= f.x by A322,A324;
          hence thesis by A323,FUNCT_1:68;
         end;
then A325:    g is_bounded_below_on B by RFUNCT_1:def 10;
         consider a be real number such that
A326:    for x being Element of A st x in A /\ dom f holds f.x<=a
         by A321,RFUNCT_1:def 9;
           for x being Element of B st x in B /\ dom g holds g.x<=a
         proof
          let x be Element of B; assume x in B /\ dom g;
then A327:     x in dom g by XBOOLE_0:def 3;
then A328:     x in dom f /\ B by FUNCT_1:68;
          reconsider x as Element of A by A315,TARSKI:def 3;
            dom f /\ B c= dom f /\ A by A315,XBOOLE_1:26;
          then a >= f.x by A326,A328;
          hence thesis by A327,FUNCT_1:68;
         end;
         then g is_bounded_above_on B by RFUNCT_1:def 9;
         hence thesis by A325,RFUNCT_1:def 11;
        end;
          rng MD2 <> {};
        then 1 in dom MD2 by FINSEQ_3:34;
then A329:   1 <= len MD2 by FINSEQ_3:27;
A330:   len MD2=indx(D2,D1,j)-'indx(D2,D1,n1+1)+1
        by A230,A231,A232,A309,JORDAN3:27;
A331:   1 <= indx(D2,D1,j)-'indx(D2,D1,n1+1)+1
        by A230,A231,A232,A309,A329,JORDAN3:27;
A332:   len MD2 = indx(D2,D1,j)-indx(D2,D1,n1+1)+1 by A230,A330,SCMFSA_7:3;
        then len MD2-1=indx(D2,D1,j)-indx(D2,D1,n1+1) by XCMPLX_1:26;
then A333:   len MD2-1+indx(D2,D1,n1+1)=indx(D2,D1,j) by XCMPLX_1:27;
A334:   rng MD2 = rng MD1 \/ {D.(i+1)}
        proof
           x1 in rng MD2 implies x1 in (rng MD1 \/ {D.(i+1)})
         proof
          assume A335:x1 in rng MD2;
          then reconsider x1 as Real;
A336:       MD2.1 <= x1 & x1 <= MD2.(len MD2) by A335,Th15;
A337:       MD2.1=D2.(1+indx(D2,D1,n1+1)-1) by A230,A231,A232,A309,A331,JORDAN3
:31
          .=D2.indx(D2,D1,n1+1) by XCMPLX_1:26;
          A338: MD2.(len MD2)=D2.indx(D2,D1,j) by A230,A231,A232,A309,A329,A330
,A333,JORDAN3:31;
A339:     D1.(n1+1) <= x1 & x1 <= D1.j by A20,A227,A229,A230,A231,A232,A309,
A329,A330,A333,A336,A337,INTEGRA1:def 21,JORDAN3:31;
          A340: rng MD2 c= rng D2 by A309,JORDAN3:28;
            now per cases by A20,A335,A340,XBOOLE_0:def 2;
           suppose x1 in rng D1;
           then consider k such that
A341:      k in dom D1 & D1.k = x1 by PARTFUN1:26;
A342:      n1+1 <= k & k <= j by A203,A227,A228,A229,A336,A337,A338,A341,
GOBOARD1:def 1;
then A343:      1 <= k-n1 & k-n1 <= j-n1 by REAL_1:49,84;
A344:      1 <= k-n1 & k-n1 <= len MD1 by A310,A313,A342,REAL_1:49,84;
           A345: j-(n1+1)+1=j-n1-1+1 by XCMPLX_1:36 .=j-n1-(1-1) by XCMPLX_1:37
           .=j-n1;
             n1 <= n1+1 by NAT_1:29;
           then n1 <= k by A342,AXIOMS:22;
           then consider n such that
A346:      k=n1+n by NAT_1:28;
A347:      n = k-n1 by A346,XCMPLX_1:26;
           then n in dom MD1 by A344,FINSEQ_3:27;
then A348:      MD1.n in rng MD1 by FUNCT_1:def 5;
             MD1.n = D1.(k-n1-1+(n1+1))
             by A222,A225,A226,A309,A343,A345,A347,JORDAN3:31
           .= D1.(k-(n1+1)+(n1+1)) by XCMPLX_1:36
           .= D1.(k-((n1+1)-(n1+1))) by XCMPLX_1:37
           .= D1.k by XCMPLX_1:17;
           hence x1 in (rng MD1 \/ {D.(i+1)}) by A341,A348,XBOOLE_0:def 2;
           suppose x1 in rng D;
           then consider n such that
A349:      n in dom D & D.n = x1 by PARTFUN1:26;
A350:      D.i <= sup divset(D1,n1) by A207,INTEGRA2:1;
             sup divset(D1,n1)=D1.n1
           proof
            per cases;
             suppose n1=1;
             hence thesis by A207,INTEGRA1:def 5;
             suppose n1<>1;
             hence thesis by A207,INTEGRA1:def 5;
           end;
           then D.i < D1.(n1+1) by A308,A350,AXIOMS:22;
           then D.i < D.n by A228,A336,A337,A349,AXIOMS:22;
           then i < n by A206,A349,GOBOARD2:18;
           then i+1 <= n by NAT_1:38;
then A351:      i+1 = n or i+1 < n by REAL_1:def 5;
             not i+1 < n
           proof
            assume i+1 < n;
then A352:       D.(i+1) < D.n by A202,A349,GOBOARD1:def 1;
              inf divset(D1,j) <= D.(i+1) by A203,INTEGRA2:1;
then A353:       inf divset(D1,j) <= D.n by A352,AXIOMS:22;
              sup divset(D1,j)=D1.j
            proof
             per cases;
              suppose j=1;
              hence thesis by A203,INTEGRA1:def 5;
              suppose j<>1;
              hence thesis by A203,INTEGRA1:def 5;
            end;
            then D.n in rng D&D.n in divset(D1,j)
            by A339,A349,A353,FUNCT_1:def 5,INTEGRA2:1;
then A354:       x1 in rng D /\ divset(D1,j) by A349,XBOOLE_0:def 3;
A355:       D.(i+1) in rng D by A202,FUNCT_1:def 5;
            consider y1 being Real such that
A356:       y1=D.(i+1);
              y1 in rng D /\ divset(D1,j) by A203,A355,A356,XBOOLE_0:def 3;
            hence contradiction by A19,A203,A349,A352,A354,A356,Th4;
           end;
           then x1 in {D.(i+1)} by A349,A351,TARSKI:def 1;
           hence x1 in (rng MD1 \/ {D.(i+1)}) by XBOOLE_0:def 2;
          end;
          hence thesis;
         end;
then A357:    rng MD2 c= rng MD1 \/ {D.(i+1)} by TARSKI:def 3;
           x1 in rng MD1 \/ {D.(i+1)} implies x1 in rng MD2
         proof
          assume A358:x1 in rng MD1 \/ {D.(i+1)};
          then reconsider x1 as Real;
            now per cases by A358,XBOOLE_0:def 2;
           suppose A359:x1 in rng MD1;
             rng MD1 c= rng D1 by A309,JORDAN3:28;
then A360:      x1 in rng D1 by A359;
A361:      MD1.1 <= x1 & x1 <= MD1.(len MD1) by A359,Th15;
             rng MD1 <> {};
           then 1 in dom MD1 by FINSEQ_3:34;
then A362:      1 <= len MD1 by FINSEQ_3:27;
A363:      len MD1=j-'(n1+1)+1 by A222,A225,A226,A309,JORDAN3:27;
then A364:       MD1.1=D1.(1+(n1+1)-1) by A222,A225,A226,A309,A362,JORDAN3:31
           .=D1.((n1+1)-1+1) by XCMPLX_1:29 .=D1.((n1+1)-(1-1)) by XCMPLX_1:37
           .=D1.(n1+1);
        len MD1+(n1+1)-1=j-(n1+1)+1+(n1+1)-1 by A222,A363,SCMFSA_7:3
           .=j-((n1+1)-1)+(n1+1)-1 by XCMPLX_1:37
           .=j-((n1+1)-1)+((n1+1)-1) by XCMPLX_1:29
           .=j-(((n1+1)-1)-((n1+1)-1)) by XCMPLX_1:37
           .=j by XCMPLX_1:17;
           then A365: MD1.(len MD1)=D1.j
           by A222,A225,A226,A309,A362,A363,JORDAN3:31;
             rng D1 c= rng D2 by A20,INTEGRA1:def 20;
           then consider k such that
A366:       k in dom D2 & D2.k = x1 by A360,PARTFUN1:26;
A367:       indx(D2,D1,n1+1)<=k & k<=indx(D2,D1,j)
           by A228,A229,A361,A364,A365,A366,GOBOARD1:def 1;
           then indx(D2,D1,n1+1)+1<=k+1 by AXIOMS:24;
           then A368: 1 <= k+1-indx(D2,D1,n1+1) by REAL_1:84;
then A369:       1 <= k-indx(D2,D1,n1+1)+1 by XCMPLX_1:29;
             k-indx(D2,D1,n1+1)<=indx(D2,D1,j)-indx(D2,D1,n1+1)
           by A367,REAL_1:49;
then A370:   k-indx(D2,D1,n1+1)+1<=indx(D2,D1,j)-indx(D2,D1,n1+1)+1 by AXIOMS:
24;
             indx(D2,D1,n1+1)<=k+1 by A367,NAT_1:37;
           then consider n such that
A371:      k+1 = indx(D2,D1,n1+1)+n by NAT_1:28;
A372:      n=k+1-indx(D2,D1,n1+1) by A371,XCMPLX_1:26
           .=k-indx(D2,D1,n1+1)+1 by XCMPLX_1:29;
then A373:      1 <= n & n <= len MD2 by A230,A330,A368,A370,SCMFSA_7:3,
XCMPLX_1:29;
             n in dom MD2 by A332,A369,A370,A372,FINSEQ_3:27;
then A374:      MD2.n in rng MD2 by FUNCT_1:def 5;
       n+indx(D2,D1,n1+1)-1=k by A371,XCMPLX_1:26;
           hence x1 in rng MD2 by A230,A231,A232,A309,A330,A366,A373,A374,
JORDAN3:31;
           suppose x1 in {D.(i+1)};
then A375:       x1 = D.(i+1) by TARSKI:def 1;
A376:       D.(i+1) in rng D by A202,FUNCT_1:def 5;
             rng D c= rng D2 by A20,INTEGRA1:def 20;
           then consider k such that
A377:       k in dom D2 & x1 = D2.k by A375,A376,PARTFUN1:26;
             inf divset(D1,j)<=D.(i+1) & D.(i+1)<=sup divset(D1,j)
           by A203,INTEGRA2:1;
then A378:       D1.(j-1) <= x1 & x1 <= D1.j by A203,A210,A224,A375,INTEGRA1:
def 5;
A379:       j-1 in dom D1 & j-1 in NAT by A203,A210,A224,INTEGRA1:9;
           reconsider j1 = j-1 as Nat by A203,A210,A224,INTEGRA1:9;
             n1<j1 by A306,REAL_1:86;
           then n1+1 <= j1 by NAT_1:38;
           then D1.(n1+1) <= D1.(j-1) by A227,A379,GOBOARD2:18;
           then D2.indx(D2,D1,n1+1) <= D2.k & D2.k <= D2.indx(D2,D1,j)
           by A20,A203,A228,A377,A378,AXIOMS:22,INTEGRA1:def 21;
           hence x1 in rng MD2 by A228,A229,A309,A377,Th16;
          end;
          hence thesis;
         end;
         then rng MD1 \/ {D.(i+1)} c= rng MD2 by TARSKI:def 3;
         hence thesis by A357,XBOOLE_0:def 10;
        end;
A380:    len MD1 in dom MD1 by SCMFSA_7:12;
then A381:    1 <= len MD1 by FINSEQ_3:27;
A382:    inf divset(MD1,len MD1)=inf divset(D1,j)
        & sup divset(MD1,len MD1)=sup divset(D1,j)
        proof
         per cases;
          suppose A383:len MD1=1;
then A384:      inf divset(MD1,len MD1)=inf B
          & sup divset(MD1,len MD1)=MD1.(len MD1) by A380,INTEGRA1:def 5;
            inf divset(D1,j)=D1.(j-1)
          & sup divset(D1,j)=D1.j by A203,A210,A224,INTEGRA1:def 5;
          hence thesis by A222,A225,A226,A309,A310,A313,A314,A383,A384,JORDAN3:
31,XCMPLX_1:18;
          suppose A385:len MD1<>1;
then A386:      inf divset(MD1,len MD1)=MD1.(len MD1-1)
          & sup divset(MD1,len MD1)=MD1.(len MD1) by A380,INTEGRA1:def 5;
A387:      len MD1-1+(n1+1)-1=j-(n1+1)+(n1+1)-1 by A310,A313,XCMPLX_1:36
          .=j-((n1+1)-(n1+1))-1 by XCMPLX_1:37
          .=j-1 by XCMPLX_1:17;
A388:      len MD1-1 in dom MD1 & len MD1-1 in NAT
           by A380,A385,INTEGRA1:9;
then A389:      len MD1-1 >= 1 by FINSEQ_3:27;
            len MD1 <= len MD1+1 by NAT_1:29;
          then len MD1 -1 <= len MD1 by REAL_1:86;
then A390:      inf divset(MD1,len MD1) = D1.(j-1)
            by A222,A225,A226,A309,A310,A386,A387,A388,A389,JORDAN3:31;
            sup divset(MD1,len MD1)=D1.j
          by A222,A225,A226,A309,A310,A314,A381,A386,JORDAN3:31;
          hence thesis by A203,A210,A224,A390,INTEGRA1:def 5;
        end;
          inf divset(D1,j)<=D.(i+1) & D.(i+1)<=sup divset(D1,j)
        by A203,INTEGRA2:1;
then A391:    D.(i+1) in divset(MD1,len MD1) by A382,INTEGRA2:1;
A392:   Sum upper_volume(g,MD1)-Sum upper_volume(g,MD2)<=
        (sup rng g-inf rng g)*delta(MD1)
        proof
A393:     vol(B)=sup B-D1.n1 by A309,INTEGRA1:def 6;
A394:     len MD1 in dom MD1 by SCMFSA_7:12;
            vol(B)<>0 & D.(i+1) > inf B
          proof
             sup divset(MD1,len MD1)=MD1.(len MD1)
           proof
            per cases;
             suppose len MD1 = 1;
             hence thesis by A394,INTEGRA1:def 5;
             suppose len MD1 <> 1;
             hence thesis by A394,INTEGRA1:def 5;
           end;
then A395:      vol(B)=D1.j-D1.n1 by A203,A210,A224,A309,A382,A393,INTEGRA1:def
5;
             D1.j>D1.n1 by A203,A207,A210,GOBOARD1:def 1;
           hence vol(B)<>0 by A395,SQUARE_1:11;
             inf divset(D1,j) <= D.(i+1) by A203,INTEGRA2:1;
then A396:      D1.(j-1) <= D.(i+1) by A203,A210,A224,INTEGRA1:def 5;
A397:      n1 < j-1 by A306,REAL_1:86;
             j-1 in dom D1 by A203,A210,A224,INTEGRA1:9;
           then D1.n1 <D1.(j-1) by A207,A397,GOBOARD1:def 1;
           hence thesis by A309,A396,AXIOMS:22;
          end;
          hence thesis by A309,A320,A334,A391,Th13;
        end;
          dom g = B by FUNCT_2:def 1;
then A398:   rng g <> {} by RELAT_1:65;
A399:   rng g c= rng f by FUNCT_1:76;
          f is_bounded_above_on A & f is_bounded_below_on A
        by A1,RFUNCT_1:def 11;
        then rng f is bounded_above & rng f is bounded_below
        by INTEGRA1:13,15;
        then sup rng f >= sup rng g & inf rng f <= inf rng g
        by A398,A399,PSCOMP_1:12,13;
then A400:    sup rng f-inf rng f>=sup rng g - inf rng g by REAL_1:92;
          delta(MD1) >= 0 by Th8;
        then (sup rng f-inf rng f)*delta(MD1)>=(sup rng g-inf rng g)*delta(MD1
)
        by A400,AXIOMS:25;
then A401:   Sum upper_volume(g,MD1)-Sum upper_volume(g,MD2)<=
          (sup rng f-inf rng f)*delta(MD1) by A392,AXIOMS:22;
          delta(MD1)=max rng upper_volume(chi(B,B),MD1) by INTEGRA1:def 19;
        then delta(MD1) in rng upper_volume(chi(B,B),MD1) by PRE_CIRC:def 1;
        then consider k such that
A402:   k in dom upper_volume(chi(B,B),MD1)
        & upper_volume(chi(B,B),MD1).k = delta(MD1) by PARTFUN1:26;
          k in Seg len upper_volume(chi(B,B),MD1) by A402,FINSEQ_1:def 3;
then A403:    k in Seg len MD1 by INTEGRA1:def 7;
then A404:    delta(MD1) = vol(divset(MD1,k)) by A402,INTEGRA1:22;
          n1+1>1 by A224,NAT_1:38;
        then n1>1-1 by REAL_1:84;
then A405:   1 <= k & k <= len MD1 & k < k+n1 by A403,FINSEQ_1:3,REAL_1:69;
then A406:   1 < k+n1 by AXIOMS:22;
A407:   k in dom MD1 by A403,FINSEQ_1:def 3;
          k+n1 <= j by A310,A313,A405,REAL_1:84;
        then k+n1 <= len D1 by A225,AXIOMS:22;
then A408:   k+n1 in dom D1 by A406,FINSEQ_3:27;
        A409: divset(MD1,k)=divset(D1,k+n1)
        proof
      inf divset(MD1,k)=inf divset(D1,k+n1)
         & sup divset(MD1,k)=sup divset(D1,k+n1)
         proof
          per cases;
           suppose A410:k=1;
           then inf divset(MD1,k)=inf B & sup divset(MD1,k)=MD1.k
           by A407,INTEGRA1:def 5;
then A411:       inf divset(MD1,k)=D1.n1 & sup divset(MD1,k)=D1.(k+(n1+1)-1)
           by A222,A225,A226,A309,A310,A405,JORDAN3:31;
             inf divset(D1,k+n1)=D1.(k+n1-1) & sup divset(D1,k+n1)=D1.(k+n1)
           by A405,A408,INTEGRA1:def 5;
           hence thesis by A410,A411,XCMPLX_1:26;
           suppose A412:k<>1;
then A413:      k-1 in dom MD1 & k-1 in NAT by A407,INTEGRA1:9;
then A414:      1 <= k-1 & k-1 <= len MD1 by FINSEQ_3:27;
             inf divset(MD1,k)=MD1.(k-1) & sup divset(MD1,k)=MD1.k
                    by A407,A412,INTEGRA1:def 5;
           then inf divset(MD1,k)=D1.(k-1+(n1+1)-1)
             & sup divset(MD1,k)=D1.(k+(n1+1)-1)
           by A222,A225,A226,A309,A310,A405,A413,A414,JORDAN3:31;
           then inf divset(MD1,k)=D1.(k-1+n1+1-1)
           & sup divset(MD1,k)=D1.(k+n1+1-1) by XCMPLX_1:1;
then A415:      inf divset(MD1,k)=D1.(k-1+n1) & sup divset(MD1,k)=D1.(k+n1)
           by XCMPLX_1:26;
             inf divset(D1,k+n1)=D1.(k+n1-1) & sup divset(D1,k+n1)=D1.(k+n1)
           by A405,A408,INTEGRA1:def 5;
           hence thesis by A415,XCMPLX_1:29;
         end;
         then divset(MD1,k)=[.inf divset(D1,k+n1),sup divset(D1,k+n1).]
           by INTEGRA1:5;
         hence thesis by INTEGRA1:5;
        end;
A416:   k+n1 in Seg len D1 by A408,FINSEQ_1:def 3;
then A417:   delta(MD1)=upper_volume(chi(A,A),D1).(k+n1) by A404,A409,INTEGRA1:
22;
          k+n1 in Seg len upper_volume(chi(A,A),D1) by A416,INTEGRA1:def 7;
        then k+n1 in dom upper_volume(chi(A,A),D1) by FINSEQ_1:def 3;
        then delta(MD1) in rng upper_volume(chi(A,A),D1) by A417,FUNCT_1:def 5
;
        then delta(MD1) <= max rng upper_volume(chi(A,A),D1) by PRE_CIRC:def 1
;
then A418:   delta(MD1) <= delta(D1) by INTEGRA1:def 19;
          inf rng f <= sup rng f by A1,Lm6;
        then sup rng f - inf rng f >= 0 by SQUARE_1:12;
        then A419: (sup rng f-inf rng f)*delta(MD1) <= (sup rng f-inf rng f)*
delta(D1)
        by A418,AXIOMS:25;
A420:   indx(D2,D1,n1) < indx(D2,D1,n1)+1 by NAT_1:38;
A421:   1 <= indx(D2,D1,n1)+1 by A209,NAT_1:38;
          D1.n1 < D1.(n1+1) by A207,A227,A307,GOBOARD1:def 1;
        then indx(D2,D1,n1) < indx(D2,D1,n1+1) by A208,A228,GOBOARD2:18;
then A422:   indx(D2,D1,n1)+1 <= indx(D2,D1,n1+1) by NAT_1:38;
then A423:   indx(D2,D1,n1)+1 <= len D2 by A231,AXIOMS:22;
then A424:   indx(D2,D1,n1)+1 <= len UVf(D2) by INTEGRA1:def 7;
A425:   indx(D2,D1,n1+1)=indx(D2,D1,n1)+1
        proof
         assume indx(D2,D1,n1+1)<> indx(D2,D1,n1)+1;
then A426:    indx(D2,D1,n1+1)>indx(D2,D1,n1)+1 by A422,REAL_1:def 5;
A427:    indx(D2,D1,n1)+1 in dom D2 by A421,A423,FINSEQ_3:27;
         then A428: D2.(indx(D2,D1,n1)+1) in rng D2 by FUNCT_1:def 5;
           now per cases by A20,A428,XBOOLE_0:def 2;
          suppose D2.(indx(D2,D1,n1)+1) in rng D1;
          then consider n2 being Nat such that
A429:     n2 in dom D1 & D2.(indx(D2,D1,n1)+1) = D1.n2 by PARTFUN1:26;
            D2.indx(D2,D1,n1) < D2.(indx(D2,D1,n1)+1)
          by A208,A420,A427,GOBOARD1:def 1;
          then n1 < n2 by A207,A208,A429,GOBOARD2:18;
then A430:     n1+1 <= n2 by NAT_1:38;
            D1.n2 < D1.(n1+1) by A228,A426,A427,A429,GOBOARD1:def 1;
          hence contradiction by A227,A429,A430,GOBOARD2:18;
          suppose D2.(indx(D2,D1,n1)+1) in rng D;
          then consider n2 being Nat such that
A431:     n2 in dom D & D2.(indx(D2,D1,n1)+1) = D.n2 by PARTFUN1:26;
A432:     D1.n1 < D.n2 by A208,A420,A427,A431,GOBOARD1:def 1;
A433:     D.i <= sup divset(D1,n1) by A207,INTEGRA2:1;
            sup divset(D1,n1)=D1.n1
          proof
           per cases;
            suppose n1=1;
            hence thesis by A207,INTEGRA1:def 5;
            suppose n1<>1;
            hence thesis by A207,INTEGRA1:def 5;
          end;
          then D.i < D.n2 by A432,A433,AXIOMS:22;
          then i < n2 by A206,A431,GOBOARD2:18;
then A434:     i+1 <= n2 by NAT_1:38;
A435:     D.n2 < D1.(n1+1) by A228,A426,A427,A431,GOBOARD1:def 1;
A436:     j-1 in dom D1 & j-1 in NAT by A203,A210,A224,INTEGRA1:9;
            n1+1 +1 <= j by A306,NAT_1:38;
          then n1+1 <= j-1 by REAL_1:84;
then A437:     D1.(n1+1) <= D1.(j-1) by A227,A436,GOBOARD2:18;
A438:     inf divset(D1,j) <= D.(i+1) by A203,INTEGRA2:1;
            inf divset(D1,j) = D1.(j-1) by A203,A210,A224,INTEGRA1:def 5;
          then D1.(n1+1) <= D.(i+1) by A437,A438,AXIOMS:22;
          then D.n2 < D.(i+1) by A435,AXIOMS:22;
          hence contradiction by A202,A431,A434,GOBOARD2:18;
         end;
         hence contradiction;
        end;
A439: Sum upper_volume(g,MD2)=Sum mid(UVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j))
        proof
           upper_volume(g,MD2)=mid(UVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j))
         proof
A440:      len upper_volume(g,MD2)=indx(D2,D1,j)-(indx(D2,D1,n1)+1)+1
             by A332,A425,INTEGRA1:def 7;
A441:      indx(D2,D1,j) <= len UVf(D2) by A232,INTEGRA1:def 7;
A442:      indx(D2,D1,n1)+1 <= indx(D2,D1,j) by A230,A422,AXIOMS:22;
then len mid(UVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j))
          = indx(D2,D1,j)-'(indx(D2,D1,n1)+1)+1
          by A232,A421,A424,A441,JORDAN3:27;
then A443:      len upper_volume(g,MD2)
          =len mid(UVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j))
          by A440,A442,SCMFSA_7:3;
            for k st 1<=k & k<=len upper_volume(g,MD2) holds
          upper_volume(g,MD2).k=mid(UVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j)).k
          proof
           let k; assume A444:1 <= k & k <= len upper_volume(g,MD2);
           then k in Seg len upper_volume(g,MD2) by FINSEQ_1:3;
then A445:       k in Seg len MD2 by INTEGRA1:def 7;
then A446:       upper_volume(g,MD2).k
           =(sup rng(g|divset(MD2,k)))*vol(divset(MD2,k)) by INTEGRA1:def 7;
A447:      divset(MD2,k)=[.inf divset(MD2,k),sup divset(MD2,k).] by INTEGRA1:5;
A448:       mid(UVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j)).k
           =UVf(D2).(k+(indx(D2,D1,n1)+1)-1)
           by A421,A440,A441,A442,A444,JORDAN3:31;
             k <= indx(D2,D1,j)-((indx(D2,D1,n1)+1)-1) by A440,A444,XCMPLX_1:37
;
           then k+((indx(D2,D1,n1)+1)-1) <= indx(D2,D1,j) by REAL_1:84;
           then k+(indx(D2,D1,n1)+1)-1 <= indx(D2,D1,j) by XCMPLX_1:29;
then A449:       k+(indx(D2,D1,n1)+1)-1 <= len UVf(D2) by A441,AXIOMS:22;
             1<=indx(D2,D1,n1)+1 by NAT_1:37;
           then 1+1<=k+(indx(D2,D1,n1)+1) by A444,REAL_1:55;
then A450:       1 <= k+(indx(D2,D1,n1)+1)-1 by REAL_1:84;
           consider k2 being Nat such that
A451:       indx(D2,D1,n1)+1=1+k2;
A452:       k2=(indx(D2,D1,n1)+1)-1 by A451,XCMPLX_1:26;
then A453:       k+k2=k+(indx(D2,D1,n1)+1)-1 by XCMPLX_1:29;
           then k+k2 in Seg len UVf(D2) by A449,A450,FINSEQ_1:3;
then A454:       k+k2 in Seg len D2 by INTEGRA1:def 7;
then A455:       mid(UVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j)).k
           =(sup rng(f|divset(D2,k+k2)))*vol(divset(D2,k+k2))
           by A448,A453,INTEGRA1:def 7;
             inf divset(MD2,k)=inf divset(D2,k+k2)
           & sup divset(MD2,k)=sup divset(D2,k+k2)
           proof
              k2=indx(D2,D1,n1) by A452,XCMPLX_1:26;
            then k+k2>=1+1 by A209,A444,REAL_1:55;
then A456:        k+k2>1 by NAT_1:38;
A457:        k in dom MD2 by A445,FINSEQ_1:def 3;
A458:        k+k2 in dom D2 by A454,FINSEQ_1:def 3;
              now per cases;
             suppose A459:k=1;
then A460:        inf divset(MD2,k)=inf B & sup divset(MD2,k)=MD2.k
             by A457,INTEGRA1:def 5;
then A461:         sup divset(MD2,k)=D2.(1+indx(D2,D1,n1+1)-1)
             by A230,A232,A309,A421,A425,A440,A444,A459,JORDAN3:31
             .=D2.(indx(D2,D1,n1+1)-1+1) by XCMPLX_1:29
             .=D2.(indx(D2,D1,n1+1)-(1-1)) by XCMPLX_1:37
             .=D1.(n1+1) by A20,A227,INTEGRA1:def 21;
               inf divset(D2,k+k2)=D2.(1+k2-1) & sup divset(D2,k+k2)=D2.(1+k2)
             by A456,A458,A459,INTEGRA1:def 5;
             hence inf divset(MD2,k)=inf divset(D2,k+k2)
             & sup divset(MD2,k)=sup divset(D2,k+k2)
             by A20,A208,A227,A309,A425,A451,A460,A461,INTEGRA1:def 21,XCMPLX_1
:26;
             suppose A462:k<>1;
then A463:        k-1 in dom MD2 & k-1 in NAT by A457,INTEGRA1:9;
then A464:        1 <= k-1 by FINSEQ_3:27;
               k-1 <= k by Lm1;
then A465:        k-1 <= indx(D2,D1,j)-(indx(D2,D1,n1)+1)+1 by A440,A444,AXIOMS
:22;
               inf divset(MD2,k)=MD2.(k-1) & sup divset(MD2,k)=MD2.k
             by A457,A462,INTEGRA1:def 5;
then A466:         inf divset(MD2,k)=D2.(k-1+(indx(D2,D1,n1)+1)-1)
             & sup divset(MD2,k)=D2.(k+(indx(D2,D1,n1)+1)-1)
             by A230,A232,A309,A421,A425,A440,A444,A463,A464,A465,JORDAN3:31;
               inf divset(D2,k+k2)=D2.(k+k2-1) &sup divset(D2,k+k2)=D2.(k+k2)
             by A456,A458,INTEGRA1:def 5;
             then inf divset(D2,k+k2)=D2.(k-1+k2)
             & sup divset(D2,k+k2)=D2.(k+((indx(D2,D1,n1)+1)-1))
             by A451,XCMPLX_1:26,29;
             hence inf divset(MD2,k)=inf divset(D2,k+k2)
             & sup divset(MD2,k)=sup divset(D2,k+k2) by A452,A466,XCMPLX_1:29;
            end;
            hence thesis;
           end;
then A467:       divset(MD2,k)=divset(D2,k+k2) by A447,INTEGRA1:5;
             k in dom MD2 by A445,FINSEQ_1:def 3;
           then divset(D2,k+k2) c= B by A467,INTEGRA1:10;
           hence thesis by A446,A455,A467,FUNCT_1:82;
          end;
          hence thesis by A443,FINSEQ_1:18;
         end;
         hence thesis;
        end;
          Sum upper_volume(g,MD1)=Sum mid(UVf(D1),n1+1,j)
        proof
           upper_volume(g,MD1)=mid(UVf(D1),n1+1,j)
         proof
A468:      j-'(n1+1)+1=j-(n1+1)+1 by A222,SCMFSA_7:3;
A469:      len upper_volume(g,MD1)=len MD1 by INTEGRA1:def 7
          .=j-(n1+1)+1 by A222,A225,A226,A309,A468,JORDAN3:27;
A470:      n1+1 <= len UVf(D1) by A226,INTEGRA1:def 7;
A471:      j <= len UVf(D1) by A225,INTEGRA1:def 7;
then A472:      len upper_volume(g,MD1)=len mid(UVf(D1),n1+1,j)
             by A222,A225,A226,A468,A469,A470,JORDAN3:27;
            for k st 1<=k & k<=len upper_volume(g,MD1) holds
          upper_volume(g,MD1).k=mid(UVf(D1),n1+1,j).k
          proof
           let k; assume A473:1 <= k & k <= len upper_volume(g,MD1);
           then k in Seg len upper_volume(g,MD1) by FINSEQ_1:3;
then A474:      k in Seg len MD1 by INTEGRA1:def 7;
then A475:      upper_volume(g,MD1).k
           =(sup rng(g|divset(MD1,k)))*vol(divset(MD1,k)) by INTEGRA1:def 7;
             k <= j-((n1+1)-1) by A469,A473,XCMPLX_1:37;
then A476:      k+((n1+1)-1) <= j by REAL_1:84;
           consider k2 being Nat such that
A477:       n1+1=1+k2;
A478:      k2=(n1+1)-1 by A477,XCMPLX_1:26;
A479:      1 <= k+k2 by A473,NAT_1:37;
             k+k2 <= len D1 by A225,A476,A478,AXIOMS:22;
then A480:      k+k2 in Seg len D1 by A479,FINSEQ_1:3;
A481:      mid(UVf(D1),n1+1,j).k
           =UVf(D1).(k+(n1+1)-1) by A222,A226,A469,A471,A473,JORDAN3:31
           .=UVf(D1).(k+((n1+1)-1)) by XCMPLX_1:29
           .=(sup rng(f|divset(D1,k+k2)))*vol(divset(D1,k+k2))
           by A478,A480,INTEGRA1:def 7;
A482:      divset(D1,k+k2)=divset(MD1,k)
           proof
A483:       k2=n1 by A478,XCMPLX_1:26;
            then 1+1 <= k+k2 by A225,A473,REAL_1:55;
then A484:       1 < k+k2 by NAT_1:38;
A485:       divset(MD1,k)=[.inf divset(MD1,k),sup divset(MD1,k).]
            by INTEGRA1:5;
A486:       k in dom MD1 by A474,FINSEQ_1:def 3;
              k+k2 in dom D1 by A480,FINSEQ_1:def 3;
then A487:       inf divset(D1,k+k2)=D1.(k+k2-1)
            & sup divset(D1,k+k2)=D1.(k+k2) by A484,INTEGRA1:def 5;
              inf divset(D1,k+k2)=inf divset(MD1,k)
            & sup divset(D1,k+k2)=sup divset(MD1,k)
            proof
             per cases;
              suppose A488:k=1;
              then inf divset(MD1,k)=inf B & sup divset(MD1,k)=MD1.k
              by A486,INTEGRA1:def 5;
              then inf divset(MD1,k)=D1.n1 & sup divset(MD1,k)=D1.(k+(n1+1)-1)
              by A222,A225,A226,A309,A469,A473,JORDAN3:31;
              hence thesis by A483,A487,A488,XCMPLX_1:26;
              suppose A489:k<>1;
then A490:         k-1 in dom MD1 & k-1 in NAT by A486,INTEGRA1:9;
then A491:         1 <= k-1 by FINSEQ_3:27;
                k-1 <= k by Lm1;
then A492:         k-1 <= j-(n1+1)+1 by A469,A473,AXIOMS:22;
                inf divset(MD1,k)=MD1.(k-1) & sup divset(MD1,k)=MD1.k
              by A486,A489,INTEGRA1:def 5;
              then inf divset(MD1,k)=D1.(k-1+(n1+1)-1)
              & sup divset(MD1,k)=D1.(k+(n1+1)-1)
              by A222,A225,A226,A309,A469,A473,A490,A491,A492,JORDAN3:31;
              then inf divset(MD1,k)=D1.(k-1+((n1+1)-1))
              & sup divset(MD1,k)=D1.(k+((n1+1)-1)) by XCMPLX_1:29;
              hence thesis by A478,A487,XCMPLX_1:29;
            end;
            hence thesis by A485,INTEGRA1:5;
           end;
             k in dom MD1 by A474,FINSEQ_1:def 3;
           then divset(D1,k+k2) c= B by A482,INTEGRA1:10;
           hence thesis by A475,A481,A482,FUNCT_1:82;
          end;
          hence thesis by A472,FINSEQ_1:18;
         end;
         hence thesis;
        end;
        hence thesis by A401,A419,A439,AXIOMS:22;
       end;

A493:  PUf(D2,indx(D2,D1,j))=
        PUf(D2,indx(D2,D1,n1))+Sum mid(UVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j))
        proof
A494:    indx(D2,D1,n1)<indx(D2,D1,j) by A230,A233,AXIOMS:22;
           indx(D2,D1,j) in Seg len D2 by A229,FINSEQ_1:def 3;
then A495:    indx(D2,D1,j) in Seg len UVf(D2) by INTEGRA1:def 7;
A496:    indx(D2,D1,j) <= len UVf(D2) by A232,INTEGRA1:def 7;
           indx(D2,D1,n1) in Seg len D2 by A208,FINSEQ_1:def 3;
         then indx(D2,D1,n1) in Seg len UVf(D2) by INTEGRA1:def 7;
         then PUf(D2,indx(D2,D1,n1))=Sum(UVf(D2)|indx(D2,D1,n1)) by INTEGRA1:
def 22
         .=Sum mid(UVf(D2),1,indx(D2,D1,n1)) by A209,JORDAN3:25;
         then PUf(D2,indx(D2,D1,n1))+Sum mid(UVf(D2),indx(D2,D1,n1)+1,indx(D2,
D1,j))
         =Sum(mid(UVf(D2),1,indx(D2,D1,n1))^
            mid(UVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j))) by RVSUM_1:105
         .=Sum mid(UVf(D2),1,indx(D2,D1,j)) by A209,A494,A496,INTEGRA2:4
         .=Sum(UVf(D2)|indx(D2,D1,j)) by A232,JORDAN3:25;
         hence thesis by A495,INTEGRA1:def 22;
        end;
A497:    j <= len UVf(D1) by A225,INTEGRA1:def 7;
then A498:    j in Seg len UVf(D1) by A225,FINSEQ_1:3;
           n1 in Seg len D1 by A207,FINSEQ_1:def 3;
         then n1 in Seg len UVf(D1) by INTEGRA1:def 7;
         then PUf(D1,n1)=Sum(UVf(D1)|n1) by INTEGRA1:def 22
         .=Sum mid(UVf(D1),1,n1) by A225,JORDAN3:25;
         then PUf(D1,n1)+Sum mid(UVf(D1),n1+1,j)
          =Sum(mid(UVf(D1),1,n1)^mid(UVf(D1),n1+1,j)) by RVSUM_1:105
         .=Sum mid(UVf(D1),1,j) by A210,A225,A497,INTEGRA2:4
         .=Sum(UVf(D1)|j) by A225,JORDAN3:25;
then A499:    PUf(D1,j)=PUf(D1,n1)+Sum mid(UVf(D1),n1+1,j) by A498,INTEGRA1:def
22;
A500:    i*(sup rng f-inf rng f)*delta(D1)+(sup rng f-inf rng f)*delta(D1)
        =i*((sup rng f-inf rng f)*delta(D1))+1*
         ((sup rng f-inf rng f)*delta(D1)) by XCMPLX_1:4
        .=(i+1)*((sup rng f-inf rng f)*delta(D1)) by XCMPLX_1:8
        .=(i+1)*(sup rng f-inf rng f)*delta(D1) by XCMPLX_1:4;
A501:    (PUf(D1,n1)-PUf(D2,indx(D2,D1,n1)))+
   (Sum mid(UVf(D1),n1+1,j)-Sum mid(UVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j)))
        <=i*(sup rng f-inf rng f)*delta(D1)+(sup rng f-inf rng f)*delta(D1)
        by A207,A235,REAL_1:55;
          (PUf(D1,n1)-PUf(D2,indx(D2,D1,n1)))+
   (Sum mid(UVf(D1),n1+1,j)-Sum mid(UVf(D2),indx(D2,D1,n1)+1,indx(D2,D1,j)))
         =PUf(D1,j)-PUf(D2,indx(D2,D1,j)) by A493,A499,Lm5;
        hence thesis by A203,A500,A501;
       end;
       hence thesis;
      end;
A502: for k being non empty Nat holds P[k] from Ind_from_1(A43,A199);
        i in Seg len D by A22,FINSEQ_1:def 3;
      then reconsider i as non empty Nat by BINARITH:5;
        P[i] by A502;
      hence thesis by A22;
     end;
       len D in dom D by SCMFSA_7:12;
     then consider j such that
A503:  j in dom D1 & D.(len D) in divset(D1,j) &
       PUf(D1,j)-PUf(D2,indx(D2,D1,j))
     <= (len D)*(sup(rng f)-inf(rng f))*delta(D1) by A21;
A504:len D1 in dom D1 by SCMFSA_7:12;
A505:j = len D1
     proof
      assume A506:j<>len D1;
      A507: D.(len D) <= sup divset(D1,j) by A503,INTEGRA2:1;
        j in Seg len D1 by A503,FINSEQ_1:def 3;
      then j <= len D1 by FINSEQ_1:3;
      then j < len D1 by A506,REAL_1:def 5;
      then D1.j < D1.(len D1) by A503,A504,GOBOARD1:def 1;
then A508: D1.j < sup A by INTEGRA1:def 2;
        sup divset(D1,j) < sup A
      proof
       per cases;
       suppose j=1;
       hence thesis by A503,A508,INTEGRA1:def 5;
       suppose j<>1;
       hence thesis by A503,A508,INTEGRA1:def 5;
      end;
      hence contradiction by A507,INTEGRA1:def 2;
     end;
A509: len D2 in dom D2 by SCMFSA_7:12;
  indx(D2,D1,len D1)=len D2
     proof
A510: indx(D2,D1,len D1) in dom D2 &
      D1.(len D1) = D2.indx(D2,D1,len D1) by A20,A504,INTEGRA1:def 21;
      then sup A = D2.indx(D2,D1,len D1) by INTEGRA1:def 2;
      then D2.(len D2) = D2.indx(D2,D1,len D1) by INTEGRA1:def 2;
      hence thesis by A509,A510,GOBOARD2:19;
     end;
     then upper_sum(f,D1)-PUf(D2,len D2)<=(len D)*(sup(rng f)-inf(rng f))*
delta(D1)
     by A503,A505,INTEGRA1:44;
     hence thesis by INTEGRA1:44;
    end;
    hence thesis by A20;
   end;
   hence thesis;
  end;

A511:for e be real number st e>0 ex n st for m st n<=m holds
   abs((upper_sum(f,T)).m-upper_integral(f))<e
   proof
     let e be real number;
     assume A512:e>0;
then A513: e/2>0 by REAL_2:127;
     reconsider e as Real by XREAL_0:def 1;
A514: upper_integral(f) = inf rng upper_sum_set(f) by INTEGRA1:def 15;
A515: rng upper_sum_set(f) is bounded_below by A1,INTEGRA2:35;
       dom upper_sum_set(f) is non empty by INTEGRA1:def 11;
     then rng upper_sum_set(f) is non empty by RELAT_1:65;
     then consider y be real number such that
A516: y in rng upper_sum_set(f) & upper_integral(f)+e/2>y
      by A513,A514,A515,SEQ_4:def 5;
       ex D being Element of divs A st D in dom upper_sum_set(f) &
     y=(upper_sum_set(f)).D & D.1 > inf A
     proof
      consider D3 being Element of divs A such that
A517:   D3 in dom upper_sum_set(f) & y=(upper_sum_set(f)).D3 by A516,PARTFUN1:
26;
        len D3 <> 0 by FINSEQ_1:25;
then A518: len D3 in Seg len D3 by FINSEQ_1:5;
      then 1 <= len D3 by FINSEQ_1:3;
then A519: 1 in Seg len D3 by FINSEQ_1:3;
then A520: 1 in dom D3 by FINSEQ_1:def 3;
        now per cases;
       suppose A521:D3.1 <> inf A;
         D3.1 in A by A520,INTEGRA1:8;
       then inf A <= D3.1 by INTEGRA2:1;
       then D3.1 > inf A by A521,REAL_1:def 5;
       hence ex D being Element of divs A st D in dom upper_sum_set(f) &
       y=(upper_sum_set(f)).D & D.1 > inf A by A517;
       suppose A522:D3.1 = inf A;
         ex D being Element of divs A st D in dom upper_sum_set(f) &
       y=(upper_sum_set(f)).D & D.1 > inf A
       proof
A523:   D3.(len D3) = sup A by INTEGRA1:def 2;
A524:   len D3 in dom D3 by A518,FINSEQ_1:def 3;
          vol(A) >= 0 by INTEGRA1:11;
        then sup A - inf A > 0 by A3,INTEGRA1:def 6;
        then sup A > inf A by REAL_2:106;
then A525:   len D3 > 1 by A520,A522,A523,A524,GOBOARD2:18;
        then reconsider D=D3/^1 as increasing FinSequence of REAL
         by INTEGRA1:36;
A526:   len D = len D3 - 1 & for m be Nat st m in dom D holds D.m = D3.(m+1)
        by A525,RFINSEQ:def 2;
then A527:   len D <> 0 by A525,SQUARE_1:11;
        then reconsider D as non empty increasing FinSequence of REAL
        by FINSEQ_1:25;
          rng D c= rng D3 & rng D3 c= A by FINSEQ_5:36,INTEGRA1:def 2;
then A528:   rng D c= A by XBOOLE_1:1;
A529:   len D+1=len D3 by A526,XCMPLX_1:27;
A530:   len D in Seg len D by A527,FINSEQ_1:5;
          len D in dom D by SCMFSA_7:12;
        then D.(len D)=sup A by A523,A525,A529,RFINSEQ:def 2;
        then D is DivisionPoint of A by A528,INTEGRA1:def 2;
        then reconsider D as Element of divs A by INTEGRA1:def 4;
          D in divs A;
then A531:   D in dom upper_sum_set(f) by INTEGRA1:def 11;
A532:   y=(upper_sum_set(f)).D
        proof
A533:    y=upper_sum(f,D3) by A517,INTEGRA1:def 11
         .=Sum(upper_volume(f,D3)) by INTEGRA1:def 9
         .=Sum((upper_volume(f,D3)|1)^(upper_volume(f,D3)/^1)) by RFINSEQ:21;
A534:    1 <= len upper_volume(f,D3) by A525,INTEGRA1:def 7;
then A535:    len (upper_volume(f,D3)|1)=1 by TOPREAL1:3;
A536:    1 in dom upper_volume(f,D3) by A534,FINSEQ_3:27;
           1 in Seg 1 by FINSEQ_1:3;
         then (upper_volume(f,D3)|1).1 = upper_volume(f,D3).1 by A536,RFINSEQ:
19;
         then A537:    upper_volume(f,D3)|1 = <*upper_volume(f,D3).1*> by A535,
FINSEQ_1:57;
A538:    vol(divset(D3,1))=sup divset(D3,1)-inf divset(D3,1) by INTEGRA1:def 6
          .=sup divset(D3,1) - inf A by A520,INTEGRA1:def 5
          .=D3.1 - inf A by A520,INTEGRA1:def 5
          .=0 by A522,XCMPLX_1:14;
         A539: upper_volume(f,D3).1=(sup rng(f|divset(D3,1)))*vol(divset(D3,1))
           by A519,INTEGRA1:def 7;
           upper_volume(f,D3)/^1 = upper_volume(f,D)
         proof
A540:      2-'1=2-1 by SCMFSA_7:3 .= 1;
A541:      len D3 >= 1+1 by A525,NAT_1:38;
          then len upper_volume(f,D3) >= 2 by INTEGRA1:def 7;
then A542:      mid(upper_volume(f,D3),2,len upper_volume(f,D3))
           =upper_volume(f,D3)/^1 by A540,JORDAN3:26;
A543:      2 <= len upper_volume(f,D3) & 1 <= len upper_volume(f,D3)
          by A525,A541,INTEGRA1:def 7;
          then A544: len(mid(upper_volume(f,D3),2,len upper_volume(f,D3)))
           =len upper_volume(f,D3)-'2+1 by JORDAN3:27
           .=len D3-'2+1 by INTEGRA1:def 7
           .=len D3-2+1 by A541,SCMFSA_7:3
           .=len D3-(2-1) by XCMPLX_1:37
           .=len D3-1;
then A545:      len(mid(upper_volume(f,D3),2,len upper_volume(f,D3)))
          =len upper_volume(f,D) by A526,INTEGRA1:def 7;
            for i st 1<=i&i<=len mid(upper_volume(f,D3),2,len upper_volume(f,D3
)
)
          holds mid(upper_volume(f,D3),2,len upper_volume(f,D3)).i
          =upper_volume(f,D).i
          proof
           let i; assume
A546:      1<=i&i<=len mid(upper_volume(f,D3),2,len upper_volume(f,D3));
           then i <= len upper_volume(f,D3) - 1
           by A544,INTEGRA1:def 7;
           then i <= len upper_volume(f,D3)-2+1 by Lm2,XCMPLX_1:37;
then A547:      mid(upper_volume(f,D3),2,len upper_volume(f,D3)).i
           =upper_volume(f,D3).(i+2-1) by A543,A546,JORDAN3:31
           .=upper_volume(f,D3).(i+(2-1)) by XCMPLX_1:29
           .=upper_volume(f,D3).(i+1);
             1 <= i+1 & i+1 <= len D3 by A544,A546,NAT_1:37,REAL_1:84;
then A548:      i+1 in Seg len D3 by FINSEQ_1:3;
then A549:      mid(upper_volume(f,D3),2,len upper_volume(f,D3)).i
           =(sup rng(f|divset(D3,i+1)))*vol(divset(D3,i+1))
           by A547,INTEGRA1:def 7;
           A550: divset(D3,i+1)=divset(D,i)
           proof
A551:       1<>i+1 by A546,NAT_1:38;
              i+1 in dom D3 by A548,FINSEQ_1:def 3;
            then A552: sup divset(D3,i+1)=D3.(i+1) & inf divset(D3,i+1)=D3.(i+1
-1)
            by A551,INTEGRA1:def 5;
then A553:       sup divset(D3,i+1)=D3.(i+1) & inf divset(D3,i+1)=D3.i by
XCMPLX_1:26;
A554:       i in dom D by A526,A544,A546,FINSEQ_3:27;
then A555:       D.i=D3.(i+1) by A525,RFINSEQ:def 2;
              now per cases;
             suppose A556:i=1;
then A557:        inf divset(D,i)=inf A & sup divset(D,i)=D.i
             by A554,INTEGRA1:def 5;
               divset(D3,i+1)=[.inf A, D.i.] by A522,A552,A555,A556,INTEGRA1:5;
             hence divset(D3,i+1)=divset(D,i) by A557,INTEGRA1:5;
             suppose A558:i<>1;
then A559:        inf divset(D,i)=D.(i-1) & sup divset(D,i)=D.i
             by A554,INTEGRA1:def 5;
               i-1 in dom D & i-1 in NAT by A554,A558,INTEGRA1:9;
then D.(i-1)=D3.(i-1+1) by A525,RFINSEQ:def 2 .= D3.(i-(1-1)) by XCMPLX_1:37
.=D3.i;
             then divset(D3,i+1)=[.inf divset(D,i),sup divset(D,i).]
             by A553,A555,A559,INTEGRA1:5;
             hence thesis by INTEGRA1:5;
            end;
            hence thesis;
           end;
             i in Seg len D by A526,A544,A546,FINSEQ_1:3;
           hence thesis by A549,A550,INTEGRA1:def 7;
          end;
          hence thesis by A542,A545,FINSEQ_1:18;
         end;
         then y=0+Sum(upper_volume(f,D)) by A533,A537,A538,A539,RVSUM_1:106
         .=upper_sum(f,D) by INTEGRA1:def 9;
         hence thesis by A531,INTEGRA1:def 11;
        end;
          1 <= len D by A530,FINSEQ_1:3;
        then 1 in dom D by FINSEQ_3:27;
then A560:   D.1=D3.(1+1) by A525,RFINSEQ:def 2 .=D3.2;
          1+1 <= len D3 by A525,NAT_1:38;
        then 2 in dom D3 by FINSEQ_3:27;
        then D3.1 < D3.2 by A520,GOBOARD1:def 1;
        hence thesis by A522,A531,A532,A560;
       end;
       hence thesis;
      end;
      hence thesis;
     end;
     then consider D being Element of divs A such that
A561: D in dom upper_sum_set(f) & y=(upper_sum_set(f)).D & D.1>inf A;
       y=upper_sum(f,D) by A561,INTEGRA1:def 11;
then A562: upper_sum(f,D)-upper_integral(f)<e/2 by A516,REAL_1:84;
     set p=len D, H=sup rng f, h=inf rng f;
     deffunc F(Nat)=vol(divset(D,$1));
     consider v being FinSequence of REAL such that
A563: len v = len D & for j st j in Seg len D holds v.j=F(j)
     from SeqLambdaD;
     consider v1 being non-decreasing FinSequence of REAL such that
A564: v,v1 are_fiberwise_equipotent by INTEGRA2:3;
defpred P[Nat] means $1 in dom v1 & v1.$1 > 0;
A565: ex k st P[k]
     proof
       consider H being Function such that
A566:   dom H = dom v & rng H = dom v1 & H is one-to-one & v=v1*H
        by A564,RFINSEQ:3;
       consider k such that
A567:  k in dom D & vol(divset(D,k)) > 0 by A3,Th1;
         dom D = Seg len D by FINSEQ_1:def 3;
       then k in dom v & v.k > 0 by A563,A567,FINSEQ_1:def 3;
       then H.k in dom v1 & v1.(H.k) > 0 by A566,FUNCT_1:21,22;
       hence thesis;
     end;
     consider k such that
A568: P[k] & for n st P[n] holds k<=n
      from Min(A565);
       p <> 0 by FINSEQ_1:25;
then A569:p > 0 by NAT_1:19;
then A570: 2*p >0 by REAL_2:122;
       H >= h by A1,Lm6;
     then H-h >= 0 by SQUARE_1:12;
     then H-h+1 > 0+0 by REAL_1:67;
then A571: 2*p*(H-h+1) > 0 by A570,REAL_2:122;
       min(v1.k,e/(2*p*(H-h+1))) > 0
     proof
       per cases by SQUARE_1:38;
       suppose min(v1.k,e/(2*p*(H-h+1))) = v1.k;
       hence thesis by A568;
       suppose min(v1.k,e/(2*p*(H-h+1))) = e/(2*p*(H-h+1));
       hence thesis by A512,A571,REAL_2:127;
     end;
     then consider n such that
A572: for m st n<=m holds 0 < (delta(T)).m
     & (delta(T)).m < min(v1.k,e/(2*p*(H-h+1))) by A5;
A573: for m st n<=m holds abs((upper_sum(f,T)).m-upper_integral(f))<e
     proof
       let m; assume A574:n<=m;
then A575:  0 < (delta(T)).m & (delta(T)).m < min(v1.k,e/(2*p*(H-h+1))) by A572
;
       reconsider D1 = T.m as Element of divs A;
       consider D2 being Element of divs A such that
A576:   D <= D2 & D1 <= D2 & rng D2 = rng D1 \/ rng D &
       0 <= upper_sum(f,D)-upper_sum(f,D2) &
       0 <= upper_sum(f,D1)-upper_sum(f,D2) by A13;
         f is_bounded_above_on A by A1,RFUNCT_1:def 11;
       then A577: upper_sum(f,D2) <= upper_sum(f,D) by A576,INTEGRA1:47;
A578:  delta(D1)=(delta(T)).m by INTEGRA2:def 3;
         min (v1.k,e/(2*p*(H-h+1))) <= v1.k by SQUARE_1:35;
then A579:   delta(D1)<v1.k by A575,A578,AXIOMS:22;
A580:  v1.1 > 0
       proof
A581:   for n1 be Element of NAT st n1 in dom D holds vol(divset(D,n1))>0
        proof
         let n1 be Element of NAT;
         assume A582:n1 in dom D;
         then A583: 1 <= n1 by FINSEQ_3:27;
         per cases by A583,REAL_1:def 5;
          suppose A584:n1=1;
          then inf divset(D,n1)=inf A & sup divset(D,n1)=D.n1
          by A582,INTEGRA1:def 5;
          then vol(divset(D,n1))=D.n1-inf A by INTEGRA1:def 6;
          hence thesis by A561,A584,SQUARE_1:11;
          suppose A585:n1>1;
          then inf divset(D,n1)=D.(n1-1) & sup divset(D,n1)=D.n1
          by A582,INTEGRA1:def 5;
then A586:     vol(divset(D,n1))=D.n1-D.(n1-1) by INTEGRA1:def 6;
A587:     n1-1 in dom D by A582,A585,INTEGRA1:9;
            n1 < n1+1 by REAL_1:69;
          then n1-1 < n1 by REAL_1:84;
          then D.(n1-1)<D.n1 by A582,A587,GOBOARD1:def 1;
          hence thesis by A586,SQUARE_1:11;
        end;
          k in Seg len v1 by A568,FINSEQ_1:def 3;
        then 1 <= k & k <= len v1 by FINSEQ_1:3;
        then 1 <= len v1 by AXIOMS:22;
        then 1 in dom v1 by FINSEQ_3:27;
then A588:   v1.1 in rng v1 by FUNCT_1:def 5;
          rng v = rng v1 by A564,RFINSEQ:1;
        then consider n1 being Element of NAT such that
A589:   n1 in dom v & v1.1 = v.n1 by A588,PARTFUN1:26;
A590:   n1 in Seg len D by A563,A589,FINSEQ_1:def 3;
then A591:   v1.1 = vol(divset(D,n1)) by A563,A589;
          n1 in dom D by A590,FINSEQ_1:def 3;
        hence thesis by A581,A591;
       end;
         v1.k = min rng upper_volume(chi(A,A),D)
       proof
A592:    k=1
        proof
         assume A593:k <> 1;
A594:    len v1 = len v by A564,RFINSEQ:16;
A595:    k in Seg len v1 by A568,FINSEQ_1:def 3;
           k in Seg len v by A568,A594,FINSEQ_1:def 3;
then A596:    1 <= k & k <= len D by A563,FINSEQ_1:3;
then A597:    k > 1 by A593,REAL_1:def 5;
           k <= len v1 by A595,FINSEQ_1:3;
         then 1 <= len v1 by A596,AXIOMS:22;
         then 1 in dom v1 by FINSEQ_3:27;
         hence contradiction by A568,A580,A597;
        end;
    min rng upper_volume(chi(A,A),D) in rng upper_volume(chi(A,A),D)
        & for x st x in rng upper_volume(chi(A,A),D)
        holds min rng upper_volume(chi(A,A),D) <= x by SFMASTR3:def 1;
        then consider m such that
A598:   m in dom upper_volume(chi(A,A),D)
        & min rng upper_volume(chi(A,A),D)=upper_volume(chi(A,A),D).m
        by PARTFUN1:26;
          m in Seg len upper_volume(chi(A,A),D) by A598,FINSEQ_1:def 3;
then A599:   m in Seg len D by INTEGRA1:def 7;
        then min rng upper_volume(chi(A,A),D)=vol(divset(D,m))
        by A598,INTEGRA1:22;
then A600:   v.m=min rng upper_volume(chi(A,A),D) by A563,A599;
          m in dom v by A563,A599,FINSEQ_1:def 3;
then A601:   min rng upper_volume(chi(A,A),D) in rng v by A600,FUNCT_1:def 5;
A602:   rng v = rng v1 by A564,RFINSEQ:1;
        then consider m1 being Element of NAT such that
A603:   m1 in dom v1 & min rng upper_volume(chi(A,A),D)=v1.m1
        by A601,PARTFUN1:26;
          m1 >= 1 by A603,FINSEQ_3:27;
then A604:   v1.1 <= min rng upper_volume(chi(A,A),D) by A568,A592,A603,
INTEGRA2:2;
          v1.k in rng upper_volume(chi(A,A),D)
        proof
           v1.k in rng v by A568,A602,FUNCT_1:def 5;
         then consider k2 being Element of NAT such that
A605:     k2 in dom v & v1.k = v.k2 by PARTFUN1:26;
A606:     k2 in Seg len D by A563,A605,FINSEQ_1:def 3;
         then v1.k = vol(divset(D,k2)) by A563,A605;
then A607:     v1.k = upper_volume(chi(A,A),D).k2 by A606,INTEGRA1:22;
           k2 in Seg len upper_volume(chi(A,A),D) by A606,INTEGRA1:def 7;
         then k2 in dom upper_volume(chi(A,A),D) by FINSEQ_1:def 3;
         hence thesis by A607,FUNCT_1:def 5;
        end;
        then v1.k >= min rng upper_volume(chi(A,A),D) by SFMASTR3:def 1;
        hence thesis by A592,A604,AXIOMS:21;
       end;
       then consider D3 being Element of divs A such that
A608:  D<=D3 & D1<=D3 & rng D3=rng D1 \/
         rng D & upper_sum(f,D1)-upper_sum(f,D3)
       <=(len D)*(sup rng f-inf rng f)*delta(D1) by A18,A579;
A609:  upper_sum(f,D1)-upper_sum(f,D2)<=(len D)*(sup rng f-inf rng f)*delta(D1)
       by A576,A608,Th5;
         H-h <= H-h+1 by REAL_1:69;
       then p*(H-h)<=p*(H-h+1) by A569,AXIOMS:25;
then p*(H-h)*(delta(T)).m <= p*(H-h+1)*(delta(T)).m by A575,AXIOMS:25;
then A610:  upper_sum(f,T.m)-upper_sum(f,D2) <= p*(H-h+1)*(delta(T)).m
       by A578,A609,AXIOMS:22;
A611:  (delta(T)).m < min(v1.k,e/(2*p*(H-h+1))) by A572,A574;
         min(v1.k,e/(2*p*(H-h+1))) <= e/(2*p*(H-h+1)) by SQUARE_1:35;
       then (delta(T)).m < e/(2*p*(H-h+1)) by A611,AXIOMS:22;
       then (delta(T)).m*(2*p*(H-h+1))<e by A571,REAL_2:177;
       then (delta(T)).m*(2*(p*(H-h+1)))<e by XCMPLX_1:4;
       then ((delta(T)).m*(p*(H-h+1)))*2<e by XCMPLX_1:4;
then A612:  p*(H-h+1)*(delta(T)).m < e/2 by REAL_2:178;
       set s=upper_integral(f), sD=upper_sum(f,D);
       set sD1=upper_sum(f,T.m), sD2=upper_sum(f,D2);
         sD+sD1-sD1-s < e/2 by A562,XCMPLX_1:26;
       then sD+sD1-(sD1+s) < e/2 by XCMPLX_1:36;
       then sD1-(sD1+s)+sD < e/2 by XCMPLX_1:29;
       then sD1-s-sD1+sD < e/2 by XCMPLX_1:36;
       then sD1-s+sD-sD1 < e/2 by XCMPLX_1:29;
       then sD1-s+sD < sD1+e/2 by REAL_1:84;
       then sD1-s < sD1+e/2-sD by REAL_1:86;
then A613:  sD1-s < sD1-sD+e/2 by XCMPLX_1:29;
         sD1-sD <= sD1-sD2 by A577,REAL_2:106;
       then sD1-sD <= p*(H-h+1)*(delta(T)).m by A610,AXIOMS:22;
       then sD1-sD < e/2 by A612,AXIOMS:22;
       then sD1-sD+e/2 < e/2+e/2 by REAL_1:53;
       then sD1-sD+e/2 <= e by XCMPLX_1:66;
       then sD1-s < e by A613,AXIOMS:22;
then A614:  (upper_sum(f,T)).m-upper_integral(f) < e by INTEGRA2:def 4;
         T.m in divs A;
then A615:  T.m in dom upper_sum_set(f) by INTEGRA1:def 11;
         (upper_sum(f,T)).m = upper_sum(f,T.m) by INTEGRA2:def 4;
       then (upper_sum(f,T)).m = (upper_sum_set(f)).(T.m) by A615,INTEGRA1:def
11;
       then (upper_sum(f,T)).m in rng upper_sum_set(f) by A615,FUNCT_1:def 5;
       then inf rng upper_sum_set(f)<=(upper_sum(f,T)).m by A515,SEQ_4:def 5;
       then upper_integral(f)<=(upper_sum(f,T)).m by INTEGRA1:def 15;
       then (upper_sum(f,T)).m-upper_integral(f) >= 0 by SQUARE_1:12;
       hence thesis by A614,ABSVALUE:def 1;
     end;
     take n;
     thus thesis by A573;
   end;
   hence upper_sum(f,T) is convergent by SEQ_2:def 6;
   hence thesis by A511,SEQ_2:def 7;
end;


Back to top