reserve X for non empty set,
  S for SigmaField of X,
  M for sigma_Measure of S,
  f,g for PartFunc of X,ExtREAL,
  E for Element of S;

theorem
  f is_integrable_on M implies ex F be sequence of S st ( for n be
Element of NAT holds F.n = dom f /\ great_eq_dom(|.f.|, (1/(n+1))) ) & dom
f \ eq_dom(f, 0.) = union rng F & for n be Element of NAT holds F.n in S & M.(F
  .n) <+infty
proof
  assume
A1: f is_integrable_on M;
  then consider E be Element of S such that
A2: E = dom f and
A3: f is E-measurable;
  defpred P[Element of NAT,set] means $2 = E /\ great_eq_dom(|.f.|, (1/(
  $1+1)));
A4: dom |.f.| = E by A2,MESFUNC1:def 10;
  now
    let x be object;
    assume
A5: x in E \ eq_dom(f, 0.);
    then reconsider z=x as Element of X;
    reconsider y=f.z as R_eal;
A6: x in E by A5,XBOOLE_0:def 5;
    then
A7: x in dom |.f.| by A2,MESFUNC1:def 10;
    not x in eq_dom(f, 0.) by A5,XBOOLE_0:def 5;
    then not y = 0. by A2,A6,MESFUNC1:def 15;
    then 0. < |.f.z.| by EXTREAL1:15;
    then 0. < (|.f.|).z by A7,MESFUNC1:def 10;
    then x in great_dom(|.f.|, 0.) by A7,MESFUNC1:def 13;
    hence x in E /\ great_dom(|.f.|, 0.) by A6,XBOOLE_0:def 4;
  end;
  then
A8: E \ eq_dom(f, 0.) c= E /\ great_dom(|.f.|, 0.);
  now
    let x be object;
    assume
A9: x in E /\ great_dom(|.f.|, 0.);
    then reconsider z=x as Element of X;
    x in great_dom(|.f.|, 0.) by A9,XBOOLE_0:def 4;
    then
A10: 0. < (|.f.|).z by MESFUNC1:def 13;
A11: x in E by A9,XBOOLE_0:def 4;
    then x in dom |.f.| by A2,MESFUNC1:def 10;
    then
A12: 0. < |.f.z.| by A10,MESFUNC1:def 10;
    not x in eq_dom(f, 0.)
    proof
      assume x in eq_dom(f, 0.);
      then f.z = 0. by MESFUNC1:def 15;
      hence contradiction by A12,EXTREAL1:16;
    end;
    hence x in E \ eq_dom(f, 0.) by A11,XBOOLE_0:def 5;
  end;
  then
A13: E /\ great_dom(|.f.|, 0.) c= E \ eq_dom(f, 0.);
A14: |.f.| is E-measurable by A2,A3,MESFUNC2:27;
A15: for n be Element of NAT ex Z be Element of S st P[n,Z]
  proof
    let n be Element of NAT;
    take E /\ great_eq_dom(|.f.|, (1/(n+1)));
    thus thesis by A14,A4,MESFUNC1:27;
  end;
  consider F be sequence of S such that
A16: for n be Element of NAT holds P[n,F.n] from FUNCT_2:sch 3(A15);
A17: for n be Element of NAT holds F.n in S & M.(F.n) <+infty
  proof
    let n be Element of NAT;
    set d = (1/(n+1));
    set En=F.n;
    set g= (|.f.|)|En;
A18: g is nonnegative by MESFUNC5:15;
    set z = (1/(n+1));
A19: (|.f.|)|E=|.f.| by A4,RELAT_1:69;
A20: F.n = E /\ great_eq_dom(|.f.| ,(1/(n+1))) by A16;
    then
A21: dom g = En by A4,RELAT_1:62,XBOOLE_1:17;
    dom |.f.| /\ En = E /\ En by A2,MESFUNC1:def 10;
    then
A22: dom |.f.| /\ En = En by A20,XBOOLE_1:17,28;
    |.f.| is En-measurable by A14,A20,MESFUNC1:30,XBOOLE_1:17;
    then
A23: g is En-measurable by A22,MESFUNC5:42;
    then
A24: integral+(M,g) =Integral(M,g) by A21,MESFUNC5:15,88;
    |.f.| is_integrable_on M by A1,MESFUNC5:100;
    then
A25: Integral(M,|.f.|) < +infty by MESFUNC5:96;
A26: z* M.En / z = M.En by XXREAL_3:88;
    F.n c= E by A20,XBOOLE_1:17;
    then
A27: Integral(M,g) <= Integral(M,|.f.|) by A2,A3,A4,A19,MESFUNC2:27,MESFUNC5:93
;
    d is R_eal by XXREAL_0:def 1; then
    consider nf be PartFunc of X,ExtREAL such that
A28: nf is_simple_func_in S and
A29: dom nf = En and
A30: for x be object st x in En holds nf.x=d by MESFUNC5:41;
    for x be object st x in dom nf holds nf.x >= 0 by A29,A30;
    then
A31: nf is nonnegative by SUPINF_2:52;
    then
A32: Integral(M,nf) = integral'(M,nf) by A28,MESFUNC5:89;
A33: F.n c= great_eq_dom(|.f.|, (1/(n+1))) by A20,XBOOLE_1:17;
A34: for x be Element of X st x in dom nf holds nf.x <= g.x
    proof
      let x be Element of X;
      assume
A35:  x in dom nf;
      then
A36:  (1/(n+1)) <= |.f.| .x by A33,A29,MESFUNC1:def 14;
      g.x = |.f.| .x by A21,A29,A35,FUNCT_1:47;
      hence thesis by A29,A30,A35,A36;
    end;
    nf is En-measurable by A28,MESFUNC2:34;
    then integral+(M,nf) <= integral+(M,g) by A21,A23,A18,A29,A31,A34,
MESFUNC5:85;
    then
A37: integral+(M,nf) <= Integral(M,|.f.|) by A24,A27,XXREAL_0:2;
A38: +infty / z = +infty by XXREAL_3:83;
    integral+(M,nf) = Integral(M,nf) by A28,A31,MESFUNC5:89;
    then integral+(M,nf) = (1/(n+1)) * M.(En) by A29,A30,A32,MESFUNC5:104;
    then (1/(n+1)) * M.En < +infty by A25,A37,XXREAL_0:2;
    hence thesis by A26,A38,XXREAL_3:80;
  end;
  take F;
  for n be Element of NAT holds F.n = E /\ great_eq_dom(|.f.|, (0+1/(
  n+1))) by A16;
  then E /\ great_dom(|.f.|, 0) = union rng F by MESFUNC1:22;
  hence thesis by A2,A16,A13,A8,A17,XBOOLE_0:def 10;
end;
