let f be PartFunc of REAL,REAL; :: thesis: for a, c being Real st [.a,c.[ c= dom f & f is_right_improper_integrable_on a,c & right_improper_integral (f,a,c) = ext_right_integral (f,a,c) holds
for b being Real st a <= b & b < c holds
( f is_right_improper_integrable_on b,c & right_improper_integral (f,b,c) = ext_right_integral (f,b,c) )

let a, c be Real; :: thesis: ( [.a,c.[ c= dom f & f is_right_improper_integrable_on a,c & right_improper_integral (f,a,c) = ext_right_integral (f,a,c) implies for b being Real st a <= b & b < c holds
( f is_right_improper_integrable_on b,c & right_improper_integral (f,b,c) = ext_right_integral (f,b,c) ) )

assume that
A1: [.a,c.[ c= dom f and
A2: f is_right_improper_integrable_on a,c and
A3: right_improper_integral (f,a,c) = ext_right_integral (f,a,c) ; :: thesis: for b being Real st a <= b & b < c holds
( f is_right_improper_integrable_on b,c & right_improper_integral (f,b,c) = ext_right_integral (f,b,c) )

let b be Real; :: thesis: ( a <= b & b < c implies ( f is_right_improper_integrable_on b,c & right_improper_integral (f,b,c) = ext_right_integral (f,b,c) ) )
assume A4: ( a <= b & b < c ) ; :: thesis: ( f is_right_improper_integrable_on b,c & right_improper_integral (f,b,c) = ext_right_integral (f,b,c) )
A5: for d being Real st b <= d & d < c holds
( f is_integrable_on ['b,d'] & f | ['b,d'] is bounded ) by A1, A2, A4, Lm15;
consider I being PartFunc of REAL,REAL such that
A6: dom I = [.a,c.[ and
A7: for x being Real st x in dom I holds
I . x = integral (f,a,x) and
A8: ( I is_left_convergent_in c or I is_left_divergent_to+infty_in c or I is_left_divergent_to-infty_in c ) by A2;
A9: now :: thesis: not I is_left_divergent_to+infty_in cend;
A10: now :: thesis: not I is_left_divergent_to-infty_in cend;
reconsider BC = [.b,c.[ as non empty Subset of REAL by A4, XXREAL_1:3;
deffunc H1( Element of BC) -> Element of REAL = In ((integral (f,b,$1)),REAL);
consider Intf being Function of BC,REAL such that
A11: for x being Element of BC holds Intf . x = H1(x) from FUNCT_2:sch 4();
A12: dom Intf = BC by FUNCT_2:def 1;
then reconsider Intf = Intf as PartFunc of REAL,REAL by RELSET_1:5;
A13: for x being Real st x in dom Intf holds
Intf . x = integral (f,b,x)
proof
let x be Real; :: thesis: ( x in dom Intf implies Intf . x = integral (f,b,x) )
assume x in dom Intf ; :: thesis: Intf . x = integral (f,b,x)
then Intf . x = In ((integral (f,b,x)),REAL) by A11, A12;
hence Intf . x = integral (f,b,x) ; :: thesis: verum
end;
A14: for r being Real st r < c holds
ex g being Real st
( r < g & g < c & g in dom Intf )
proof
let r be Real; :: thesis: ( r < c implies ex g being Real st
( r < g & g < c & g in dom Intf ) )

assume A15: r < c ; :: thesis: ex g being Real st
( r < g & g < c & g in dom Intf )

set R = max (b,r);
consider g being Real such that
A16: ( max (b,r) < g & g < c & g in dom I ) by A8, A9, A10, A15, A4, XXREAL_0:29, LIMFUNC2:7;
( b <= max (b,r) & r <= max (b,r) ) by XXREAL_0:25;
then A17: ( b < g & r < g ) by A16, XXREAL_0:2;
then g in [.b,c.[ by A16, XXREAL_1:3;
hence ex g being Real st
( r < g & g < c & g in dom Intf ) by A12, A17, A16; :: thesis: verum
end;
consider g being Real such that
A18: for g1 being Real st 0 < g1 holds
ex r being Real st
( r < c & ( for r1 being Real st r < r1 & r1 < c & r1 in dom I holds
|.((I . r1) - g).| < g1 ) ) by A8, A9, A10, LIMFUNC2:7;
set G = g - (integral (f,a,b));
A19: for g1 being Real st 0 < g1 holds
ex r being Real st
( r < c & ( for r1 being Real st r < r1 & r1 < c & r1 in dom Intf holds
|.((Intf . r1) - (g - (integral (f,a,b)))).| < g1 ) )
proof
let g1 be Real; :: thesis: ( 0 < g1 implies ex r being Real st
( r < c & ( for r1 being Real st r < r1 & r1 < c & r1 in dom Intf holds
|.((Intf . r1) - (g - (integral (f,a,b)))).| < g1 ) ) )

assume 0 < g1 ; :: thesis: ex r being Real st
( r < c & ( for r1 being Real st r < r1 & r1 < c & r1 in dom Intf holds
|.((Intf . r1) - (g - (integral (f,a,b)))).| < g1 ) )

then consider r being Real such that
A20: r < c and
A21: for r1 being Real st r < r1 & r1 < c & r1 in dom I holds
|.((I . r1) - g).| < g1 by A18;
set R = max (b,r);
for r1 being Real st max (b,r) < r1 & r1 < c & r1 in dom Intf holds
|.((Intf . r1) - (g - (integral (f,a,b)))).| < g1
proof
let r1 be Real; :: thesis: ( max (b,r) < r1 & r1 < c & r1 in dom Intf implies |.((Intf . r1) - (g - (integral (f,a,b)))).| < g1 )
assume that
A22: max (b,r) < r1 and
A23: r1 < c and
A24: r1 in dom Intf ; :: thesis: |.((Intf . r1) - (g - (integral (f,a,b)))).| < g1
( r <= max (b,r) & b <= max (b,r) ) by XXREAL_0:25;
then A25: ( r < r1 & b < r1 ) by A22, XXREAL_0:2;
A26: dom Intf c= dom I by A4, A6, A12, XXREAL_1:38;
then A27: |.((I . r1) - g).| < g1 by A25, A23, A21, A24;
A28: a <= r1 by A6, A24, A26, XXREAL_1:3;
then A29: ( f is_integrable_on ['a,r1'] & f | ['a,r1'] is bounded ) by A2, A23;
A30: [.a,r1.] = ['a,r1'] by A28, INTEGRA5:def 3;
then ['a,r1'] c= [.a,c.[ by A23, XXREAL_1:43;
then A31: ['a,r1'] c= dom f by A1;
A32: b in ['a,r1'] by A25, A4, A30, XXREAL_1:1;
(I . r1) - g = (integral (f,a,r1)) - g by A7, A24, A26
.= ((integral (f,a,b)) + (integral (f,b,r1))) - g by A28, A29, A31, A32, INTEGRA6:17
.= (integral (f,b,r1)) - (g - (integral (f,a,b))) ;
hence |.((Intf . r1) - (g - (integral (f,a,b)))).| < g1 by A24, A27, A13; :: thesis: verum
end;
hence ex r being Real st
( r < c & ( for r1 being Real st r < r1 & r1 < c & r1 in dom Intf holds
|.((Intf . r1) - (g - (integral (f,a,b)))).| < g1 ) ) by A20, A4, XXREAL_0:29; :: thesis: verum
end;
hence A33: f is_right_improper_integrable_on b,c by A12, A13, A14, A1, A2, A4, Lm15, LIMFUNC2:7; :: thesis: right_improper_integral (f,b,c) = ext_right_integral (f,b,c)
f is_right_ext_Riemann_integrable_on b,c by A5, A12, A13, A14, A19, LIMFUNC2:7, INTEGR10:def 1;
hence right_improper_integral (f,b,c) = ext_right_integral (f,b,c) by A33, Th39; :: thesis: verum