reserve X for set;

theorem Th18:
  for S being SigmaField of X, M being sigma_Measure of S, D being
  non empty Subset-Family of X st (for A being set holds (A in D iff ex B being
set st B in S & ex C being thin of M st A = B \/ C)) holds D is SigmaField of X
proof
  let S be SigmaField of X, M be sigma_Measure of S, D be non empty
  Subset-Family of X;
  assume
A1: for A being set holds A in D iff ex B being set st B in S & ex C
  being thin of M st A = B \/ C;
A2: for K being N_Sub_set_fam of X st K c= D holds union K in D
  proof
    let K be N_Sub_set_fam of X;
    consider F being sequence of bool X such that
A3: K = rng F by SUPINF_2:def 8;
    assume
A4: K c= D;
A5: for n being Element of NAT holds F.n in D
    proof
      let n be Element of NAT;
      F.n in K by A3,FUNCT_2:4;
      hence thesis by A4;
    end;
A6: for n being Element of NAT holds ex B being set st B in S & ex C
    being thin of M st F.n = B \/ C
    by A5,A1;
    for n being Element of NAT holds F.n in COM(S,M)
    proof
      let n be Element of NAT;
      ex B being set st B in S & ex C being thin of M st F.n = B \/ C by A6;
      hence thesis by Def3;
    end;
    then
A7: for n being object st n in NAT holds F.n in COM(S,M);
A8: dom F = NAT by FUNCT_2:def 1;
    then reconsider F as sequence of COM(S,M) by A7,FUNCT_2:3;
    consider G being sequence of S such that
A9: for n being Element of NAT holds G.n in MeasPart(F.n) by Th15;
    consider H be sequence of bool X such that
A10: for n being Element of NAT holds H.n = F.n \ G.n by Th16;
A11: for n being Element of NAT holds G.n in S & G.n c= F.n & F.n \ G.n is
    thin of M
    proof
      let n be Element of NAT;
      G.n in MeasPart(F.n) by A9;
      hence thesis by Def4;
    end;
    for n being Element of NAT holds H.n is thin of M
    proof
      let n be Element of NAT;
      F.n \ G.n is thin of M by A11;
      hence thesis by A10;
    end;
    then consider L being sequence of S such that
A12: for n being Element of NAT holds H.n c= L.n & M.(L.n) = 0. by Th17;
    ex B being set st B in S & ex C being thin of M st union K = B \/ C
    proof
      set B = union rng G;
      take B;
A13:  union rng G c= union rng F
      proof
        let x be object;
        assume x in union rng G;
        then consider Z being set such that
A14:    x in Z and
A15:    Z in rng G by TARSKI:def 4;
        dom G = NAT by FUNCT_2:def 1;
        then consider n being object such that
A16:    n in NAT and
A17:    Z = G.n by A15,FUNCT_1:def 3;
        reconsider n as Element of NAT by A16;
        set P = F.n;
A18:    G.n c= P by A11;
        ex P being set st P in rng F & x in P
        proof
          take P;
          thus thesis by A8,A14,A17,A18,FUNCT_1:def 3;
        end;
        hence thesis by TARSKI:def 4;
      end;
      ex C being thin of M st union K = B \/ C
      proof
        for A being set st A in rng L holds A is measure_zero of M
        proof
          let A be set;
          assume
A19:      A in rng L;
          dom L = NAT by FUNCT_2:def 1;
          then
A20:      ex n being object st n in NAT & A = L.n by A19,FUNCT_1:def 3;
          rng L c= S by MEASURE2:def 1;
          then reconsider A as Element of S by A19;
          M.A = 0. by A12,A20;
          hence thesis by MEASURE1:def 7;
        end;
        then union rng L is measure_zero of M by MEASURE2:14;
        then
A21:    M.(union rng L) = 0. by MEASURE1:def 7;
        set C = union K \ B;
A22:    union K = C \/ union rng F /\ union rng G by A3,XBOOLE_1:51
          .= B \/ C by A13,XBOOLE_1:28;
        reconsider C as Subset of X;
A23:    C c= union rng H
        proof
          let x be object;
          assume
A24:      x in C;
          then x in union rng F by A3,XBOOLE_0:def 5;
          then consider Z being set such that
A25:      x in Z and
A26:      Z in rng F by TARSKI:def 4;
          consider n being object such that
A27:      n in NAT and
A28:      Z = F.n by A8,A26,FUNCT_1:def 3;
          reconsider n as Element of NAT by A27;
A29:      not x in union rng G by A24,XBOOLE_0:def 5;
          not x in G.n
          proof
            dom G = NAT by FUNCT_2:def 1;
            then
A30:        G.n in rng G by FUNCT_1:def 3;
            assume x in G.n;
            hence thesis by A29,A30,TARSKI:def 4;
          end;
          then
A31:      x in F.n \ G.n by A25,A28,XBOOLE_0:def 5;
          ex Z being set st x in Z & Z in rng H
          proof
            take H.n;
            dom H = NAT by FUNCT_2:def 1;
            hence thesis by A10,A31,FUNCT_1:def 3;
          end;
          hence thesis by TARSKI:def 4;
        end;
        union rng H c= union rng L
        proof
          let x be object;
          assume x in union rng H;
          then consider Z being set such that
A32:      x in Z and
A33:      Z in rng H by TARSKI:def 4;
          dom H = NAT by FUNCT_2:def 1;
          then consider n being object such that
A34:      n in NAT and
A35:      Z = H.n by A33,FUNCT_1:def 3;
          reconsider n as Element of NAT by A34;
          n in dom L by A34,FUNCT_2:def 1;
          then
A36:      L.n in rng L by FUNCT_1:def 3;
          H.n c= L.n by A12;
          hence thesis by A32,A35,A36,TARSKI:def 4;
        end;
        then C c= union rng L by A23;
        then C is thin of M by A21,Def2;
        then consider C being thin of M such that
A37:    union K = B \/ C by A22;
        take C;
        thus thesis by A37;
      end;
      hence thesis;
    end;
    hence thesis by A1;
  end;
  for A being set holds A in D implies X\A in D
  proof
    let A be set;
    assume
A38: A in D;
    ex Q being set st Q in S & ex W being thin of M st X \ A = Q \/ W
    proof
      consider B being set such that
A39:  B in S and
A40:  ex C being thin of M st A = B \/ C by A1,A38;
      set P = X \ B;
      consider C being thin of M such that
A41:  A = B \/ C by A40;
      consider G being set such that
A42:  G in S and
A43:  C c= G and
A44:  M.G = 0. by Def2;
      set Q = P \ G;
A45:  X \ A = P \ C by A41,XBOOLE_1:41;
A46:  ex W being thin of M st X \ A = Q \/ W
      proof
        set W = P /\ (G \ C);
        W c= P by XBOOLE_1:17;
        then reconsider W as Subset of X by XBOOLE_1:1;
        reconsider W as thin of M by A42,A44,Def2;
        take W;
        thus thesis by A43,A45,XBOOLE_1:117;
      end;
      take Q;
      X \ B in S by A39,MEASURE1:def 1;
      hence thesis by A42,A46,MEASURE1:6;
    end;
    hence thesis by A1;
  end;
  then reconsider
  D9 = D as compl-closed sigma-additive non empty Subset-Family of
  X by A2,MEASURE1:def 1,def 5;
  D9 is SigmaField of X;
  hence thesis;
end;
