reserve PM for MetrStruct;
reserve x,y for Element of PM;
reserve r,p,q,s,t for Real;
reserve T for TopSpace;
reserve A for Subset of T;
reserve T for non empty TopSpace;
reserve x for Point of T;
reserve Z,X,V,W,Y,Q for Subset of T;
reserve FX for Subset-Family of T;
reserve a for set;
reserve x,y for Point of T;
reserve A,B for Subset of T;
reserve FX,GX for Subset-Family of T;

theorem Th23:
  T is paracompact & B is closed & (for x st x in B ex V,W being
Subset of T st V is open & W is open & A c= V & x in W & V misses W) implies ex
  Y,Z being Subset of T st Y is open & Z is open & A c=Y & B c= Z & Y misses Z
proof
  assume that
A1: T is paracompact and
A2: B is closed and
A3: for x st x in B ex V,W being Subset of T st V is open & W is open &
  A c= V & x in W & V misses W;
  defpred P[set] means $1=B` or ex V,W being Subset of T, x st x in B & $1 = W
  & V is open & W is open & A c= V & x in W & V misses W;
  consider GX such that
A4: for X being Subset of T holds X in GX iff P[X] from SUBSET_1:sch 3;
  now
    let x;
    assume x in [#](T);
    then
A5: x in B \/ B` by PRE_TOPC:2;
    now
      per cases by A5,XBOOLE_0:def 3;
      suppose
A6:     x in B;
        ex X st x in X & X in GX
        proof
          consider V,W being Subset of T such that
A7:       V is open & W is open & A c= V and
A8:       x in W and
A9:       V misses W by A3,A6;
          take X = W;
          thus x in X by A8;
          thus thesis by A4,A6,A7,A8,A9;
        end;
        hence x in union GX by TARSKI:def 4;
      end;
      suppose
A10:    x in B`;
        ex X st x in X & X in GX
        proof
          take X=B`;
          thus x in X by A10;
          thus thesis by A4;
        end;
        hence x in union GX by TARSKI:def 4;
      end;
    end;
    hence x in union GX;
  end;
  then [#](T) c= union GX;
  then [#](T) = union GX by XBOOLE_0:def 10;
  then
A11: GX is Cover of T by SETFAM_1:45;
  for X being Subset of T st X in GX holds X is open
  proof
    let X be Subset of T;
    assume
A12: X in GX;
    now
      per cases by A4,A12;
      suppose
        X = B`;
        hence thesis by A2;
      end;
      suppose
        ex V,W being Subset of T, y st y in B & X = W & V is open & W
        is open & A c= V & y in W & V misses W;
        hence thesis;
      end;
    end;
    hence thesis;
  end;
  then GX is open by TOPS_2:def 1;
  then consider FX such that
A13: FX is open and
A14: FX is Cover of T and
A15: FX is_finer_than GX and
A16: FX is locally_finite by A1,A11;
  set HX = { W : W in FX & W meets B};
A17: HX c= FX by Th8;
  reconsider HX as Subset-Family of T by Th8,TOPS_2:2;
  take Y = (union (clf HX))`;
  take Z = union HX;
  union (clf HX) = Cl (union HX) by A16,A17,Th9,Th20;
  hence Y is open;
  thus Z is open by A13,A17,TOPS_2:11,19;
A18: for X st X in HX holds A /\ Cl X = {}
  proof
    let X;
    assume X in HX;
    then
A19: ex W st W = X & W in FX & W meets B;
    then consider Y being set such that
A20: Y in GX and
A21: X c= Y by A15,SETFAM_1:def 2;
    reconsider Y as Subset of T by A20;
    now
      per cases by A4,A20;
      suppose
        Y = B`;
        hence thesis by A19,A21,XBOOLE_1:63,79;
      end;
      suppose
        ex V,W being Subset of T, y st y in B & Y = W & V is open & W
        is open & A c= V & y in W & V misses W;
        then consider V,W being Subset of T, y such that
        y in B and
A22:    Y = W and
A23:    V is open and
        W is open and
A24:    A c= V and
        y in W and
A25:    V misses W;
        V misses X by A21,A22,A25,XBOOLE_1:63;
        then Cl(V /\ X) = Cl({}(T)) by XBOOLE_0:def 7;
        then Cl(V /\ X) = {} by PRE_TOPC:22;
        then Cl(V /\ Cl X) = {} by A23,TOPS_1:14;
        then V /\ (Cl X) = {} by Th2;
        then (Cl X) misses V by XBOOLE_0:def 7;
        then A misses (Cl X) by A24,XBOOLE_1:63;
        hence thesis by XBOOLE_0:def 7;
      end;
    end;
    hence thesis;
  end;
  A misses (union (clf HX))
  proof
    assume A meets (union (clf HX));
    then consider x being object such that
A26: x in A and
A27: x in union clf HX by XBOOLE_0:3;
    reconsider x as Point of T by A26;
    now
      assume x in (union (clf HX));
      then consider X being set such that
A28:  x in X and
A29:  X in (clf HX) by TARSKI:def 4;
      reconsider X as Subset of T by A29;
      ex W st X = Cl W & W in HX by A29,Def2;
      then A /\ X = {} by A18;
      then A misses X by XBOOLE_0:def 7;
      hence not x in A by A28,XBOOLE_0:3;
    end;
    hence thesis by A26,A27;
  end;
  hence A c= Y by SUBSET_1:23;
  now
    let y;
    assume
A30: y in B;
    ex W st y in W & W in HX
    proof
      consider W such that
A31:  y in W and
A32:  W in FX by A14,Th3;
      take W;
      thus y in W by A31;
      W meets B by A30,A31,XBOOLE_0:3;
      hence thesis by A32;
    end;
    hence y in Z by TARSKI:def 4;
  end;
  hence B c= Z;
  Z c= Y` by Th17,SETFAM_1:13;
  hence Y misses Z by SUBSET_1:23;
end;
