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 ) )

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 );
assume A1: vol A > 0 ; :: thesis: ex T being DivSequence of A st
( delta T is convergent & lim (delta T) = 0 )

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

assume A39: 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

a is Real by XREAL_0:def 1;
then consider i being Element of NAT such that
A40: abs (((delta T) . i) - 0) < a by A30, A39;
(delta T) . i >= 0 by A35;
then A41: (delta T) . i < a by A40, 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 A36;
then A42: (delta T) . j < a by A41, XXREAL_0:2;
(delta T) . j >= 0 by A35;
hence abs (((delta T) . j) - 0) < a by A42, 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 A43: delta T is convergent by SEQ_2:def 6;
then lim (delta T) = 0 by A38, SEQ_2:def 7;
hence ex T being DivSequence of A st
( delta T is convergent & lim (delta T) = 0 ) by A43; :: thesis: verum