reserve X for non empty set;
reserve e for set;
reserve x for Element of X;
reserve f,g for PartFunc of X,ExtREAL;
reserve S for SigmaField of X;
reserve F for Function of RAT,S;
reserve p,q for Rational;
reserve r for Real;
reserve n,m for Nat;
reserve A,B for Element of S;

theorem Th30:
  for F being Function st F is Finite_Sep_Sequence of S holds
  ex G being Sep_Sequence of S st union rng F = union rng G &
  (for n st n in dom F holds F.n = G.n) &
  for m st not m in dom F holds G.m = {}
proof
  let F be Function;
  defpred P[object,object] means
  ($1 in dom F implies F.$1 = $2) & (not $1 in dom F implies $2 = {});
  assume
A1: F is Finite_Sep_Sequence of S;
A2: for x1 being object st x1 in NAT
ex y1 being object st y1 in S & P[x1,y1]
  proof
    let x1 be object;
    assume x1 in NAT;
    then reconsider x1 as Element of NAT;
    per cases;
    suppose
A3:   x1 in dom F;
then A4:   F.x1 in rng F by FUNCT_1:def 3;
A5:   rng F c= S by A1,FINSEQ_1:def 4;
      take F.x1;
      thus thesis by A3,A4,A5;
    end;
    suppose
A6:   not x1 in dom F;
      take {};
      thus thesis by A6,PROB_1:4;
    end;
  end;
  consider G being sequence of S such that
A7: for x1 being object st x1 in NAT holds P[x1,G.x1] from FUNCT_2:sch 1(A2);
 for n,m being object st n <> m holds G.n misses G.m
  proof
    let n,m be object;
    assume
A8: n <> m;
    per cases;
    suppose
A9:  n in NAT & m in NAT;
  now per cases;
        suppose
      n in dom F & m in dom F;
then       G.n = F.n & G.m = F.m by A7,A9;
          hence thesis by A1,A8,PROB_2:def 2;
        end;
        suppose
A10:      not n in dom F or not m in dom F;
      now per cases by A10;
            suppose
          not n in dom F;
then           G.n = {} by A7,A9;
              hence thesis;
            end;
            suppose
          not m in dom F;
then           G.m = {} by A7,A9;
              hence thesis;
            end;
          end;
          hence thesis;
        end;
      end;
      hence thesis;
    end;
    suppose
  not (n in NAT & m in NAT);
then   not n in dom G or not m in dom G;
then   G.n = {} or G.m = {} by FUNCT_1:def 2;
      hence thesis;
    end;
  end;
  then reconsider G as Sep_Sequence of S by PROB_2:def 2;
  take G;
 for x1 being object st x1 in union rng F holds x1 in union rng G
  proof
    let x1 be object;
    assume x1 in union rng F;
    then consider Y being set such that
A11: x1 in Y and
A12: Y in rng F by TARSKI:def 4;
    consider k being object such that
A13: k in dom F and
A14: Y = F.k by A12,FUNCT_1:def 3;
 dom F c= NAT by A1,RELAT_1:def 18;
    then reconsider k as Element of NAT by A13;
A15: F.k = G.k by A7,A13;
 G.k in rng G by FUNCT_2:4;
    hence thesis by A11,A14,A15,TARSKI:def 4;
  end;
then A16: union rng F c= union rng G;
 for x1 being object st x1 in union rng G holds x1 in union rng F
  proof
    let x1 be object;
    assume x1 in union rng G;
    then consider Y being set such that
A17: x1 in Y and
A18: Y in rng G by TARSKI:def 4;
    consider k being object such that
A19: k in dom G and
A20: Y = G.k by A18,FUNCT_1:def 3;
    reconsider k as Element of NAT by A19;
A21: k in dom F by A7,A17,A20;
A22: F.k = G.k by A7,A17,A20;
 F.k in rng F by A21,FUNCT_1:def 3;
    hence thesis by A17,A20,A22,TARSKI:def 4;
  end;
then  union rng G c= union rng F;
  hence union rng F = union rng G by A16;
  hereby
    let n;
 n in NAT by ORDINAL1:def 12;
    hence n in dom F implies F.n = G.n by A7;
  end;
  let m;
 m in NAT by ORDINAL1:def 12;
  hence thesis by A7;
end;
