
theorem Th41:
for X be non empty set, S be SigmaField of X, M be sigma_Measure of S,
 E be Element of S, f be PartFunc of X,REAL st E = dom f &
 M.E < +infty & f is bounded & f is E-measurable
  holds f is_integrable_on M
proof
    let X be non empty set, S be SigmaField of X, M be sigma_Measure of S,
    E be Element of S, f be PartFunc of X,REAL;
    assume that
A1:  E = dom f and
A2:  M.E < +infty and
A3:  f is bounded and
A4:  f is E-measurable;

A5: E = dom(R_EAL f) by A1,MESFUNC5:def 7;
A6: R_EAL f is E-measurable by A4,MESFUNC6:def 1;
A7: rng f is real-bounded by A3,INTEGRA1:15;

    per cases;
    suppose E <> {}; then
A8:  rng f <> {} by A1,RELAT_1:42; then
     reconsider LB = inf rng f as Real by A7;
     reconsider UB = sup rng f as Real by A7,A8;
     set r = max(|.LB.|, |.UB.|);
     reconsider g = chi(E,X) as PartFunc of X,ExtREAL by RELSET_1:7,NUMBERS:31;

     dom g = X by FUNCT_3:def 3; then
A9:  dom(r(#)g) = X by MESFUNC1:def 6;

     g is_integrable_on M by A2,MESFUNC7:24; then
     r(#)g is_integrable_on M by MESFUNC5:110; then
A10:  (r(#)g)|E is_integrable_on M by MESFUNC5:112;

A11:  dom((r(#)g)|E) = dom(r(#)g) /\ E by RELAT_1:61
      .= dom g /\ E by MESFUNC1:def 6
      .= X /\ E by FUNCT_3:def 3
      .= E by XBOOLE_1:28;
     for x be Element of X st x in dom(R_EAL f)
       holds |.(R_EAL f).x .| <= ((r(#)g)|E).x
     proof
      let x be Element of X;
      assume A12: x in dom(R_EAL f); then
      x in dom f by MESFUNC5:def 7; then
A13:   LB <= f.x & f.x <= UB by XXREAL_2:3,4,FUNCT_1:3;

A14:   r >= |.UB.| & r >= |.LB.| & -r <= -|.LB.| by XXREAL_0:25,XREAL_1:24;

A15:   R_EAL f = f by MESFUNC5:def 7;

      -|.LB.| <= LB & UB <= |.UB.| by ABSVALUE:4; then
      -|.LB.| <= f.x & f.x <= |.UB.| by A13,XXREAL_0:2; then
      -r <= f.x & f.x <= r by A14,XXREAL_0:2; then
A16:   |. f.x .| <= r by ABSVALUE:5;

A17:   g.x = 1 by A12,A5,FUNCT_3:def 3;
      ((r(#)g)|E).x = (r(#)g).x by A12,A11,A5,FUNCT_1:47
       .= r*(g.x) by A9,MESFUNC1:def 6
       .= r*1 by A17,XXREAL_3:def 5;
      hence |.(R_EAL f).x .| <= ((r(#)g)|E).x by A16,A15,EXTREAL1:12;
     end; then
     R_EAL f is_integrable_on M by A6,A5,A10,A11,MESFUNC5:102;
     hence f is_integrable_on M by MESFUNC6:def 4;
    end;
    suppose A18: E = {};
A19: dom(max+(R_EAL f)) = E & dom(max-(R_EAL f)) = E
      by A5,MESFUNC2:def 2,def 3;

    for x be Element of X st x in dom(max+(R_EAL f)) holds
     (max+(R_EAL f)).x = 0 by A18,A5,MESFUNC2:def 2; then
A20: integral+(M,max+(R_EAL f)) = 0 by A19,A6,MESFUNC2:25,MESFUNC5:87;

    for x be Element of X st x in dom(max-(R_EAL f)) holds
     (max-(R_EAL f)).x = 0 by A18,A5,MESFUNC2:def 3; then
    integral+(M,max-(R_EAL f)) = 0 by A19,A6,A5,MESFUNC2:26,MESFUNC5:87;
    hence f is_integrable_on M by A6,A5,A20,MESFUNC5:def 17,MESFUNC6:def 4;
    end;
end;
