
theorem Th11:
for X be non empty set, S be SigmaField of X, f be Function of X,ExtREAL,
 E be Finite_Sep_Sequence of S, F be summable FinSequence of Funcs(X,ExtREAL)
 st dom E = dom F & dom f = union rng E
  & (for n be Nat st n in dom F ex r be Real st F/.n = r(#)chi(E.n,X))
  & f = (Partial_Sums F)/.(len F) holds
  (for x be Element of X, m,n be Nat st
     m in dom F & n in dom F & x in E.m & m <> n holds (F/.n).x = 0) &
  (for x be Element of X, m,n be Nat st
     m in dom F & n in dom F & x in E.m & n < m holds
       ((Partial_Sums F)/.n).x = 0) &
  (for x be Element of X, m,n be Nat st
     m in dom F & n in dom F & x in E.m & n >= m holds
       ((Partial_Sums F)/.n).x = f.x) &
  (for x be Element of X, m be Nat st
     m in dom F & x in E.m holds (F/.m).x = f.x) &
  f is_simple_func_in S
proof
    let X be non empty set, S be SigmaField of X, f be Function of X,ExtREAL,
    E be Finite_Sep_Sequence of S,
    F be summable FinSequence of Funcs(X,ExtREAL);
    assume that
A1:  dom E = dom F and
A2:  dom f = union rng E and
A3:  for n be Nat st n in dom F ex r be Real st F/.n = r(#)chi(E.n,X) and
A4:  f = (Partial_Sums F)/.(len F);

    E <> {} by A2,ZFMISC_1:2; then
    1 <= len E by FINSEQ_1:20; then
    1 <= len F by A1,FINSEQ_3:29; then
A5: len F in dom F by FINSEQ_3:25;

    thus
A6: for x be Element of X, m,n be Nat st
      m in dom F & n in dom F & x in E.m & m <> n holds (F/.n).x = 0
    proof
     let x be Element of X, m,n be Nat;
     assume A7: m in dom F & n in dom F & x in E.m; then
     consider rn be Real such that
A8:   F/.n = rn(#)chi(E.n,X) by A3;

     dom(F/.n) = X by FUNCT_2:def 1; then
A9:  (F/.n).x = rn * chi(E.n,X).x by A8,MESFUNC1:def 6;
     thus m <> n implies (F/.n).x = 0
     proof
      assume m <> n; then
      not x in E.n by A7,XBOOLE_0:3,PROB_2:def 2; then
      chi(E.n,X).x = 0 by FUNCT_3:def 3;
      hence (F/.n).x = 0 by A9;
     end;
    end;

    thus
A10:for x be Element of X, m,n be Nat st
     m in dom F & n in dom F & x in E.m & n < m holds
       ((Partial_Sums F)/.n).x = 0
    proof
     let x be Element of X, m,n be Nat;
     assume A11: m in dom F & n in dom F & x in E.m & n < m;
     defpred P[Nat] means
      $1 in dom F & $1 < m implies ((Partial_Sums F)/.$1).x = 0;

A12: P[0] by FINSEQ_3:25;

A13: for k be Nat st P[k] holds P[k+1]
     proof
      let k be Nat;
      assume A14: P[k];
      assume A15: k+1 in dom F & k+1 < m; then
A16:  (F/.(k+1)).x = 0 by A6,A11;
      per cases;
      suppose A17: k+1 = 1;
       ((Partial_Sums F)/.(k+1)) = (Partial_Sums F).(k+1) by A15,Th10
       .= F.(k+1) by A17,MEASUR11:def 11
       .= F/.(k+1) by A15,PARTFUN1:def 6;
       hence ((Partial_Sums F)/.(k+1)).x = 0 by A6,A11,A15;
      end;
      suppose A18: k+1 <> 1;
       1 <= k+1 <= len F by A15,FINSEQ_3:25; then
       1 < k+1 <= len F by A18,XXREAL_0:1; then
       1 <= k < len F by NAT_1:13; then
       ((Partial_Sums F)/.(k+1)).x = 0 + (F/.(k+1)).x
          by A14,A15,NAT_1:13,FINSEQ_3:25,Th10;
       hence ((Partial_Sums F)/.(k+1)).x = 0 by A16;
      end;
     end;
     for k be Nat holds P[k] from NAT_1:sch 2(A12,A13);
     hence ((Partial_Sums F)/.n).x = 0 by A11;
    end;

    thus
A17:for x be Element of X, m,n be Nat st
     m in dom F & n in dom F & x in E.m & n >= m holds
       ((Partial_Sums F)/.n).x = f.x
    proof
     let x be Element of X, m,n be Nat;
     assume A18: m in dom F & n in dom F & x in E.m & n >= m; then
A24: 1 <= m by FINSEQ_3:25;
     defpred P[Nat] means
      $1 in dom F & $1 >= m implies ((Partial_Sums F)/.$1).x = (F/.m).x;

A19: P[0] by FINSEQ_3:25;
A20: for k be Nat st P[k] holds P[k+1]
     proof
      let k be Nat;
      assume A21: P[k];
      assume A22: k+1 in dom F & k+1 >= m;
      per cases;
      suppose A23: k+1 = 1;
       ((Partial_Sums F)/.(k+1)) = (Partial_Sums F).(k+1) by A22,Th10
       .= F.(k+1) by A23,MEASUR11:def 11
       .= F/.(k+1) by A22,PARTFUN1:def 6;
       hence ((Partial_Sums F)/.(k+1)).x = (F/.m).x by A22,A23,A24,XXREAL_0:1;
      end;
      suppose A25: k+1 <> 1;
       1 <= k+1 <= len F by A22,FINSEQ_3:25; then
       1 < k+1 <= len F by A25,XXREAL_0:1; then
A26:   1 <= k < len F by NAT_1:13; then
A27:   k in dom F by FINSEQ_3:25;
       per cases;
       suppose A28: k+1 = m; then
         k < m by NAT_1:13; then
         ((Partial_Sums F)/.k).x = 0 by A10,A18,A27; then
         ((Partial_Sums F)/.(k+1)).x = 0 + (F/.(k+1)).x by A26,Th10;
         hence ((Partial_Sums F)/.(k+1)).x = (F/.m).x by A28,XXREAL_3:4;
       end;
       suppose A29: k+1 <> m; then
        m < k+1 by A22,XXREAL_0:1; then
        ((Partial_Sums F)/.(k+1)).x
         = (F/.m).x + (F/.(k+1)).x by A21,A26,FINSEQ_3:25,NAT_1:13,Th10
        .= (F/.m).x + 0 by A6,A18,A22,A29;
        hence ((Partial_Sums F)/.(k+1)).x = (F/.m).x by XXREAL_3:4;
       end;
      end;
     end;

A30: for k be Nat holds P[k] from NAT_1:sch 2(A19,A20); then
     ((Partial_Sums F)/.n).x = (F/.m).x by A18;
     hence ((Partial_Sums F)/.n).x = f.x by A4,A5,A18,A30,FINSEQ_3:25;
    end;

    thus
A31:for x be Element of X, m be Nat st
      m in dom F & x in E.m holds (F/.m).x = f.x
    proof
     let x be Element of X, m be Nat;
     assume A32: m in dom F & x in E.m; then
A33: 1 <= m <= len F by FINSEQ_3:25;
A34: ((Partial_Sums F)/.m).x = f.x by A17,A32;

     per cases;
     suppose m = 1; then
      (Partial_Sums F).m = F.m by MEASUR11:def 11; then
      (Partial_Sums F)/.m = F.m by A32,Th10;
      hence (F/.m).x = f.x by A32,A34,PARTFUN1:def 6;
     end;
     suppose m <> 1; then
A35:  m > 1 by A33,XXREAL_0:1;

      reconsider m1 = m-1 as Nat by A33;
A36:  m = m1 + 1; then
A37:  1 <= m1 < len F by A33,A35,NAT_1:13; then
      m1 in dom F & m1 < m by A36,NAT_1:19,FINSEQ_3:25; then
      ((Partial_Sums F)/.m1).x = 0 by A10,A32; then
      f.x = 0 + (F/.(m1+1)).x by A34,A37,Th10;
      hence (F/.m).x = f.x by XXREAL_3:4;
     end;
    end;

A38:for x be Element of X st x in dom f holds |. f.x .| < +infty
    proof
     let x be Element of X;
     assume x in dom f; then
     consider A be set such that
A39:  x in A & A in rng E by A2,TARSKI:def 4;
     consider k be object such that
A40:  k in dom E & A = E.k by A39,FUNCT_1:def 3;
     reconsider k as Nat by A40;

     consider r be Real such that
A41:  F/.k = r(#)chi(E.k,X) by A1,A3,A40;
     dom chi(E.k,X) = X by FUNCT_2:def 1; then
     x in dom chi(E.k,X); then
A42: x in dom (r(#)chi(E.k,X)) by MESFUNC1:def 6;
A43: chi(E.k,X).x = 1 by A39,A40,FUNCT_3:def 3;

     f.x = (r(#)chi(E.k,X)).x by A31,A39,A1,A40,A41; then
     f.x = r * chi(E.k,X).x by A42,MESFUNC1:def 6;
     hence |. f.x .| < +infty by A43,EXTREAL1:41,XREAL_0:def 1;
    end;

    for n be Nat, x,y be Element of X st
     n in dom E & x in E.n & y in E.n holds f.x = f.y
    proof
     let n be Nat, x,y be Element of X;
     assume A44: n in dom E & x in E.n & y in E.n; then
     consider r be Real such that
A45:  F/.n = r(#)chi(E.n,X) by A3,A1;
     dom chi(E.n,X) = X by FUNCT_2:def 1; then
     x in dom chi(E.n,X) & y in dom chi(E.n,X); then
A46: x in dom(r(#)chi(E.n,X)) & y in dom(r(#)chi(E.n,X)) by MESFUNC1:def 6;

A47: chi(E.n,X).x = 1 & chi(E.n,X).y = 1 by A44,FUNCT_3:def 3;
     (F/.n).x = r * chi(E.n,X).x & (F/.n).y = r * chi(E.n,X).y
       by A45,A46,MESFUNC1:def 6; then
     (F/.n).x = r & (F/.n).y = r by A47,XXREAL_3:81; then
     f.x = r & f.y = r by A1,A31,A44;
     hence thesis;
    end;
    hence f is_simple_func_in S by A2,A38,MESFUNC2:def 1,def 4;
end;
