
theorem Th8:
  for M be non empty MetrSpace
    st TopSpaceMetr M is countably_compact holds
      M is sequentially_compact
  proof
    let M be non empty MetrSpace;
    assume
A1: TopSpaceMetr M is countably_compact;
A2: TopSpaceMetr M is T_2 by PCOMPS_1:34;
A3: for X be Subset of M st X is infinite
        ex x be Element of M
          st for r be Real st 0 < r holds Ball(x,r) meets X \ {x}
    proof
      let X be Subset of M;
      assume
      A4: X is infinite;
      reconsider A = X as Subset of TopSpaceMetr M;
      Der A is non empty by A1,A2,A4,COMPL_SP:28; then
      consider z be object such that
      A5: z in Der A;
      A6: z is_an_accumulation_point_of A by A5,TOPGEN_1:16;
      reconsider z as Point of TopSpaceMetr M by A5;
      reconsider x=z as Element of M;
      take x;
      thus for r be Real st 0 < r
           holds Ball(x,r) meets X \{x} by A6,Th7;
    end;
    for x be sequence of M st rng x c= [#]M
    ex xN be sequence of M
      st (ex N be increasing sequence of NAT st xN = x * N)
       & xN is convergent & lim xN in [#]M
    proof
      let x be sequence of M such that
      rng x c= [#]M;
      per cases;
      suppose
        rng x is finite; then
        consider z be Element of the carrier of M such that
        A7: x"{z} c= NAT & x"{z} is infinite by LM1;
        consider N be increasing sequence of NAT such that
        A8: rng N c=x"{z} by A7,LM2;
        set xN = x * N;
        take xN;
        A9: for n be Nat holds xN.n = z
        proof
          let n be Nat;
          N.n in rng N by FUNCT_2:4,ORDINAL1:def 12; then
          x.(N.n) in {z} by A8,FUNCT_2:38; then
          x.(N.n) = z by TARSKI:def 1;
          hence xN.n = z by FUNCT_2:15,ORDINAL1:def 12;
        end;
        now
          let r be Real;
          assume
          A10: 0 < r;
          reconsider n = 0 as Nat;
          take n;
          thus for m be Nat st n <= m holds dist(xN.m,z) < r
          proof
            let m be Nat;
            assume n <= m;
            dist(xN.m,z) = dist(z,z) by A9
                        .= 0 by METRIC_1:1;
            hence dist(xN.m,z) < r by A10;
          end;
        end;
        hence thesis;
      end;
      suppose rng x is infinite; then
        consider z be Element of M such that
        A12: for r be Real st 0 < r
          holds Ball(z,r) meets (rng x) \ {z} by A3;
        Ball(z,1) meets (rng x) \ {z} by A12; then
        consider w be object such that
   A13: w in Ball(z,1) /\ ((rng x) \ {z}) by XBOOLE_0:def 1;
        reconsider w as Point of M by A13;
        w in (rng x) \ {z} by A13,XBOOLE_0:def 4; then
        w in rng x by XBOOLE_0:def 5; then
        consider N0 be Element of NAT such that
        A14: w = x.N0 by FUNCT_2:113;
        defpred P[Nat,Nat,Nat] means
          $2 < $3 & x.$3 in Ball(z,1/(2+$1));
        A15: for n be Nat for ix be Element of NAT
             ex iy be Element of NAT st P[n,ix,iy]
        proof
          let n be Nat,ix be Element of NAT;
          assume
     A16: not ex iy be Element of NAT st P[n,ix,iy];
     A17: Ball(z,1/(2+n)) /\ ((rng x) \ {z})
                c= Ball(z,1/(2+n)) by XBOOLE_1:17;
          for g be object st g in Ball(z,1/(2+n)) /\ ((rng x) \{z})
          holds g in x.:(Segm (ix+1))
          proof
            let g be object;
            assume
       A18: g in Ball(z,1/(2+n)) /\ ((rng x) \{z}); then
            g in Ball(z,1/(2+n)) & g in ((rng x) \{z})
                by XBOOLE_0:def 4; then
            g in rng x by XBOOLE_0:def 5; then
            consider iy be Element of NAT such that
       A19: g = x.iy by FUNCT_2:113;
            iy <= ix by A16,A17,A18,A19; then
            iy < ix +1 by NAT_1:13; then
            iy in Segm(ix+1) by NAT_1:44;
            hence g in x.:Segm(ix+1) by A19,FUNCT_2:35;
          end; then
          Ball(z,1/(2+n)) /\ ((rng x) \{z})
            c= x.:(Segm (ix+1)) by TARSKI:def 3;
          hence contradiction by A12,LM3;
        end;
        consider N be sequence of NAT such that
   A20: N.0 = N0 & for n be Nat holds P[n,N.n,N.(n+1)]
           from RECDEF_1:sch 2(A15);
        N is increasing by A20; then
        reconsider N as increasing sequence of NAT;
        defpred Q[Nat] means x.(N.$1) in Ball(z,1/(1+$1));
   A21: Q[0] by A13,A14,A20,XBOOLE_0:def 4;
   A22: for k be Nat st Q[k] holds Q[k+1]
        proof
          let k be Nat;
          assume Q[k];
          N.k < N.(k+1) & x.(N.(k+1)) in Ball(z,1/(2+k)) by A20;
          hence thesis;
        end;
        A23: for i be Nat holds Q[i] from NAT_1:sch 2(A21,A22);
        now
          let r be Real;
          assume
          A24: 0 < r;
          consider n be Nat such that
          A25: r " < n by SEQ_4:3;
          A26: 1 / n  < 1 / (r ") by A24,A25,XREAL_1:76;
          A27: 0 < n by A24,A25;
          take n;
          thus for m be Nat st n <= m holds dist((x*N).m,z) < r
          proof
            let m be Nat;
            assume n <= m; then
            n+0 < m+1 by XREAL_1:8; then
            A28: 1/(1+m) <= 1/n by A27,XREAL_1:118;
            x.(N.m) in Ball(z,1/(1+m)) by A23; then
            A29: dist(x.(N.m),z) < 1/n by A28,METRIC_1:11,XXREAL_0:2;
            x.(N.m) = (x*N).m by FUNCT_2:15,ORDINAL1:def 12;
            hence dist((x*N).m,z) < r by A26,A29,XXREAL_0:2;
          end;
        end; then
        A30: (x*N) is convergent;
        lim (x*N) in [#]M;
        hence thesis by A30;
      end;
    end; then
    [#]M is sequentially_compact;
    hence M is sequentially_compact;
  end;
