reserve n,k for Nat,
  X for non empty set,
  S for SigmaField of X;

theorem
  for M be sigma_Measure of S,
      f be with_the_same_dom Functional_Sequence of X,ExtREAL,
      g be PartFunc of X,ExtREAL, E be Element of S st
   (dom (f.0) = E & for n be Nat holds f.n is E-measurable) &
   M.E < +infty &
   (for n be Nat holds ex L be Element of S st L c= E &
   M.(E\L) = 0 &
   for x be Element of X st x in L holds |. (f.n).x .| < +infty) &
   ex G be Element of S st G c= E & M.(E\G) = 0 &
   (for x be Element of X st x in E holds
   f#x is convergent_to_finite_number) & dom g = E &
   (for x be Element of X st x in G holds g.x = lim (f#x)) holds
   for e be Real st 0 < e ex F be Element of S st
   F c= E & M.(E\F) <= e & for p be Real st 0 < p ex N be Nat st
   for n be Nat st N < n holds
   for x be Element of X st x in F holds |. (f.n).x - g.x .| < p
proof
  let M be sigma_Measure of S,
      f be with_the_same_dom Functional_Sequence of X,ExtREAL,
      g be PartFunc of X,ExtREAL, E be Element of S such that
A1: dom(f.0) = E and
A2: for n be Nat holds f.n is E-measurable and
A3: M.E < +infty and
A4: for n be Nat holds ex L be Element of S st L c= E & M.(E\
  L) = 0 & for x be Element of X st x in L holds |. (f.n).x .| < +infty and
A5: ex G be Element of S st G c= E & M.(E\G) = 0 & (for x be Element of
X st x in E holds (f#x) is convergent_to_finite_number) & dom g = E & for x be
  Element of X st x in G holds g.x = lim (f#x);
  defpred P[Element of NAT,set] means $2 c= E & M.(E\$2) = 0 & for x be
  Element of X st x in ($2) holds |. (f.$1).x .| < +infty;
A6: for n be Element of NAT ex Z be Element of S st P[n,Z] by A4;
  consider LN be sequence of S such that
A7: for n be Element of NAT holds P[n,LN.n] from FUNCT_2:sch 3(A6);
  rng LN is N_Sub_set_fam of X by MEASURE1:23;
  then rng LN is N_Measure_fam of S by MEASURE2:def 1;
  then reconsider MRLN= meet(rng LN) as Element of S by MEASURE2:2;
  let e0 be Real;
  assume
A8: 0 < e0;
  set e=e0/2;
  consider G be Element of S such that
A9: G c= E and
A10: M.(E\G) = 0 and
A11: for x be Element of X st x in E holds f#x is
  convergent_to_finite_number and
A12: dom g = E and
A13: for x be Element of X st x in G holds g.x = lim (f#x) by A5;
  MRLN /\ G is Element of S;
  then reconsider L = (meet rng LN) /\ G as Element of S;
  set gL = g|L;
A14: L c= G by XBOOLE_1:17;
  then M.L <= M.E by A9,MEASURE1:31,XBOOLE_1:1; then
A15: M.L < +infty by A3,XXREAL_0:2;
  dom gL = dom g /\ L by RELAT_1:61; then
A16: dom gL = L by A9,A12,A14,XBOOLE_1:1,28;
  deffunc FNL(Nat) = (f.$1)|L;
  consider fL be Functional_Sequence of X,ExtREAL such that
A17: for n be Nat holds fL.n=FNL(n) from SEQFUNC:sch 1;
  for n,m be Nat holds dom (fL.n) = dom (fL.m)
  proof
    let n,m be Nat;
    fL.m = (f.m)|L by A17; then
A18: dom (fL.m) = dom(f.m) /\ L by RELAT_1:61;
    fL.n = (f.n)|L by A17;
    then dom (fL.n) = dom(f.n) /\ L by RELAT_1:61;
    hence thesis by A18,Def2;
  end;
  then reconsider fL as with_the_same_dom Functional_Sequence of X,ExtREAL by
Def2;
A19: L c= E by A9,A14;
A20: for x be Element of X st x in L holds fL#x is
  convergent_to_finite_number & gL.x = lim (fL#x)
  proof
    let x be Element of X;
A21: dom (fL#x)= NAT by FUNCT_2:def 1;
A22: dom (f#x)=NAT by FUNCT_2:def 1;
    assume
A23: x in L;
A24: for y be object st y in NAT holds (fL#x).y = (f#x).y
    proof
      let y be object;
      assume y in NAT;
      then reconsider n = y as Element of NAT;
      ((f.n)|L).x = (f.n).x by A23,FUNCT_1:49; then
A25:  (fL.n).x = (f.n).x by A17;
      (f.n).x = (f#x).n by MESFUNC5:def 13;
      hence thesis by A25,MESFUNC5:def 13;
    end; then
A26: fL#x = f#x by FUNCT_2:12;
    f#x is convergent_to_finite_number by A11,A19,A23;
    hence fL#x is convergent_to_finite_number by A21,A22,A24,FUNCT_1:2;
    L c= G by XBOOLE_1:17;
    then g.x = lim (f#x) by A13,A23;
    hence thesis by A23,A26,FUNCT_1:49;
  end;
  defpred R[Element of NAT,set] means $2 c= L & M.($2) < (e(#)(1/2)GeoSeq).$1
  & ex Np be Element of NAT st for k be Element of NAT st Np < k holds for x be
  Element of X st x in L\$2 holds |. (fL.k).x - gL.x .| < ((1/2)GeoSeq).$1;
A27: for n be Nat holds dom (fL.n) = L & fL.n is L-measurable
  & fL.n is real-valued
  proof
    let n be Nat;
    reconsider n9=n as Element of NAT by ORDINAL1:def 12;
A28: fL.n = (f.n)|L by A17; then
A29: dom (fL.n) = dom(f.n) /\ L by RELAT_1:61;
    then dom (fL.n9) = E /\ L by A1,Def2;
    hence
A30: dom (fL.n) = L by A9,A14,XBOOLE_1:1,28;
    f.n is L-measurable by A2,A19,MESFUNC1:30;
    hence fL.n is L-measurable by A28,A29,A30,MESFUNC5:42;
    for x be Element of X st x in dom (fL.n) holds |. (fL.n).x .| < +infty
    proof
      let x be Element of X;
      dom LN = NAT by FUNCT_2:def 1;
      then
A31:  LN.n9 in rng LN by FUNCT_1:3;
      assume
A32:  x in dom (fL.n);
      then x in meet(rng LN) by A30,XBOOLE_0:def 4;
      then x in LN.n by A31,SETFAM_1:def 1;
      then |. (f.n9).x .| < +infty by A7;
      hence thesis by A28,A32,FUNCT_1:47;
    end;
    hence thesis by MESFUNC2:def 1;
  end; then
A33: dom (fL.0) = L;
A34: for p be Nat ex Hp be Element of S, Np be Nat st
  Hp c= L & M.(Hp) < (e(#) (1/2) GeoSeq).p & for k be Nat st Np < k
  holds for x be Element of X st x in L\Hp holds |. (fL.k).x - gL.x .| < ((1/2)
  GeoSeq).p
  proof
    let p be Nat;
    reconsider p9=p as Element of NAT by ORDINAL1:def 12;
A35: (e(#)(1/2) GeoSeq).p = e*((1/2)GeoSeq).p9 by SEQ_1:9;
    0 < (jj/2)|^p by PREPOWER:6;
    then
A36: 0 < ((1/2)GeoSeq).p9 by PREPOWER:def 1;
    0 < (jj/2)|^p by PREPOWER:6;
    then
A37: 0 < ((1/2)GeoSeq).p9 by PREPOWER:def 1;
    e0/2 = e0 qua ExtReal/2;
    then 0 < e by A8;
    then 0 < (e(#)(1/2) GeoSeq).p by A36,A35,XREAL_1:129;
    hence thesis by A15,A27,A33,A16,A20,A37,Th28;
  end;
A38: for n be Element of NAT ex Z be Element of S st R[n,Z]
  proof
    let n be Element of NAT;
    reconsider n9=n as Nat;
    consider Z be Element of S, Np be Nat such that
A39: Z c= L and
A40: M.Z < (e(#)(1/2)GeoSeq).n9 and
A41: for k be Nat st Np < k holds for x be Element of X st
    x in L\Z holds |. (fL.k).x - gL.x .| < ((1/2)GeoSeq).n9 by A34;
    reconsider Np9=Np as Element of NAT by ORDINAL1:def 12;
    for k be Element of NAT st Np9 < k holds for x be Element of X st x
    in L\Z holds |. (fL.k).x - gL.x .| < ((1/2)GeoSeq).n9 by A41;
    hence thesis by A39,A40;
  end;
  consider HP be sequence of S such that
A42: for p be Element of NAT holds R[p,HP.p] from FUNCT_2:sch 3(A38);
  defpred U[Element of NAT,set] means $2= M.(HP.$1);
A43: for n be Element of NAT ex y be Element of REAL st U[n,y]
  proof
    let n be Element of NAT;
A44: -infty < M.(HP.n) by MEASURE1:def 2;
    M.(HP.n) < (e(#)(1/2)GeoSeq).n by A42;
    then M.(HP.n) in REAL by A44,XXREAL_0:48;
    hence thesis;
  end;
  consider me be Real_Sequence such that
A45: for p be Element of NAT holds U[p,me.p] from FUNCT_2:sch 3(A43);
A46: for p be Element of NAT holds me.p <= (e(#)(1/2) GeoSeq).p
  proof
    let p be Element of NAT;
    me.p = M.(HP.p) by A45;
    hence thesis by A42;
  end;
A47: for p be Nat holds 0 <=me.p & me.p <= (e(#)(1/2)GeoSeq).p
  proof
    let p be Nat;
A48:  p in NAT by ORDINAL1:def 12;
    0. <= M.(HP.p) by MEASURE1:def 2;
    hence thesis by A45,A46,A48;
  end;
  then for p be Nat holds 0 <=me.p & me.p <= (e(#)(1/2)GeoSeq).p; then
A49: me is nonnegative;
  deffunc ELN(Element of NAT) = E \ (LN.$1);
  consider ELN be sequence of S such that
A50: for n be Element of NAT holds ELN.n=ELN(n) from FUNCT_2:sch 4;
  rng ELN is N_Sub_set_fam of X by MEASURE1:23;
  then reconsider RELN= rng ELN as N_Measure_fam of S by MEASURE2:def 1;
A51: E /\ (union rng HP) c= (union rng HP) by XBOOLE_1:17;
  for A being set st A in RELN holds A is measure_zero of M
  proof
    let A being set;
    assume A in RELN;
    then consider n be object such that
A52: n in NAT and
A53: A=ELN.n by FUNCT_2:11;
    reconsider n as Element of NAT by A52;
    M.(ELN.n) = M.(E \(LN.n)) by A50
      .=0 by A7;
    hence thesis by A53,MEASURE1:def 7;
  end;
  then union RELN is measure_zero of M by MEASURE2:14; then
A54: M.(union RELN) = 0. by MEASURE1:def 7;
  now
    let x be object;
    assume
A55: x in E \ (meet rng LN); then
A56: x in E by XBOOLE_0:def 5;
    not x in meet rng LN by A55,XBOOLE_0:def 5;
    then consider Y be set such that
A57: Y in rng LN and
A58: not x in Y by SETFAM_1:def 1;
    consider m be object such that
A59: m in dom LN and
A60: Y = LN.m by A57,FUNCT_1:def 3;
    reconsider m as Element of NAT by A59;
    dom ELN = NAT by FUNCT_2:def 1;
    then
A61: ELN.m in rng ELN by FUNCT_1:3;
    ELN.m = E \ (LN.m) by A50;
    then x in ELN.m by A56,A58,A60,XBOOLE_0:def 5;
    hence x in union RELN by A61,TARSKI:def 4;
  end;
  then
A62: E \ (meet rng LN) c= union RELN;
  now
    let x be object;
    assume x in union RELN;
    then consider Y be set such that
A63: x in Y and
A64: Y in RELN by TARSKI:def 4;
    consider m be object such that
A65: m in dom ELN and
A66: ELN.m = Y by A64,FUNCT_1:def 3;
    reconsider m as Element of NAT by A65;
    dom LN = NAT by FUNCT_2:def 1;
    then
A67: LN.m in rng LN by FUNCT_1:3;
A68: Y = E \ (LN.m) by A50,A66;
    then not x in LN.m by A63,XBOOLE_0:def 5;
    then
A69: not x in meet(rng LN) by A67,SETFAM_1:def 1;
    x in E by A63,A68,XBOOLE_0:def 5;
    hence x in E \ (meet rng LN) by A69,XBOOLE_0:def 5;
  end;
  then union RELN c= E \ (meet rng LN);
  then
A70: union RELN = E\(meet rng LN) by A62,XBOOLE_0:def 10;
  rng HP is N_Sub_set_fam of X by MEASURE1:23;
  then
A71: rng HP is N_Measure_fam of S by MEASURE2:def 1;
  reconsider MRHP= union rng HP as Element of S by MEASURE1:24;
  L \ MRHP is Element of S;
  then consider F be Element of S such that
A72: F= L \ (union rng HP);
  E\L = (E\(meet rng LN)) \/ (E\G) by XBOOLE_1:54;
  then M.(E\L) <= M.(union RELN) + M.(E\G) by A70,MEASURE1:33;
  then M.(E\L) <= 0. by A10,A54;
  then
A73: M.(E\L) = 0 by MEASURE1:def 2;
  reconsider MRHP= union rng HP as Element of S by MEASURE1:24;
A74: M.(E\L \/ MRHP) <= M.(E\L) + M.MRHP by MEASURE1:33;
  E\F = (E\L) \/ E /\ (union rng HP) by A72,XBOOLE_1:52;
  then M.(E\F) <= M.(E\L \/ MRHP) by A51,MEASURE1:31,XBOOLE_1:9;
  then M.(E\F) <= M.(E\L) + M.MRHP by A74,XXREAL_0:2;
  then
A75: M.(E\F) <= M.MRHP by A73,XXREAL_3:4;
  dom me =NAT by FUNCT_2:def 1;
  then
A76: dom me = dom (M*HP) by FUNCT_2:def 1;
A77: for x be object st x in dom me holds me.x = (M*HP).x
  proof
    let x be object;
    assume
A78: x in dom me;
    then (M*HP).x= M.(HP.x) by A76,FUNCT_1:12;
    hence thesis by A45,A78;
  end;
A79: |.1/2 qua Complex.| = 1/2 by ABSVALUE:def 1;
  then
A80: (1/2)GeoSeq is summable by SERIES_1:24;
  then
A81: e(#)(1/2) GeoSeq is summable by SERIES_1:10;
  then me is summable by A47,SERIES_1:20;
  then Sum me = SUM(M*HP) by A49,A76,A77,FUNCT_1:2,PROB_4:12;
  then
A82: M.(union rng HP) <= Sum me by A71,MEASURE2:11;
A83: for q be Real st 0 < q ex p be Element of NAT st ((1/2) GeoSeq)
  .p < q
  proof
    let q be Real;
    assume
A84: 0 < q;
A85: lim (1/2)GeoSeq = 0 by A80,SERIES_1:4;
    (1/2) GeoSeq is convergent by A80,SERIES_1:4;
    then consider p be Nat such that
A86: for n be Nat st p <=n holds |.((1/2) GeoSeq).n - 0 qua Complex .|
    < q by A84,A85,SEQ_2:def 7;
    take p;
    0 < (jj/2)|^p by PREPOWER:6;
    then
A87: 0 <= ((1/2) GeoSeq).p by PREPOWER:def 1;
A88:  p in NAT by ORDINAL1:def 12;
    |.((1/2) GeoSeq).p- 0 qua Complex .| < q by A86;
    hence thesis by A87,ABSVALUE:def 1,A88;
  end;
A89: for x be Element of X st x in F holds for p be Element of NAT holds x
  in L \ HP.p
  proof
    let x be Element of X;
    assume
A90: x in F;
    let p be Element of NAT;
    dom HP = NAT by FUNCT_2:def 1;
    then HP.p in rng HP by FUNCT_1:3;
    then L\(union rng HP) c= L\HP.p by XBOOLE_1:34,ZFMISC_1:74;
    hence thesis by A72,A90;
  end;
A91: for q be Real st 0 < q ex N be Nat st for n be
Nat st N < n holds for x be Element of X st x in F holds |. (f.n).x
  - g.x .| < q
  proof
    let q be Real;
    assume 0 < q;
    then consider p be Element of NAT such that
A92: ((1/2) GeoSeq).p < q by A83;
    consider Np be Element of NAT such that
A93: for k be Element of NAT st Np < k holds for x be Element of X st
    x in L\HP.p holds |. (fL.k).x - gL.x .| < ((1/2)GeoSeq).p by A42;
    take Np;
    hereby
      let n be Nat;
      reconsider n9 =n as Element of NAT by ORDINAL1:def 12;
      assume
A94:  Np < n;
      hereby
        let x be Element of X;
A95:    fL.n= (f.n)|L by A17;
        assume
A96:    x in F;
        then |. (fL.n9).x - gL.x .| < ((1/2)GeoSeq).p by A89,A93,A94;
        then
A97:    |. (fL.n).x - gL.x .| < q by A92,XXREAL_0:2;
A98:    F c= L by A72,XBOOLE_1:36;
        then gL.x = g.x by A96,FUNCT_1:49;
        hence |. (f.n).x - g.x .| < q by A96,A97,A95,A98,FUNCT_1:49;
      end;
    end;
  end;
  Sum((1/2)GeoSeq) = 1/(1-(1/2)) by A79,SERIES_1:24;
  then
A99: Sum(e(#)(1/2)GeoSeq) = e* 2 by A80,SERIES_1:10;
  Sum me <= Sum(e(#)(1/2)GeoSeq) by A81,A47,SERIES_1:20;
  then M.MRHP <= 2*e by A82,A99,XXREAL_0:2;
  then
A100: M.(E \ F) <= e0 by A75,XXREAL_0:2;
  F c= L by A72,XBOOLE_1:36;
  hence thesis by A19,A100,A91,XBOOLE_1:1;
end;
