reserve x,y for set;
reserve s,s1,s2,s4,r,r1,r2 for Real;
reserve n,m,i,j for Element of NAT;
reserve p for Element of NAT;

theorem Th6:
  for N being non empty MetrSpace, G being Subset-Family of
TopSpaceMetr(N) st G is Cover of TopSpaceMetr(N) & G is open & TopSpaceMetr(N)
is compact ex r st r>0 & for w1,w2 being Element of N st dist(w1,w2)<r holds ex
  Ga being Subset of TopSpaceMetr(N) st w1 in Ga & w2 in Ga & Ga in G
proof
  let N be non empty MetrSpace, G be Subset-Family of TopSpaceMetr(N);
  assume that
A1: G is Cover of TopSpaceMetr(N) and
A2: G is open and
A3: TopSpaceMetr(N) is compact;
  now
    set TM = TopSpaceMetr(N);
    defpred P[object,object] means
(for n being Element of NAT,w1 being Element of N
st n=$1 & w1=$2 ex w2 being Element of N st dist(w1,w2)<1/(n+1) & for Ga being
    Subset of TopSpaceMetr(N) holds not(w1 in Ga & w2 in Ga & Ga in G ) );
A4: TM = TopStruct (# the carrier of N,Family_open_set(N) #) by PCOMPS_1:def 5;
    assume
A5: not ex r st r>0 & for w1,w2 being Element of N st dist(w1,w2)<r
holds ex Ga being Subset of TopSpaceMetr(N) st w1 in Ga & w2 in Ga & Ga in G;
A6: for e being object st e in NAT
ex u being object st u in the carrier of N & P[e,u]
    proof
      let e be object;
      assume e in NAT;
      then reconsider m=e as Element of NAT;
      set r=1/(m+1);
      consider w1,w2 being Element of N such that
A7:   dist(w1,w2)<r & for Ga being Subset of TopSpaceMetr(N) holds not
      (w1 in Ga & w2 in Ga & Ga in G) by A5;
      for n being Element of NAT,w4 being Element of N st n=e & w4=w1 ex
      w5 being Element of N st dist(w4,w5)<1/(n+1) & for Ga being Subset of
      TopSpaceMetr(N) holds not(w4 in Ga & w5 in Ga & Ga in G ) by A7;
      hence thesis;
    end;
    ex f being sequence of the carrier of N st for e being object st e
    in NAT holds P[e,f.e] from FUNCT_2:sch 1(A6);
    then consider f being sequence of the carrier of N such that
A8: for e being object st e in NAT holds for n being Element of NAT,w1
being Element of N st n=e & w1=f.e ex w2 being Element of N st dist(w1,w2)<1/(n
+1) & for Ga being Subset of TopSpaceMetr(N) holds not(w1 in Ga & w2 in Ga & Ga
    in G );
    defpred P[Subset of TopSpaceMetr(N)] means ex p st $1 = {x where x is
    Point of N : ex n st p<=n & x = f.n};
    consider F being Subset-Family of TopSpaceMetr(N) such that
A9: for B being Subset of TopSpaceMetr(N) holds B in F iff P[B] from
    SUBSET_1:sch 3;
    defpred P[set] means ex n st 0<=n & $1 = f.n;
    set B0 = {x where x is Point of N : P[x]};
A10: B0 is Subset of N from DOMAIN_1:sch 7;
    then
A11: B0 in F by A4,A9;
A12: for p holds {x where x is Point of N : ex n st p<=n & x = f.n} <> {}
    proof
      let p be Element of NAT;
      (f.p) in {x where x is Point of N : ex n st p<=n & x = f.n};
      hence thesis;
    end;
    reconsider B0 as Subset of TopSpaceMetr(N) by A4,A10;
    reconsider F as Subset-Family of TopSpaceMetr(N);
    set G1 = clf F;
A13: Cl B0 in G1 by A11,PCOMPS_1:def 2;
    G1 <> {} & for Gd being set st Gd <> {} & Gd c= G1 & Gd is finite
    holds meet Gd <> {}
    proof
      thus G1<>{} by A13;
      let H be set such that
A14:  H <> {} and
A15:  H c= G1 and
A16:  H is finite;
      reconsider H as Subset-Family of TM by A15,TOPS_2:2;
      H is c=-linear
      proof
        let B,C be set;
        assume that
A17:    B in H and
A18:    C in H;
        reconsider B as Subset of TM by A17;
        consider V being Subset of TM such that
A19:    B = Cl V and
A20:    V in F by A15,A17,PCOMPS_1:def 2;
        consider p such that
A21:    V = {x where x is Point of N : ex n st p<=n & x = f.n} by A9,A20;
        reconsider C as Subset of TM by A18;
        consider W being Subset of TM such that
A22:    C = Cl W and
A23:    W in F by A15,A18,PCOMPS_1:def 2;
        consider q being Element of NAT such that
A24:    W = {x where x is Point of N : ex n st q<=n & x = f.n} by A9,A23;
        now
          per cases;
          case
A25:        q<=p;
            thus V c= W
            proof
              let y be object;
              assume y in V;
              then consider x being Point of N such that
A26:          y = x and
A27:          ex n st p<=n & x = f.n by A21;
              consider n such that
A28:          p<=n and
A29:          x = f.n by A27;
              q<=n by A25,A28,XXREAL_0:2;
              hence thesis by A24,A26,A29;
            end;
          end;
          case
A30:        p<=q;
            thus W c= V
            proof
              let y be object;
              assume y in W;
              then consider x being Point of N such that
A31:          y = x and
A32:          ex n st q<=n & x = f.n by A24;
              consider n such that
A33:          q<=n and
A34:          x = f.n by A32;
              p<=n by A30,A33,XXREAL_0:2;
              hence thesis by A21,A31,A34;
            end;
          end;
        end;
        then B c= C or C c= B by A19,A22,PRE_TOPC:19;
        hence thesis by XBOOLE_0:def 9;
      end;
      then consider m being set such that
A35:  m in H and
A36:  for C being set st C in H holds m c= C by A14,A16,FINSET_1:11;
A37:  m c= meet H by A14,A36,SETFAM_1:5;
      reconsider m as Subset of TM by A35;
      consider A being Subset of TM such that
A38:  m = Cl A and
A39:  A in F by A15,A35,PCOMPS_1:def 2;
      A <> {} by A9,A12,A39;
      then m <> {} by A38,PRE_TOPC:18,XBOOLE_1:3;
      hence thesis by A37;
    end;
    then G1 is closed & G1 is centered by FINSET_1:def 3,PCOMPS_1:11;
    then meet G1 <> {} by A3,COMPTS_1:4;
    then consider c being Point of TM such that
A40: c in meet G1 by SUBSET_1:4;
    reconsider c as Point of N by A4;
    consider Ge being Subset of TM such that
A41: c in Ge and
A42: Ge in G by A1,PCOMPS_1:3;
    reconsider Ge as Subset of TM;
    Ge is open by A2,A42,TOPS_2:def 1;
    then consider r be Real such that
A43: r>0 and
A44: Ball(c,r) c= Ge by A41,TOPMETR:15;
    reconsider r as Real;
    consider n being Nat such that
A45: n>0 and
A46: 1/n < r/2 by A43,Th1,XREAL_1:215;
    reconsider Q1=Ball(c,r/2) as Subset of TopSpaceMetr(N) by TOPMETR:12;
A47: Q1 is open by TOPMETR:14;
    defpred Q[set] means ex n2 being Element of NAT st n<=n2 & $1 = f.n2;
    reconsider B2 = {x where x is Point of TopSpaceMetr(N) : Q[x]} as Subset
    of TopSpaceMetr(N) from DOMAIN_1:sch 7;
A48: n in NAT by ORDINAL1:def 12;
A49: the carrier of TopSpaceMetr(N) = the carrier of N by TOPMETR:12;
    then B2 in F by A9,A48;
    then Cl B2 in clf F by PCOMPS_1:def 2;
    then
A50: c in Cl B2 by A40,SETFAM_1:def 1;
    c in Q1 by A43,GOBOARD6:1,XREAL_1:215;
    then B2 meets Q1 by A50,A47,TOPS_1:12;
    then consider x being object such that
A51: x in B2 and
A52: x in Q1 by XBOOLE_0:3;
    consider y being Point of N such that
A53: x=y and
A54: ex n2 being Element of NAT st n<=n2 & y=f.n2 by A49,A51;
A55: dist(c,y)<r/2 by A52,A53,METRIC_1:11;
    1/n>=1/(n+1) by A45,NAT_1:11,XREAL_1:85;
    then
A56: 1/(n+1) <r/2 by A46,XXREAL_0:2;
    consider n2 being Element of NAT such that
A57: n<=n2 and
A58: y=f.n2 by A54;
    consider w2 being Element of N such that
A59: dist(y,w2)<1/(n2+1) and
A60: for Ga being Subset of TopSpaceMetr(N) holds not(y in Ga & w2 in
    Ga & Ga in G ) by A8,A58;
    n+1<=n2+1 by A57,XREAL_1:7;
    then 1/(n+1)>=1/(n2+1) by XREAL_1:118;
    then dist(y,w2)<1/(n+1) by A59,XXREAL_0:2;
    then dist(y,w2)<r/2 by A56,XXREAL_0:2;
    then
A61: r/2+dist(y,w2)<r/2+r/2 by XREAL_1:6;
    r/1>r/2 by A43,XREAL_1:76;
    then dist(c,y)<r by A55,XXREAL_0:2;
    then
A62: y in Ball(c,r) by METRIC_1:11;
    dist(c,w2)<=dist(c,y)+dist(y,w2) & dist(c,y)+dist(y,w2)<r/2+dist(y,w2
    ) by A55,METRIC_1:4,XREAL_1:6;
    then dist(c,w2)<r/2+dist(y,w2) by XXREAL_0:2;
    then dist(c,w2)<r/2+r/2 by A61,XXREAL_0:2;
    then w2 in Ball(c,r) by METRIC_1:11;
    hence contradiction by A42,A44,A62,A60;
  end;
  hence thesis;
end;
