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

let a, b be Real; :: thesis: ( a < b & [.a,b.[ c= dom f & [.a,b.[ c= dom g & f is_right_improper_integrable_on a,b & g is_right_improper_integrable_on a,b & ( not right_improper_integral (f,a,b) = +infty or not right_improper_integral (g,a,b) = -infty ) & ( not right_improper_integral (f,a,b) = -infty or not right_improper_integral (g,a,b) = +infty ) implies ( f + g is_right_improper_integrable_on a,b & right_improper_integral ((f + g),a,b) = (right_improper_integral (f,a,b)) + (right_improper_integral (g,a,b)) ) )
assume that
A1: a < b and
A2: [.a,b.[ c= dom f and
A3: [.a,b.[ c= dom g and
A4: f is_right_improper_integrable_on a,b and
A5: g is_right_improper_integrable_on a,b and
A6: ( not right_improper_integral (f,a,b) = +infty or not right_improper_integral (g,a,b) = -infty ) and
A7: ( not right_improper_integral (f,a,b) = -infty or not right_improper_integral (g,a,b) = +infty ) ; :: thesis: ( f + g is_right_improper_integrable_on a,b & right_improper_integral ((f + g),a,b) = (right_improper_integral (f,a,b)) + (right_improper_integral (g,a,b)) )
A8: for d being Real st a <= d & d < b holds
( f + g is_integrable_on ['a,d'] & (f + g) | ['a,d'] is bounded )
proof
let d be Real; :: thesis: ( a <= d & d < b implies ( f + g is_integrable_on ['a,d'] & (f + g) | ['a,d'] is bounded ) )
assume A9: ( a <= d & d < b ) ; :: thesis: ( f + g is_integrable_on ['a,d'] & (f + g) | ['a,d'] is bounded )
then A10: ( f is_integrable_on ['a,d'] & f | ['a,d'] is bounded & g is_integrable_on ['a,d'] & g | ['a,d'] is bounded ) by A4, A5;
[.a,d.] c= [.a,b.[ by A9, XXREAL_1:43;
then ['a,d'] c= [.a,b.[ by A9, INTEGRA5:def 3;
then ( ['a,d'] c= dom f & ['a,d'] c= dom g ) by A2, A3;
hence f + g is_integrable_on ['a,d'] by A10, INTEGRA6:11; :: thesis: (f + g) | ['a,d'] is bounded
(f + g) | (['a,d'] /\ ['a,d']) is bounded by A10, RFUNCT_1:83;
hence (f + g) | ['a,d'] is bounded ; :: thesis: verum
end;
per cases ( ( f is_right_ext_Riemann_integrable_on a,b & g is_right_ext_Riemann_integrable_on a,b ) or ( f is_right_ext_Riemann_integrable_on a,b & not g is_right_ext_Riemann_integrable_on a,b ) or ( not f is_right_ext_Riemann_integrable_on a,b & g is_right_ext_Riemann_integrable_on a,b ) or ( not f is_right_ext_Riemann_integrable_on a,b & not g is_right_ext_Riemann_integrable_on a,b ) ) ;
suppose A11: ( f is_right_ext_Riemann_integrable_on a,b & g is_right_ext_Riemann_integrable_on a,b ) ; :: thesis: ( f + g is_right_improper_integrable_on a,b & right_improper_integral ((f + g),a,b) = (right_improper_integral (f,a,b)) + (right_improper_integral (g,a,b)) )
end;
suppose A14: ( f is_right_ext_Riemann_integrable_on a,b & not g is_right_ext_Riemann_integrable_on a,b ) ; :: thesis: ( f + g is_right_improper_integrable_on a,b & right_improper_integral ((f + g),a,b) = (right_improper_integral (f,a,b)) + (right_improper_integral (g,a,b)) )
then A15: right_improper_integral (f,a,b) = ext_right_integral (f,a,b) by A4, Th39;
consider Intf being PartFunc of REAL,REAL such that
A16: dom Intf = [.a,b.[ and
A17: for x being Real st x in dom Intf holds
Intf . x = integral (f,a,x) and
A18: Intf is_left_convergent_in b by A14, INTEGR10:def 1;
consider Intg being PartFunc of REAL,REAL such that
A19: dom Intg = [.a,b.[ and
A20: for x being Real st x in dom Intg holds
Intg . x = integral (g,a,x) and
( Intg is_left_convergent_in b or Intg is_left_divergent_to+infty_in b or Intg is_left_divergent_to-infty_in b ) by A5;
A21: dom (Intf + Intg) = [.a,b.[ /\ [.a,b.[ by A16, A19, VALUED_1:def 1
.= [.a,b.[ ;
A22: for x being Real st x in dom (Intf + Intg) holds
(Intf + Intg) . x = integral ((f + g),a,x)
proof
let x be Real; :: thesis: ( x in dom (Intf + Intg) implies (Intf + Intg) . x = integral ((f + g),a,x) )
assume A23: x in dom (Intf + Intg) ; :: thesis: (Intf + Intg) . x = integral ((f + g),a,x)
then A24: ( a <= x & x < b ) by A21, XXREAL_1:3;
then [.a,x.] c= [.a,b.[ by XXREAL_1:43;
then A25: ( [.a,x.] c= dom f & [.a,x.] c= dom g ) by A2, A3;
A26: ['a,x'] = [.a,x.] by A24, INTEGRA5:def 3;
( f is_integrable_on ['a,x'] & f | ['a,x'] is bounded & g is_integrable_on ['a,x'] & g | ['a,x'] is bounded ) by A4, A5, A24;
then integral ((f + g),['a,x']) = (integral (f,['a,x'])) + (integral (g,['a,x'])) by A25, A26, INTEGRA6:11;
then A27: integral ((f + g),a,x) = (integral (f,['a,x'])) + (integral (g,['a,x'])) by A24, INTEGRA5:def 4
.= (integral (f,a,x)) + (integral (g,['a,x'])) by A24, INTEGRA5:def 4
.= (integral (f,a,x)) + (integral (g,a,x)) by A24, INTEGRA5:def 4 ;
(Intf + Intg) . x = (Intf . x) + (Intg . x) by A23, VALUED_1:def 1
.= (integral (f,a,x)) + (Intg . x) by A23, A21, A16, A17
.= (integral (f,a,x)) + (integral (g,a,x)) by A23, A21, A19, A20 ;
hence (Intf + Intg) . x = integral ((f + g),a,x) by A27; :: thesis: verum
end;
A28: for r being Real st r < b holds
ex g being Real st
( r < g & g < b & g in dom (Intf + Intg) )
proof
let r be Real; :: thesis: ( r < b implies ex g being Real st
( r < g & g < b & g in dom (Intf + Intg) ) )

assume r < b ; :: thesis: ex g being Real st
( r < g & g < b & g in dom (Intf + Intg) )

then consider g being Real such that
A29: ( max (a,r) < g & g < b ) by A1, XXREAL_0:29, XREAL_1:5;
take g ; :: thesis: ( r < g & g < b & g in dom (Intf + Intg) )
( max (a,r) >= a & max (a,r) >= r ) by XXREAL_0:25;
then ( r < g & a < g ) by A29, XXREAL_0:2;
hence ( r < g & g < b & g in dom (Intf + Intg) ) by A29, A21, XXREAL_1:3; :: thesis: verum
end;
A30: ( ex r being Real st
( 0 < r & Intf | ].(b - r),b.[ is bounded_below ) & ex r being Real st
( 0 < r & Intf | ].(b - r),b.[ is bounded_above ) ) by A18, Th11;
per cases ( right_improper_integral (g,a,b) = +infty or right_improper_integral (g,a,b) = -infty ) by A5, A14, Th39;
end;
end;
suppose A35: ( not f is_right_ext_Riemann_integrable_on a,b & g is_right_ext_Riemann_integrable_on a,b ) ; :: thesis: ( f + g is_right_improper_integrable_on a,b & right_improper_integral ((f + g),a,b) = (right_improper_integral (f,a,b)) + (right_improper_integral (g,a,b)) )
then A36: right_improper_integral (g,a,b) = ext_right_integral (g,a,b) by A5, Th39;
consider Intg being PartFunc of REAL,REAL such that
A37: dom Intg = [.a,b.[ and
A38: for x being Real st x in dom Intg holds
Intg . x = integral (g,a,x) and
A39: Intg is_left_convergent_in b by A35, INTEGR10:def 1;
consider Intf being PartFunc of REAL,REAL such that
A40: dom Intf = [.a,b.[ and
A41: for x being Real st x in dom Intf holds
Intf . x = integral (f,a,x) and
( Intf is_left_convergent_in b or Intf is_left_divergent_to+infty_in b or Intf is_left_divergent_to-infty_in b ) by A4;
A42: dom (Intf + Intg) = [.a,b.[ /\ [.a,b.[ by A37, A40, VALUED_1:def 1
.= [.a,b.[ ;
A43: for x being Real st x in dom (Intf + Intg) holds
(Intf + Intg) . x = integral ((f + g),a,x)
proof
let x be Real; :: thesis: ( x in dom (Intf + Intg) implies (Intf + Intg) . x = integral ((f + g),a,x) )
assume A44: x in dom (Intf + Intg) ; :: thesis: (Intf + Intg) . x = integral ((f + g),a,x)
then A45: ( a <= x & x < b ) by A42, XXREAL_1:3;
then [.a,x.] c= [.a,b.[ by XXREAL_1:43;
then A46: ( [.a,x.] c= dom f & [.a,x.] c= dom g ) by A2, A3;
A47: ['a,x'] = [.a,x.] by A45, INTEGRA5:def 3;
( f is_integrable_on ['a,x'] & f | ['a,x'] is bounded & g is_integrable_on ['a,x'] & g | ['a,x'] is bounded ) by A4, A5, A45;
then integral ((f + g),['a,x']) = (integral (f,['a,x'])) + (integral (g,['a,x'])) by A46, A47, INTEGRA6:11;
then A48: integral ((f + g),a,x) = (integral (f,['a,x'])) + (integral (g,['a,x'])) by A45, INTEGRA5:def 4
.= (integral (f,a,x)) + (integral (g,['a,x'])) by A45, INTEGRA5:def 4
.= (integral (f,a,x)) + (integral (g,a,x)) by A45, INTEGRA5:def 4 ;
(Intf + Intg) . x = (Intf . x) + (Intg . x) by A44, VALUED_1:def 1
.= (integral (f,a,x)) + (Intg . x) by A44, A42, A40, A41
.= (integral (f,a,x)) + (integral (g,a,x)) by A44, A42, A37, A38 ;
hence (Intf + Intg) . x = integral ((f + g),a,x) by A48; :: thesis: verum
end;
A49: for r being Real st r < b holds
ex g being Real st
( r < g & g < b & g in dom (Intf + Intg) )
proof
let r be Real; :: thesis: ( r < b implies ex g being Real st
( r < g & g < b & g in dom (Intf + Intg) ) )

assume r < b ; :: thesis: ex g being Real st
( r < g & g < b & g in dom (Intf + Intg) )

then consider g being Real such that
A50: ( max (a,r) < g & g < b ) by A1, XXREAL_0:29, XREAL_1:5;
take g ; :: thesis: ( r < g & g < b & g in dom (Intf + Intg) )
( max (a,r) >= a & max (a,r) >= r ) by XXREAL_0:25;
then ( r < g & a < g ) by A50, XXREAL_0:2;
hence ( r < g & g < b & g in dom (Intf + Intg) ) by A50, A42, XXREAL_1:3; :: thesis: verum
end;
A51: ( ex r being Real st
( 0 < r & Intg | ].(b - r),b.[ is bounded_below ) & ex r being Real st
( 0 < r & Intg | ].(b - r),b.[ is bounded_above ) ) by A39, Th11;
per cases ( right_improper_integral (f,a,b) = +infty or right_improper_integral (f,a,b) = -infty ) by A4, A35, Th39;
end;
end;
suppose A56: ( not f is_right_ext_Riemann_integrable_on a,b & not g is_right_ext_Riemann_integrable_on a,b ) ; :: thesis: ( f + g is_right_improper_integrable_on a,b & right_improper_integral ((f + g),a,b) = (right_improper_integral (f,a,b)) + (right_improper_integral (g,a,b)) )
consider Intf being PartFunc of REAL,REAL such that
A57: dom Intf = [.a,b.[ and
A58: for x being Real st x in dom Intf holds
Intf . x = integral (f,a,x) and
( Intf is_left_convergent_in b or Intf is_left_divergent_to+infty_in b or Intf is_left_divergent_to-infty_in b ) by A4;
consider Intg being PartFunc of REAL,REAL such that
A59: dom Intg = [.a,b.[ and
A60: for x being Real st x in dom Intg holds
Intg . x = integral (g,a,x) and
( Intg is_left_convergent_in b or Intg is_left_divergent_to+infty_in b or Intg is_left_divergent_to-infty_in b ) by A5;
A61: dom (Intf + Intg) = [.a,b.[ /\ [.a,b.[ by A59, A57, VALUED_1:def 1
.= [.a,b.[ ;
A62: for x being Real st x in dom (Intf + Intg) holds
(Intf + Intg) . x = integral ((f + g),a,x)
proof
let x be Real; :: thesis: ( x in dom (Intf + Intg) implies (Intf + Intg) . x = integral ((f + g),a,x) )
assume A63: x in dom (Intf + Intg) ; :: thesis: (Intf + Intg) . x = integral ((f + g),a,x)
then A64: ( a <= x & x < b ) by A61, XXREAL_1:3;
then [.a,x.] c= [.a,b.[ by XXREAL_1:43;
then A65: ( [.a,x.] c= dom f & [.a,x.] c= dom g ) by A2, A3;
A66: ['a,x'] = [.a,x.] by A64, INTEGRA5:def 3;
( f is_integrable_on ['a,x'] & f | ['a,x'] is bounded & g is_integrable_on ['a,x'] & g | ['a,x'] is bounded ) by A4, A5, A64;
then integral ((f + g),['a,x']) = (integral (f,['a,x'])) + (integral (g,['a,x'])) by A65, A66, INTEGRA6:11;
then A67: integral ((f + g),a,x) = (integral (f,['a,x'])) + (integral (g,['a,x'])) by A64, INTEGRA5:def 4
.= (integral (f,a,x)) + (integral (g,['a,x'])) by A64, INTEGRA5:def 4
.= (integral (f,a,x)) + (integral (g,a,x)) by A64, INTEGRA5:def 4 ;
(Intf + Intg) . x = (Intf . x) + (Intg . x) by A63, VALUED_1:def 1
.= (integral (f,a,x)) + (Intg . x) by A63, A61, A57, A58
.= (integral (f,a,x)) + (integral (g,a,x)) by A63, A61, A59, A60 ;
hence (Intf + Intg) . x = integral ((f + g),a,x) by A67; :: thesis: verum
end;
A68: for r being Real st r < b holds
ex g being Real st
( r < g & g < b & g in dom (Intf + Intg) )
proof
let r be Real; :: thesis: ( r < b implies ex g being Real st
( r < g & g < b & g in dom (Intf + Intg) ) )

assume r < b ; :: thesis: ex g being Real st
( r < g & g < b & g in dom (Intf + Intg) )

then consider g being Real such that
A69: ( max (a,r) < g & g < b ) by A1, XXREAL_0:29, XREAL_1:5;
take g ; :: thesis: ( r < g & g < b & g in dom (Intf + Intg) )
( max (a,r) >= a & max (a,r) >= r ) by XXREAL_0:25;
then ( r < g & a < g ) by A69, XXREAL_0:2;
hence ( r < g & g < b & g in dom (Intf + Intg) ) by A69, A61, XXREAL_1:3; :: thesis: verum
end;
per cases ( right_improper_integral (f,a,b) = +infty or right_improper_integral (f,a,b) = -infty ) by A4, A56, Th39;
suppose A70: right_improper_integral (f,a,b) = +infty ; :: thesis: ( f + g is_right_improper_integrable_on a,b & right_improper_integral ((f + g),a,b) = (right_improper_integral (f,a,b)) + (right_improper_integral (g,a,b)) )
end;
suppose A72: right_improper_integral (f,a,b) = -infty ; :: thesis: ( f + g is_right_improper_integrable_on a,b & right_improper_integral ((f + g),a,b) = (right_improper_integral (f,a,b)) + (right_improper_integral (g,a,b)) )
end;
end;
end;
end;