let A be closed-interval Subset of REAL ; :: thesis: ( vol A > 0 implies ex T being DivSequence of A st
( delta T is convergent & lim (delta T) = 0 ) )

assume A1: vol A > 0 ; :: thesis: ex T being DivSequence of A st
( delta T is convergent & lim (delta T) = 0 )

defpred S1[ set , set ] means ex n being Element of NAT ex e being Division of A st
( n = $1 & e = $2 & e divide_into_equal n + 1 );
A2: for n being Element of NAT ex D being Element of divs A st S1[n,D]
proof
let n be Element of NAT ; :: thesis: ex D being Element of divs A st S1[n,D]
consider D being Division of A such that
A3: ( len D = n + 1 & ( for i being Element of NAT st i in dom D holds
D . i = (lower_bound A) + (((vol A) / (n + 1)) * i) ) ) by A1, Lm3;
a1: D is Element of divs A by INTEGRA1:def 3;
D divide_into_equal n + 1 by A3, Def1;
hence ex D being Element of divs A st S1[n,D] by a1; :: thesis: verum
end;
consider T being Function of NAT ,(divs A) such that
A4: for n being Element of NAT holds S1[n,T . n] from FUNCT_2:sch 3(A2);
reconsider T = T as DivSequence of A ;
A5: for i being Element of NAT holds (delta T) . i >= 0
proof
let i be Element of NAT ; :: thesis: (delta T) . i >= 0
(delta T) . i = delta (T . i) by INTEGRA2:def 3;
hence (delta T) . i >= 0 by INTEGRA3:8; :: thesis: verum
end;
A6: for i being Element of NAT holds (delta T) . i = (vol A) / (i + 1)
proof
let i be Element of NAT ; :: thesis: (delta T) . i = (vol A) / (i + 1)
(delta T) . i = delta (T . i) by INTEGRA2:def 3;
then A7: (delta T) . i = max (rng (upper_volume (chi A,A),(T . i))) by INTEGRA1:def 19;
rng (upper_volume (chi A,A),(T . i)) = {((vol A) / (i + 1))}
proof
for x1 being set st x1 in rng (upper_volume (chi A,A),(T . i)) holds
x1 in {((vol A) / (i + 1))}
proof
let x1 be set ; :: thesis: ( x1 in rng (upper_volume (chi A,A),(T . i)) implies x1 in {((vol A) / (i + 1))} )
assume x1 in rng (upper_volume (chi A,A),(T . i)) ; :: thesis: x1 in {((vol A) / (i + 1))}
then consider k being Element of NAT such that
A8: ( k in dom (upper_volume (chi A,A),(T . i)) & (upper_volume (chi A,A),(T . i)) . k = x1 ) by PARTFUN1:26;
reconsider D = T . i as Division of A ;
A9: ex n being Element of NAT ex e being Division of A st
( n = i & e = D & e divide_into_equal n + 1 ) by A4;
k in Seg (len (upper_volume (chi A,A),(T . i))) by A8, FINSEQ_1:def 3;
then A10: k in Seg (len D) by INTEGRA1:def 7;
then k in dom D by FINSEQ_1:def 3;
then x1 = vol (divset D,k) by A8, INTEGRA1:22;
then A11: x1 = (upper_bound (divset D,k)) - (lower_bound (divset D,k)) by INTEGRA1:def 6;
(upper_bound (divset D,k)) - (lower_bound (divset D,k)) = (vol A) / (i + 1)
proof
A12: 1 <= k by A8, FINSEQ_3:27;
now
per cases ( k = 1 or k > 1 ) by A12, XXREAL_0:1;
suppose A13: k = 1 ; :: thesis: (upper_bound (divset D,k)) - (lower_bound (divset D,k)) = (vol A) / (i + 1)
then A14: 1 in dom D by A10, FINSEQ_1:def 3;
then A15: ( lower_bound (divset D,k) = lower_bound A & upper_bound (divset D,k) = D . 1 ) by A13, INTEGRA1:def 5;
( len D = i + 1 & ( for j being Element of NAT st j in dom D holds
D . j = (lower_bound A) + (((vol A) / (len D)) * j) ) ) by A9, Def1;
then upper_bound (divset D,k) = (lower_bound A) + (((vol A) / (i + 1)) * 1) by A14, A15;
then (upper_bound (divset D,k)) - (lower_bound (divset D,k)) = ((lower_bound A) + ((vol A) / (i + 1))) - (lower_bound A) by A13, A14, INTEGRA1:def 5
.= ((vol A) / (i + 1)) - ((lower_bound A) - (lower_bound A)) ;
hence (upper_bound (divset D,k)) - (lower_bound (divset D,k)) = (vol A) / (i + 1) ; :: thesis: verum
end;
suppose A16: k > 1 ; :: thesis: (upper_bound (divset D,k)) - (lower_bound (divset D,k)) = (vol A) / (i + 1)
A17: k in dom D by A10, FINSEQ_1:def 3;
then A18: ( lower_bound (divset D,k) = D . (k - 1) & upper_bound (divset D,k) = D . k ) by A16, INTEGRA1:def 5;
( k - 1 in dom D & k - 1 in NAT ) by A16, A17, INTEGRA1:9;
then ( D . (k - 1) = (lower_bound A) + (((vol A) / (len D)) * (k - 1)) & D . k = (lower_bound A) + (((vol A) / (len D)) * k) ) by A9, A17, Def1;
hence (upper_bound (divset D,k)) - (lower_bound (divset D,k)) = (vol A) / (i + 1) by A9, A18, Def1; :: thesis: verum
end;
end;
end;
hence (upper_bound (divset D,k)) - (lower_bound (divset D,k)) = (vol A) / (i + 1) ; :: thesis: verum
end;
hence x1 in {((vol A) / (i + 1))} by A11, TARSKI:def 1; :: thesis: verum
end;
then A19: rng (upper_volume (chi A,A),(T . i)) c= {((vol A) / (i + 1))} by TARSKI:def 3;
for x1 being set st x1 in {((vol A) / (i + 1))} holds
x1 in rng (upper_volume (chi A,A),(T . i))
proof
let x1 be set ; :: thesis: ( x1 in {((vol A) / (i + 1))} implies x1 in rng (upper_volume (chi A,A),(T . i)) )
assume x1 in {((vol A) / (i + 1))} ; :: thesis: x1 in rng (upper_volume (chi A,A),(T . i))
then A20: x1 = (vol A) / (i + 1) by TARSKI:def 1;
reconsider D = T . i as Division of A ;
rng D <> {} ;
then A21: 1 in dom D by FINSEQ_3:34;
then A22: 1 in Seg (len D) by FINSEQ_1:def 3;
then B22: 1 in dom D by FINSEQ_1:def 3;
1 in Seg (len (upper_volume (chi A,A),D)) by A22, INTEGRA1:def 7;
then 1 in dom (upper_volume (chi A,A),D) by FINSEQ_1:def 3;
then A23: (upper_volume (chi A,A),D) . 1 in rng (upper_volume (chi A,A),D) by FUNCT_1:def 5;
A24: (upper_volume (chi A,A),D) . 1 = vol (divset D,1) by B22, INTEGRA1:22;
A25: vol (divset D,1) = (upper_bound (divset D,1)) - (lower_bound (divset D,1)) by INTEGRA1:def 6;
A26: ( upper_bound (divset D,1) = D . 1 & lower_bound (divset D,1) = lower_bound A ) by A21, INTEGRA1:def 5;
A27: ex n being Element of NAT ex e being Division of A st
( n = i & e = D & e divide_into_equal n + 1 ) by A4;
then upper_bound (divset D,1) = (lower_bound A) + (((vol A) / (len D)) * 1) by A21, A26, Def1;
then vol (divset D,1) = ((lower_bound A) + ((vol A) / (len D))) - (lower_bound A) by A21, A25, INTEGRA1:def 5
.= (vol A) / (len D) ;
hence x1 in rng (upper_volume (chi A,A),(T . i)) by A20, A23, A24, A27, Def1; :: thesis: verum
end;
then {((vol A) / (i + 1))} c= rng (upper_volume (chi A,A),(T . i)) by TARSKI:def 3;
hence rng (upper_volume (chi A,A),(T . i)) = {((vol A) / (i + 1))} by A19, XBOOLE_0:def 10; :: thesis: verum
end;
then (delta T) . i in {((vol A) / (i + 1))} by A7, XXREAL_2:def 8;
hence (delta T) . i = (vol A) / (i + 1) by TARSKI:def 1; :: thesis: verum
end;
A28: for i, j being Element of NAT st i <= j holds
(delta T) . i >= (delta T) . j
proof
let i, j be Element of NAT ; :: thesis: ( i <= j implies (delta T) . i >= (delta T) . j )
assume i <= j ; :: thesis: (delta T) . i >= (delta T) . j
then A29: i + 1 <= j + 1 by XREAL_1:8;
vol A >= 0 by INTEGRA1:11;
then (vol A) / (i + 1) >= (vol A) / (j + 1) by A29, XREAL_1:120;
then (delta T) . i >= (vol A) / (j + 1) by A6;
hence (delta T) . i >= (delta T) . j by A6; :: thesis: verum
end;
A30: for a being Real st 0 < a holds
ex i being Element of NAT st abs (((delta T) . i) - 0 ) < a
proof
let a be Real; :: thesis: ( 0 < a implies ex i being Element of NAT st abs (((delta T) . i) - 0 ) < a )
assume A31: 0 < a ; :: thesis: ex i being Element of NAT st abs (((delta T) . i) - 0 ) < a
A32: vol A >= 0 by INTEGRA1:11;
then (vol A) / a >= 0 by A31;
then A33: [\((vol A) / a)/] + 1 > 0 by INT_1:52;
reconsider i1 = [\((vol A) / a)/] + 1 as Integer ;
reconsider i1 = i1 as Element of NAT by A33, INT_1:16;
i1 < i1 + 1 by NAT_1:13;
then (vol A) / a < 1 * (i1 + 1) by INT_1:52, XXREAL_0:2;
then A34: (vol A) / (i1 + 1) < 1 * a by A31, XREAL_1:115;
(vol A) / (i1 + 1) >= 0 by A32;
then A35: ((vol A) / (i1 + 1)) - 0 = abs (((vol A) / (i1 + 1)) - 0 ) by ABSVALUE:def 1;
(delta T) . i1 = (vol A) / (i1 + 1) by A6;
hence ex i being Element of NAT st abs (((delta T) . i) - 0 ) < a by A34, A35; :: thesis: verum
end;
A36: for a being real number st 0 < a holds
ex i being Element of NAT st
for j being Element of NAT st i <= j holds
abs (((delta T) . j) - 0 ) < a
proof
let a be real number ; :: thesis: ( 0 < a implies ex i being Element of NAT st
for j being Element of NAT st i <= j holds
abs (((delta T) . j) - 0 ) < a )

A37: a is Real by XREAL_0:def 1;
assume 0 < a ; :: thesis: ex i being Element of NAT st
for j being Element of NAT st i <= j holds
abs (((delta T) . j) - 0 ) < a

then consider i being Element of NAT such that
A38: abs (((delta T) . i) - 0 ) < a by A30, A37;
(delta T) . i >= 0 by A5;
then A39: (delta T) . i < a by A38, ABSVALUE:def 1;
for j being Element of NAT st i <= j holds
abs (((delta T) . j) - 0 ) < a
proof
let j be Element of NAT ; :: thesis: ( i <= j implies abs (((delta T) . j) - 0 ) < a )
assume i <= j ; :: thesis: abs (((delta T) . j) - 0 ) < a
then (delta T) . j <= (delta T) . i by A28;
then A40: (delta T) . j < a by A39, XXREAL_0:2;
(delta T) . j >= 0 by A5;
hence abs (((delta T) . j) - 0 ) < a by A40, ABSVALUE:def 1; :: thesis: verum
end;
hence ex i being Element of NAT st
for j being Element of NAT st i <= j holds
abs (((delta T) . j) - 0 ) < a ; :: thesis: verum
end;
then A41: delta T is convergent by SEQ_2:def 6;
then lim (delta T) = 0 by A36, SEQ_2:def 7;
hence ex T being DivSequence of A st
( delta T is convergent & lim (delta T) = 0 ) by A41; :: thesis: verum