
theorem
  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 & dom f = {} holds ex F be
  Finite_Sep_Sequence of S, a,x be FinSequence of ExtREAL st F,a
are_Re-presentation_of f & a.1 = 0 & (for n be Nat st 2 <= n & n in dom a holds
0 < a.n & a.n < +infty) & dom x = dom F & (for n be Nat st n in dom x holds x.n
  = a.n*(M*F).n) & Sum x = 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: dom f = {};
  for x be object st x in dom f holds 0 <= f.x by A2; then
  f is nonnegative by SUPINF_2:52;
  then consider
  F be Finite_Sep_Sequence of S, a be FinSequence of ExtREAL such
  that
A3: F,a are_Re-presentation_of f and
A4: a.1 = 0 and
A5: for n be Nat st 2 <= n & n in dom a holds 0 < a.n & a.n < +infty by A1,
MESFUNC3:14;
  deffunc F(Nat) = a.$1*(M*F).$1;
  consider x be FinSequence of ExtREAL such that
A6: len x = len F and
A7: for n be Nat st n in dom x holds x.n = F(n) from FINSEQ_2:sch 1;
A8: dom x = Seg len F by A6,FINSEQ_1:def 3;
  then
A9: dom x = dom F by FINSEQ_1:def 3;
  take F,a,x;
  consider sumx be sequence of ExtREAL such that
A10: Sum x = sumx.(len x) and
A11: sumx.0 = 0 and
A12: for i be Nat st i < len x holds sumx.(i+1)=sumx.i+x.(i+1
  ) by EXTREAL1:def 2;
  defpred P[Nat] means $1 <= len x implies sumx.$1 = 0;
A13: union rng F = {} by A2,A3,MESFUNC3:def 1;
A14: for n be Nat st n in dom F holds F.n = {}
  proof
    let n be Nat;
    assume n in dom F;
    then
A15: F.n in rng F by FUNCT_1:3;
    assume F.n <> {};
    then ex v be object st v in F.n by XBOOLE_0:def 1;
    hence contradiction by A13,A15,TARSKI:def 4;
  end;
A16: for i be Nat st P[i] holds P[i+1]
  proof
    let i be Nat;
    assume
A17: P[i];
    assume
A18: i+1 <= len x;
    reconsider i as Element of NAT by ORDINAL1:def 12;
    i < len x by A18,NAT_1:13;
    then
A19: sumx.(i+1) = sumx.i + x.(i+1) by A12;
    1 <= i+1 by NAT_1:11;
    then
A20: i+1 in dom x by A18,FINSEQ_3:25;
    then F.(i+1) = {} by A9,A14;
    then M.(F.(i+1)) = 0 by VALUED_0:def 19;
    then
A21: (M*F).(i+1) = 0 by A9,A20,FUNCT_1:13;
    x.(i+1) = a.(i+1)*((M*F).(i+1)) by A7,A20
      .= 0 by A21;
    hence thesis by A17,A18,A19,NAT_1:13;
  end;
A22: P[ 0 ] by A11;
  for i be Nat holds P[i] from NAT_1:sch 2(A22,A16);
  hence thesis by A3,A4,A5,A7,A8,A10,FINSEQ_1:def 3;
end;
