
theorem Th39:
for f be PartFunc of REAL,REAL, a,b be Real st
 f is_right_improper_integrable_on a,b holds
   (f is_right_ext_Riemann_integrable_on a,b &
    right_improper_integral(f,a,b) = ext_right_integral(f,a,b))
or (not f is_right_ext_Riemann_integrable_on a,b &
    right_improper_integral(f,a,b) = +infty)
or (not f is_right_ext_Riemann_integrable_on a,b &
    right_improper_integral(f,a,b) = -infty)
proof
    let f be PartFunc of REAL,REAL, a,b be Real;
    assume
A1:  f is_right_improper_integrable_on a,b; then
    consider Intf be PartFunc of REAL,REAL such that
A2:  dom Intf = [.a,b.[ &
     (for x be Real st x in dom Intf holds Intf.x = integral(f,a,x)) &
     (Intf is_left_convergent_in b or Intf is_left_divergent_to+infty_in b
     or Intf is_left_divergent_to-infty_in b);
    per cases by A2;
    suppose A3: Intf is_left_convergent_in b; then
A4:  f is_right_ext_Riemann_integrable_on a,b by A1,A2,INTEGR10:def 1;
     right_improper_integral(f,a,b) = lim_left(Intf,b) by A1,A2,A3,Def4
      .= ext_right_integral(f,a,b) by A2,A3,A4,INTEGR10:def 3;
     hence thesis by A3,A1,A2,INTEGR10:def 1;
    end;
    suppose A5: Intf is_left_divergent_to+infty_in b;
     for I be PartFunc of REAL,REAL st
      dom I = [.a,b.[
    & (for x be Real st x in dom I holds I.x = integral(f,a,x))
      holds not I is_left_convergent_in b
     proof
      let I be PartFunc of REAL,REAL;
      assume that
A6:    dom I = [.a,b.[ and
A7:    for x be Real st x in dom I holds I.x = integral(f,a,x);

      now let x be Element of REAL;
       assume A8: x in dom Intf; then
       Intf.x = integral(f,a,x) by A2;
       hence Intf.x = I.x by A2,A6,A7,A8;
      end; then
      Intf = I by A2,A6,PARTFUN1:5;
      hence not I is_left_convergent_in b by A5,Th6;
     end;
     hence thesis by A1,Def4,INTEGR10:def 1;
    end;
    suppose A9: Intf is_left_divergent_to-infty_in b;
     for I be PartFunc of REAL,REAL st
      dom I = [.a,b.[
    & (for x be Real st x in dom I holds I.x = integral(f,a,x))
      holds not I is_left_convergent_in b
     proof
      let I be PartFunc of REAL,REAL;
      assume that
A10:   dom I = [.a,b.[ and
A11:   for x be Real st x in dom I holds I.x = integral(f,a,x);
      now let x be Element of REAL;
       assume A12: x in dom Intf; then
       Intf.x = integral(f,a,x) by A2;
       hence Intf.x = I.x by A2,A10,A11,A12;
      end; then
      Intf = I by A2,A10,PARTFUN1:5;
      hence not I is_left_convergent_in b by A9,Th7;
     end;
     hence thesis by A1,Def4,INTEGR10:def 1;
    end;
end;
