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 Th20:
  FX is locally_finite implies Cl union FX = union clf FX
proof
  set UFX = Cl(union FX), UCFX = union(clf FX);
  assume
A1: FX is locally_finite;
  for x st x in UFX holds x in UCFX
  proof
    let x;
    consider W being Subset of T such that
A2: x in W & W is open and
A3: { V : V in FX & V meets W } is finite by A1;
    set HX = { V : V in FX & V meets W };
    reconsider HX as Subset-Family of T by Th8,TOPS_2:2;
A4: Cl(union HX) = union(clf HX) by A3,Th16;
    set FHX = FX\HX;
A5: not x in Cl(union (FHX))
    proof
      assume
A6:   x in Cl union (FHX);
      reconsider FHX as set;
      for Z be set st Z in FHX holds Z misses W
      proof
        let Z be set;
        assume
A7:     Z in FHX;
        then reconsider Z as Subset of T;
        Z in FX & not Z in HX by A7,XBOOLE_0:def 5;
        hence thesis;
      end;
      then (union FHX) misses W by ZFMISC_1:80;
      hence thesis by A2,A6,TOPS_1:12;
    end;
    HX \/ (FX \ HX) = HX \/ FX by XBOOLE_1:39
      .= FX by Th8,XBOOLE_1:12;
    then
A8: Cl(union FX) = Cl(union HX \/ union (FX \ HX)) by ZFMISC_1:78
      .= (Cl union HX) \/ Cl(union (FX \ HX)) by PRE_TOPC:20;
    clf HX c= clf FX by Th8,Th14;
    then
A9: union(clf HX) c= union(clf FX) by ZFMISC_1:77;
    assume x in UFX;
    then x in Cl(union HX) by A5,A8,XBOOLE_0:def 3;
    hence thesis by A4,A9;
  end;
  then
A10: UFX c= UCFX;
  for x st x in UCFX holds x in UFX
  proof
    let x;
    assume x in UCFX;
    then consider X be set such that
A11: x in X and
A12: X in clf FX by TARSKI:def 4;
    reconsider X as Subset of T by A12;
    consider Y such that
A13: X = Cl Y and
A14: Y in FX by A12,Def2;
    for A being Subset of T st A is open & x in A holds (union FX) meets A
    proof
      let A be Subset of T;
      assume
A15:  A is open & x in A;
      ex y st y in (union FX) /\ A
      proof
        Y meets A by A11,A13,A15,TOPS_1:12;
        then consider z be object such that
A16:    z in Y /\ A by XBOOLE_0:4;
        z in Y by A16,XBOOLE_0:def 4;
        then
A17:    z in union FX by A14,TARSKI:def 4;
        take z;
        z in A by A16,XBOOLE_0:def 4;
        hence thesis by A17,XBOOLE_0:def 4;
      end;
      hence thesis by XBOOLE_0:4;
    end;
    hence thesis by TOPS_1:12;
  end;
  then UCFX c= UFX;
  hence thesis by A10,XBOOLE_0:def 10;
end;
