reserve i,n,m for Nat,
  x,y,X,Y for set,
  r,s for Real;

theorem Th32:
  for M be non empty MetrSpace st M is totally_bounded holds
  TopSpaceMetr M is second-countable
proof
  let M be non empty MetrSpace such that
A1: M is totally_bounded;
  set T=TopSpaceMetr M;
  defpred F[object,object] means
   for i st i=$1 for G be Subset-Family of T st $2=G
holds G is finite & the carrier of M = union G & for C be Subset of M st C in G
  ex w be Point of M st C = Ball(w,1/(i+1));
A2: for x being object st x in NAT
ex y being object st y in bool bool(the carrier of T) & F[x,y]
  proof
    let x be object;
    assume x in NAT;
    then reconsider i=x as Nat;
    1/(i+1)>0 by XREAL_1:139;
    then consider G be Subset-Family of T such that
A3: G is finite and
A4: the carrier of M = union G and
A5: for C be Subset of M st C in G ex w be Point of M st C=Ball(w,1/(i
    +1 )) by A1;
    take G;
    thus thesis by A3,A4,A5;
  end;
  consider f be sequence of bool bool(the carrier of T) such that
A6: for x being object st x in NAT holds F[x,f.x] from FUNCT_2:sch 1(A2);
  set U = Union f;
A7: dom f=NAT by FUNCT_2:def 1;
A8: for A be Subset of T st A is open for p be Point of T st p in A ex a be
  Subset of T st a in U & p in a & a c= A
  proof
    let A be Subset of T such that
A9: A is open;
    let p be Point of T such that
A10: p in A;
    reconsider p9=p as Point of M;
    consider r be Real such that
A11: r>0 and
A12: Ball(p9,r) c= A by A9,A10,TOPMETR:15;
    reconsider r as Real;
    consider n be Nat such that
A13: n>0 and
A14: 1/n<r/2 by A11,UNIFORM1:1,XREAL_1:215;
A15: 1/n+1/n<r/2+r/2 by A14,XREAL_1:8;
    reconsider n1=n-1 as Element of NAT by A13,NAT_1:20;
    reconsider fn=f.n1 as Subset-Family of T;
    the carrier of M = union fn by A6;
    then consider x be set such that
A16: p in x and
A17: x in fn by TARSKI:def 4;
    reconsider x as Subset of M by A17;
    consider w be Point of M such that
A18: x=Ball(w,1/(n1+1)) by A6,A17;
    reconsider B=Ball(w,1/n) as Subset of T;
    take B;
    f.n1 in rng f by A7,FUNCT_1:def 3;
    then B in union rng f by A17,A18,TARSKI:def 4;
    hence B in U & p in B by A16,A18,CARD_3:def 4;
    let q be object such that
A19: q in B;
    reconsider q9=q as Point of M by A19;
A20: dist(q9,w)<1/n by A19,METRIC_1:11;
    dist(w,p9)<1/(n1+1) by A16,A18,METRIC_1:11;
    then
A21: dist(q9,w)+dist(w,p9)<1/n+1/n by A20,XREAL_1:8;
    dist(q9,p9)<=dist(q9,w)+dist(w,p9) by METRIC_1:4;
    then dist(q9,p9)<1/n+1/n by A21,XXREAL_0:2;
    then dist(q9,p9)<r/2+r/2 by A15,XXREAL_0:2;
    then q in Ball(p9,r) by METRIC_1:11;
    hence thesis by A12;
  end;
  set CB=the set of all card B where B is Basis of T ;
  U c= the topology of T
  proof
    let x be object;
    assume x in U;
    then x in union rng f by CARD_3:def 4;
    then consider y such that
A22: x in y and
A23: y in rng f by TARSKI:def 4;
    reconsider X=x as Subset of T by A22,A23;
    consider z be object such that
A24: z in dom f and
A25: f.z=y by A23,FUNCT_1:def 3;
    reconsider z as Element of NAT by A24;
    f.z=y by A25;
    then ex w be Point of M st X=Ball(w,1/(z+1)) by A6,A22;
    hence thesis by PCOMPS_1:29;
  end;
  then U is Basis of T by A8,YELLOW_9:32;
  then
A26: card U in CB;
  now
    let x;
    assume x in dom f;
    then reconsider i=x as Element of NAT;
    reconsider fx=f.i as Subset-Family of T;
    fx is finite by A6;
    hence f.x is countable by CARD_4:1;
  end;
  then U is countable by A7,CARD_4:2,11;
  then
A27: card U c= omega by CARD_3:def 14;
  weight T = meet CB by WAYBEL23:def 5;
  then weight T c= card U by A26,SETFAM_1:3;
  then weight T c= omega by A27;
  hence thesis by WAYBEL23:def 6;
end;
