
theorem Th72:
  for X be non empty set, S be SigmaField of X, M be sigma_Measure
  of S, f be PartFunc of X,ExtREAL st f is_simple_func_in S & f is nonnegative
  holds integral'(M,f|eq_dom(f,0)) = 0
proof
  let X be non empty set;
  let S be SigmaField of X;
  let M be sigma_Measure of S;
  let f be PartFunc of X,ExtREAL;
  assume that
A1: f is_simple_func_in S and
A2: f is nonnegative;
  set A = dom f;
  set g = f|(A /\ eq_dom(f,0));
  for x be object st x in eq_dom(f,0) holds x in A by MESFUNC1:def 15;
  then eq_dom(f,0) c= A;
  then
A3: f|(A/\eq_dom(f,0)) = f|eq_dom(f,0) by XBOOLE_1:28;
A4: ex G be Finite_Sep_Sequence of S st (dom g = union rng G & for n be Nat,
  x,y be Element of X st n in dom G & x in G.n & y in G.n holds g.x = g.y)
  proof
    consider F be Finite_Sep_Sequence of S such that
A5: dom f = union rng F and
A6: for n be Nat, x,y be Element of X st n in dom F & x in F.n & y in
    F. n holds f.x = f.y by A1,MESFUNC2:def 4;
    deffunc G(Nat) = F.$1 /\ (A/\eq_dom(f,0));
    reconsider A as Element of S by A5,MESFUNC2:31;
    consider G be FinSequence such that
A7: len G = len F & for n be Nat st n in dom G holds G.n = G(n) from
    FINSEQ_1:sch 2;
    f is A-measurable by A1,MESFUNC2:34;
    then A /\ less_dom(f,0) in S by MESFUNC1:def 16;
    then A\(A /\ less_dom(f,0)) in S by PROB_1:6;
    then reconsider A1 = A/\great_eq_dom(f,0.) as Element of S by MESFUNC1:14;
    f is A1-measurable by A1,MESFUNC2:34;
    then (A/\great_eq_dom(f,0))/\less_eq_dom(f,0) in S by
MESFUNC1:28;
    then reconsider A2 = A /\ eq_dom(f,0) as Element of S by MESFUNC1:18;
A8: dom F = Seg len F by FINSEQ_1:def 3;
    dom G = Seg len F by A7,FINSEQ_1:def 3;
    then
A9: for i be Nat st i in dom F holds G.i = F.i /\ A2 by A7,A8;
    dom G = Seg len F by A7,FINSEQ_1:def 3;
    then
A10: dom G = dom F by FINSEQ_1:def 3;
    then reconsider G as Finite_Sep_Sequence of S by A9,Th35;
    take G;
    for i be Nat st i in dom G holds G.i = A2 /\ F.i by A7;
    then
A11: union rng G = A2 /\ dom f by A5,A10,MESFUNC3:6
      .= dom g by RELAT_1:61;
    for i be Nat, x,y be Element of X st i in dom G & x in G.i & y in G.i
    holds g.x = g.y
    proof
      let i be Nat;
      let x,y be Element of X;
      assume that
A12:  i in dom G and
A13:  x in G.i and
A14:  y in G.i;
A15:  G.i = F.i /\ A2 by A7,A12;
      then
A16:  y in F.i by A14,XBOOLE_0:def 4;
A17:  G.i in rng G by A12,FUNCT_1:3;
      then x in dom g by A11,A13,TARSKI:def 4;
      then
A18:  g.x = f.x by FUNCT_1:47;
      y in dom g by A11,A14,A17,TARSKI:def 4;
      then
A19:  g.y = f.y by FUNCT_1:47;
      x in F.i by A13,A15,XBOOLE_0:def 4;
      hence thesis by A6,A10,A12,A16,A18,A19;
    end;
    hence thesis by A11;
  end;
  for x be object st x in dom g holds 0 <= g.x
  proof
    let x be object;
    assume
A21: x in dom g;
    0 <= f.x by A2,SUPINF_2:51;
    hence thesis by A21,FUNCT_1:47;
  end; then
a2: g is nonnegative by SUPINF_2:52;
  f is real-valued by A1,MESFUNC2:def 4;
  then
A22: g is_simple_func_in S by A4,MESFUNC2:def 4;
  now
    consider F be Finite_Sep_Sequence of S, a,x be FinSequence of ExtREAL such
    that
A23: F,a are_Re-presentation_of g and
    a.1 =0 and
    for n be Nat st 2 <= n & n in dom a holds 0 < a.n & a.n < +infty and
A24: dom x = dom F and
A25: for n be Nat st n in dom x holds x.n=a.n*(M*F).n and
A26: integral(M,g)=Sum(x) by a2,A22,MESFUNC3:def 2;
A27: for x be set st x in dom g holds g.x = 0
    proof
      let x be set;
      assume
A28:  x in dom g;
      then x in dom f /\ (A /\ eq_dom(f,0)) by RELAT_1:61;
      then x in A /\ eq_dom(f,0) by XBOOLE_0:def 4;
      then x in eq_dom(f,0) by XBOOLE_0:def 4;
      then 0 = f.x by MESFUNC1:def 15;
      hence thesis by A28,FUNCT_1:47;
    end;
A29: for n be Nat st n in dom F holds a.n = 0 or F.n = {}
    proof
      let n be Nat;
      assume
A30:  n in dom F;
      now
        assume F.n <> {};
        then consider x be object such that
A31:    x in F.n by XBOOLE_0:def 1;
        F.n in rng F by A30,FUNCT_1:3;
        then x in union rng F by A31,TARSKI:def 4;
        then x in dom g by A23,MESFUNC3:def 1;
        then g.x = 0 by A27;
        hence thesis by A23,A30,A31,MESFUNC3:def 1;
      end;
      hence thesis;
    end;
A32: for n be Nat st n in dom x holds x.n = 0
    proof
      let n be Nat;
      assume
A33:  n in dom x;
      per cases by A24,A29,A33;
      suppose
        a.n = 0;
        then a.n*(M*F).n = 0;
        hence thesis by A25,A33;
      end;
      suppose
        F.n = {};
        then M.(F.n) = 0 by VALUED_0:def 19;
        then (M*F).n = 0 by A24,A33,FUNCT_1:13;
        then a.n*(M*F).n = 0;
        hence thesis by A25,A33;
      end;
    end;
A34: Sum x = 0
    proof
      consider sumx be sequence of ExtREAL such that
A35:  Sum x = sumx.(len x) and
A36:  sumx.0 = 0 and
A37:  for i be Nat st i < len x holds sumx.(i+1)=sumx.i +
      x.(i +1) by EXTREAL1:def 2;
      now
        defpred P[Nat] means $1 <= len x implies sumx.$1 = 0;
        assume x <> {};
A38:    for k be Nat st P[k] holds P[k+1]
        proof
          let k be Nat;
          assume
A39:      P[k];
          assume
A40:      k+1 <= len x;
          reconsider k as Element of NAT by ORDINAL1:def 12;
          1 <= k+1 by NAT_1:11;
          then k+1 in Seg(len x) by A40;
          then k+1 in dom x by FINSEQ_1:def 3;
          then
A41:      x.(k+1) = 0 by A32;
          k < len x by A40,NAT_1:13;
          then sumx.(k+1) = sumx.k + x.(k+1) by A37;
          hence thesis by A39,A40,A41,NAT_1:13;
        end;
A42:    P[ 0 ] by A36;
        for i be Nat holds P[i] from NAT_1:sch 2(A42,A38);
        hence thesis by A35;
      end;
      hence thesis by A35,A36,CARD_1:27;
    end;
    assume dom g <> {};
    hence thesis by A3,A26,A34,Def14;
  end;
  hence thesis by A3,Def14;
end;
