
theorem Th31:
  for f be PartFunc of REAL,REAL, a,b be Real st [.a,b.[ c= dom f
  & f is_right_ext_Riemann_integrable_on a,b holds for r be Real holds r(#)
  f is_right_ext_Riemann_integrable_on a,b & ext_right_integral(r(#)f,a,b) = r*
  ext_right_integral(f,a,b)
proof
  let f be PartFunc of REAL,REAL, a,b be Real such that
A1: [.a,b.[ c= dom f and
A2: f is_right_ext_Riemann_integrable_on a,b;
  for r be Real holds r(#)f is_right_ext_Riemann_integrable_on a,b &
  ext_right_integral(r(#)f,a,b) = r*ext_right_integral(f,a,b)
  proof
    let r be Real;
    consider Intf be PartFunc of REAL,REAL such that
A3: dom Intf = [.a,b.[ and
A4: for x be Real st x in dom Intf holds Intf.x =integral(f,a,x) and
A5: Intf is_left_convergent_in b and
A6: ext_right_integral(f,a,b) = lim_left(Intf,b) by A2,INTEGR10:def 3;
    set Intfg = r(#)Intf;
A7: Intfg is_left_convergent_in b by A5,LIMFUNC2:43;
A8: dom Intfg = [.a,b.[ &
   for x be Real st x in dom Intfg holds Intfg.x =
    integral(r(#)f,a,x)
    proof
      thus
A9:  dom Intfg = [.a,b.[ by A3,VALUED_1:def 5;
      let x be Real;
      assume
A10:  x in dom Intfg;
      then
A11:  a <= x by A9,XXREAL_1:3;
      then
A12:  [' a,x '] = [.a,x.] by INTEGRA5:def 3;
A13:  x < b by A9,A10,XXREAL_1:3;
      then
A14:  [.a,x.] c= [.a,b.[ by XXREAL_1:43;
A15:  f is_integrable_on [' a,x '] & f|[' a,x '] is bounded
by A2,A11,A13,INTEGR10:def 1;
      thus Intfg.x = r*Intf.x by A10,VALUED_1:def 5
        .= r*integral(f,a,x) by A3,A4,A9,A10
        .= integral(r(#)f,a,x) by A1,A11,A12,A14,A15,INTEGRA6:10,XBOOLE_1:1
;
    end;
    for d be Real
st a<= d & d < b holds r(#)f is_integrable_on [' a,d '] &
    (r(#)f)|[' a,d '] is bounded
    proof
      let d be Real;
      assume
A16:  a <= d & d < b;
      then
A17:  [' a,d '] = [.a,d.] & [.a,d.] c= [.a,b.[ by INTEGRA5:def 3,XXREAL_1:43;
A18:  f is_integrable_on [' a,d '] & f|[' a,d '] is bounded
by A2,A16,INTEGR10:def 1;
      [' a,d '] c= dom f by A1,A17;
      hence thesis by A18,INTEGRA6:9,RFUNCT_1:80;
    end;
    hence
A19: r(#)f is_right_ext_Riemann_integrable_on a,b
      by A8,A5,LIMFUNC2:43,INTEGR10:def 1;
    lim_left (Intfg,b) = r*ext_right_integral(f,a,b) by A5,A6,LIMFUNC2:43;
    hence thesis by A8,A7,A19,INTEGR10:def 3;
  end;
  hence thesis;
end;
