
theorem Th4:
  for X be non empty set, S be SigmaField of X, f be PartFunc of X,
ExtREAL, M be sigma_Measure of S st f is_simple_func_in S & dom f <> {} &
  f is nonnegative 
 ex F be Finite_Sep_Sequence of S,
a,x be FinSequence of ExtREAL st F,a are_Re-presentation_of f & dom x = dom F &
  (for n be Nat st n in dom x holds x.n=a.n*(M*F).n) & integral(M,f)=Sum(x)
proof
  let X be non empty set, S be SigmaField of X, f be PartFunc of X,ExtREAL, M
  be sigma_Measure of S;
  assume that
A1: f is_simple_func_in S and
A2: dom f <> {} & f is nonnegative;
  consider F be Finite_Sep_Sequence of S, a be FinSequence of ExtREAL such
  that
A3: F,a are_Re-presentation_of f by A1,MESFUNC3:12;
  ex x be FinSequence of ExtREAL st dom x = dom F & for n be Nat st n in
  dom x holds x.n =a.n*(M*F).n
  proof
    deffunc Q(Nat) = a.$1*(M*F).$1;
    consider x be FinSequence of ExtREAL such that
A4: len x = len F & for k be Nat st k in dom x holds x.k=Q(k) from
    FINSEQ_2:sch 1;
    take x;
    dom x = Seg len F by A4,FINSEQ_1:def 3
      .= dom F by FINSEQ_1:def 3;
    hence thesis by A4;
  end;
  then consider x be FinSequence of ExtREAL such that
A5: dom x = dom F & for n be Nat st n in dom x holds x.n=a.n*(M*F).n;
  integral(M,f)=Sum(x) by A1,A2,A3,A5,Th3;
  hence thesis by A3,A5;
end;
