 reserve S, T for RealNormSpace;
 reserve F for Subset of Funcs(the carrier of S,the carrier of T);
 reserve S,Z for RealNormSpace;
 reserve T for RealBanachSpace;
 reserve F for Subset of Funcs(the carrier of S,the carrier of T);

theorem Th8:
for Z be RealNormSpace,
      H be non empty Subset of MetricSpaceNorm Z
    holds
         (MetricSpaceNorm Z) | H is totally_bounded
     iff (MetricSpaceNorm Z) | Cl(H) is totally_bounded
proof
let Z be RealNormSpace,
      H be non empty Subset of MetricSpaceNorm Z;
reconsider F=H as non empty Subset of Z;
set K = Cl(H);
set M = MetricSpaceNorm Z;
  consider D be Subset of TopSpaceMetr MetricSpaceNorm Z such that
A1: D = H & Cl(H) = Cl D by Def1;
A2: H c= K by A1,PRE_TOPC:18;
A3: the carrier of (M|H) = H by TOPMETR:def 2;
A4: the carrier of (M|K) = K by TOPMETR:def 2;
A5: Cl(F) = Cl(H) by Th1;
hereby assume A6:
   M | H is totally_bounded;
for r being Real st r > 0 holds
     ex L being Subset-Family of M | K st
        L is finite & the carrier of M | K = union L
   & for C being Subset of M | K st C in L holds
     ex w being Element of M | K  st C = Ball (w,r)
proof
 let r be Real;
 assume A7: r > 0; then
   consider L0 being Subset-Family of M | H such that
   A8: L0 is finite & the carrier of M | H = union L0
   & for C being Subset of M | H st C in L0 holds
     ex w being Element of M | H  st C = Ball (w,r/2) by A6;
defpred P1[object,object]
   means
   ex w be Point of M | H
   st
    $2 = w &
    $1 =Ball(w,r/2);
A9: for D be object st D in L0
     ex w be object st w in the carrier of M | H & P1[D,w]
  proof
    let D be object;
    assume A10: D in L0; then
    reconsider D0=D as Subset of M|H;
    consider w being Element of M|H such that
A11: D0 = Ball (w,r/2) by A8,A10;
    take w;
    thus w in the carrier of M|H & P1[D,w] by A11;
end;
  consider U0 being Function of L0,the carrier of M|H such that
  A12: for D being object
         st D in L0
        holds P1[D,U0.D] from FUNCT_2:sch 1(A9);
A13:for D being object st D in L0 holds
      D= Ball(U0/.D,r/2)
proof
  let D be object;
  assume A14: D in L0; then
A15:ex x0 be Point of M|H st U0.D = x0 &
    D =Ball(x0,r/2) by A12;
  dom U0 = L0 by FUNCT_2:def 1;
  hence D = Ball(U0/.D,r/2) by A15,A14,PARTFUN1:def 6;
end;
defpred P2[object,object] means
   ex x be Point of (M | K) st $1 = x & $2 = Ball(x,r);
A16: for w be object st w in the carrier of (M | H)
      ex B be object st B in bool (the carrier of M | K ) & P2[w,B]
  proof
    let w be object;
    assume w in the carrier of (M | H); then
    reconsider x=w as Point of (M | K) by A2,A3,TOPMETR:def 2;
    Ball (x,r) in bool the carrier of (M | K);
    hence thesis;
end;
  consider B being Function of the carrier of M|H,
      bool the carrier of M|K such that
  A17: for x being object
         st x in the carrier of M|H
        holds P2[x,B.x] from FUNCT_2:sch 1(A16);
A19: dom U0 = L0 by FUNCT_2:def 1;
reconsider L = B.:rng U0 as Subset-Family of (M|K);
take L;
thus L is finite by A8;
the carrier of M | K c= union L
proof
   let z be object;
   assume
   A20: z in the carrier of M | K; then
   consider seq being sequence of Z such that
   A21: rng seq c= F & seq is convergent & lim seq = z by A4,A5,NORMSP_3:6;
  consider N be Nat such that
  A22: for n be Nat st
        N<=n holds ||.seq.n-lim seq.|| < r/2 by NORMSP_1:def 7,A21,A7;
  A23: ||.seq.N-lim seq.|| < r/2 by A22;
  A24: dom seq = NAT & N in NAT by FUNCT_2:def 1,ORDINAL1:def 12; then
  seq.N in H by A21,FUNCT_1:3; then
  consider D be set such that
  A25:  seq.N in D & D in L0 by A8,A3,TARSKI:def 4;
   reconsider y0 = seq.N as Point of (M|H) by A24,A21,FUNCT_1:3,A3;
  A26: D = Ball(U0/.D,r/2) by A13,A25;
  y0 in { y where y is Point of (M|H) : dist(U0/.D,y) < r/2 }
   by METRIC_1:def 14,A25,A26; then
  A27:ex y be Point of (M|H) st y0=y & dist(U0/.D,y) < r/2;
  reconsider y01 =y0 as Point of M;
  reconsider u0d1 =U0/.D as Point of M by TOPMETR:def 1,TARSKI:def 3;
  A28: dist(u0d1,y01) < r/2 by A27,TOPMETR:def 1;
  U0/.D in H by A3; then
  reconsider u0d = U0/.D as Point of Z;
  A29: ||.u0d-seq.N.|| < r/2 by A28,NORMSP_2:def 1;
   u0d-lim seq = u0d-seq.N +seq.N -lim seq by RLVECT_4:1
              .= u0d-seq.N +(seq.N -lim seq) by RLVECT_1:28; then
  A30: ||.u0d-lim seq.|| <= ||.u0d-seq.N.|| + ||.seq.N-lim seq.||
   by NORMSP_1:def 1;
   ||.u0d-seq.N.|| + ||.seq.N-lim seq.||
        < r/2 +r/2 by XREAL_1:8,A29,A23; then
  A31:  ||.u0d-lim seq.|| < r by A30,XXREAL_0:2;
  reconsider w =U0/.D as Point of (M|K) by A2,A3,A4;
  reconsider v =lim seq as Point of (M|K) by A21,A20;
  reconsider v1 = v as Point of M;
 dist(u0d1,v1) < r by A31,NORMSP_2:def 1; then
  dist(w,v) < r by TOPMETR:def 1; then
  v in { y where y is Point of (M|K) : dist(w,y) < r }; then
 A32: v in Ball(w,r) by METRIC_1:def 14;
A33: ex w being Point of M|K st U0/.D=w & B.(U0/.D) = Ball(w,r) by A17;
 U0/.D in rng U0 by PARTFUN2:2,A25,A19; then
 Ball(w,r) in L by A33,FUNCT_2:35;
 hence z in union L by A21,A32,TARSKI:def 4;
end;
hence the carrier of M | K = union L;
thus for C being Subset of M | K st C in L holds
       ex w being Element of M | K  st C = Ball (w,r)
proof
  let C be Subset of M | K;
  assume C in L; then
  consider x being Element of (M|H) such that
A35: x in rng U0 & C=B.x by FUNCT_2:65;
  ex w being Point of M|K st x=w & B.x = Ball(w,r) by A17;
  hence thesis by A35;
end;
end;
hence (MetricSpaceNorm Z) | K is totally_bounded;
end;
assume A37: (MetricSpaceNorm Z) | K is totally_bounded;
thus (MetricSpaceNorm Z) | H is totally_bounded
proof
  let r be Real;
  assume r > 0;
  then consider L0 being Subset-Family of M | K such that
  A38: L0 is finite & the carrier of M | K = union L0 &
      for C being Subset of M | K st C in L0 holds
     ex w being Element of M | K  st C = Ball (w,r/2) by A37;
A39: for x be object
        st x in H holds ex B be Subset of M | K
           st x in B & B in L0
proof
  assume not for x be object
        st x in H holds ex B be Subset of M | K
           st x in B & B in L0; then
  consider x be object such that
  A40: x in H & not (ex B be Subset of M | K st x in B & B in L0 );
  not x in union L0
  proof
    assume x in union L0; then
    consider D be set such that
    A41: x in D & D in L0 by TARSKI:def 4;
    reconsider D as Subset of (M|K) by A41;
    thus contradiction by A41,A40;
  end;
hence contradiction by A2,A40,A4,A38;
end;
set BL = {B where B is Subset of M | K: B in L0 & H /\ B <> {}};
consider x be object such that
   A42: x in H by XBOOLE_0:def 1;
  consider B be Subset of M | K such that
  A43: x in B & B in L0 by A39,A42;
  B /\ H <> {} by A42,A43,XBOOLE_0:def 4; then
  A44:B in BL by A43;
  BL c= L0
proof
  let x be object;
  assume x in BL; then
  ex B be Subset of M | K st B = x & B in L0 & H /\ B <> {};
  hence x in L0;
end; then
reconsider BL as non empty finite set by A44,A38;
defpred P1[object,object] means
    ex w be Point of M | H,B be Subset of M | K st
      B = $1 &
      w in B & B in L0 &
      $2=Ball(w,r);
A45: for D be object st D in BL
     ex w be object st w in bool the carrier of M | H & P1[D,w]
 proof
   let D be object;
   assume D in BL; then
   consider B be Subset of M | K such that
   A46: B = D & B in L0 & H /\ B <> {};
   consider x be object such that
   A47: x in H /\ B by XBOOLE_0:def 1,A46;
   A48: x in H & x in B by XBOOLE_0:def 4,A47;
   reconsider x as Point of (M|H) by A3,XBOOLE_0:def 4,A47;
   set Z =Ball(x,r);
   P1[D,Z] by A46,A48;
   hence thesis;
 end;
 consider U0 being Function of BL,bool the carrier of M|H such that
  A49: for D being object
         st D in BL
        holds P1[D,U0.D] from FUNCT_2:sch 1(A45);
set L = rng U0;
A50: dom U0 = BL by FUNCT_2:def 1;
 reconsider L as Subset-Family of (M|H);
take L;
thus L is finite;
the carrier of M | H c= union L
proof
  let z be object;
   assume A51: z in the carrier of M | H; then
   consider B be Subset of M | K such that
    A52: z in B & B in L0 by A39,A3;
    z in H /\ B by A51,A3,A52,XBOOLE_0:def 4; then
    A53: B in BL by A52; then
    consider w be Point of M | H,D be Subset of M | K such that
A54: D = B & w in D & D in L0 &
      U0.B=Ball(w,r) by A49;
     consider y being Element of M | K such that
A55: D = Ball (y,r/2) by A54,A38;
     reconsider x =z as Point of (M | H) by A51;
     reconsider x1=x,w1=w as Point of M | K by A52,A54;
     reconsider x2=x1,w2=w1 as Point of M by TOPMETR:def 1,TARSKI:def 3;
     x1 in { s where s is Point of (M|K) : dist(y,s) < r/2 }
       by METRIC_1:def 14,A52,A54,A55; then
     A56:ex s be Point of (M|K) st x1=s & dist(y,s) < r/2;
     w1 in { s where s is Point of (M|K) : dist(y,s) < r/2 }
       by METRIC_1:def 14,A54,A55; then
     A57: ex s be Point of (M|K) st w1=s & dist(y,s) < r/2;
     A58:dist(w1,x1) <= dist(w1,y) + dist(y,x1) by METRIC_1:4;
     dist(w1,y) + dist(y,x1) < r/2+r/2 by A57,A56,XREAL_1:8; then
     dist(w1,x1) < r by A58,XXREAL_0:2; then
     dist(w2,x2) < r by TOPMETR:def 1; then
     dist(w,x) < r by TOPMETR:def 1; then
     x in { s where s is Point of (M|H) : dist(w,s) < r }; then
     A59: z in U0.B by A54,METRIC_1:def 14;
     U0.B in rng U0 by A53,A50,FUNCT_1:def 3;
   hence z in union L by A59,TARSKI:def 4;
end;
hence the carrier of M | H = union L;
thus for C being Subset of M | H st C in L holds
       ex w being Element of M | H  st C = Ball (w,r)
proof
  let C be Subset of M | H;
  assume C in L; then
  consider x being object such that
  A61: x in dom U0 & C=U0.x by FUNCT_1:def 3;
  ex w be Point of M | H,B be Subset of M | K st
  B = x & w in B & B in L0 & U0.x=Ball(w,r) by A49,A61;
  hence thesis by A61;
end;
end;
end;
