let M be non empty MetrSpace; :: thesis: ( M is compact iff for F being Subset-Family of M st F is being_ball-family & F is Cover of M holds
ex G being Subset-Family of M st
( G c= F & G is Cover of M & G is finite ) )

thus ( M is compact implies for F being Subset-Family of M st F is being_ball-family & F is Cover of M holds
ex G being Subset-Family of M st
( G c= F & G is Cover of M & G is finite ) ) :: thesis: ( ( for F being Subset-Family of M st F is being_ball-family & F is Cover of M holds
ex G being Subset-Family of M st
( G c= F & G is Cover of M & G is finite ) ) implies M is compact )
proof
assume M is compact ; :: thesis: for F being Subset-Family of M st F is being_ball-family & F is Cover of M holds
ex G being Subset-Family of M st
( G c= F & G is Cover of M & G is finite )

then A1: TopSpaceMetr M is compact by Def6;
let F be Subset-Family of M; :: thesis: ( F is being_ball-family & F is Cover of M implies ex G being Subset-Family of M st
( G c= F & G is Cover of M & G is finite ) )

assume that
A2: F is being_ball-family and
A3: F is Cover of M ; :: thesis: ex G being Subset-Family of M st
( G c= F & G is Cover of M & G is finite )

set TM = TopSpaceMetr M;
reconsider TF = F as Subset-Family of (TopSpaceMetr M) by Th16;
the carrier of M c= union F by A3, SETFAM_1:def 12;
then the carrier of (TopSpaceMetr M) c= union TF by Th16;
then A4: TF is Cover of (TopSpaceMetr M) by Th1;
TF is open
proof
let P be Subset of (TopSpaceMetr M); :: according to TOPS_2:def 1 :: thesis: ( not P in TF or P is open )
assume A5: P in TF ; :: thesis: P is open
reconsider P' = P as Subset of M by Th16;
ex p being Point of M ex r being Real st P' = Ball p,r by A2, A5, Def4;
hence P is open by Th21; :: thesis: verum
end;
then consider TG being Subset-Family of (TopSpaceMetr M) such that
A6: ( TG c= TF & TG is Cover of (TopSpaceMetr M) & TG is finite ) by A1, A4, COMPTS_1:def 3;
reconsider G = TG as Subset-Family of M by Th16;
take G ; :: thesis: ( G c= F & G is Cover of M & G is finite )
the carrier of (TopSpaceMetr M) c= union TG by A6, Th1;
then the carrier of M c= union G by Th16;
hence ( G c= F & G is Cover of M & G is finite ) by A6, SETFAM_1:def 12; :: thesis: verum
end;
thus ( ( for F being Subset-Family of M st F is being_ball-family & F is Cover of M holds
ex G being Subset-Family of M st
( G c= F & G is Cover of M & G is finite ) ) implies M is compact ) :: thesis: verum
proof
assume A7: for F being Subset-Family of M st F is being_ball-family & F is Cover of M holds
ex G being Subset-Family of M st
( G c= F & G is Cover of M & G is finite ) ; :: thesis: M is compact
set TM = TopSpaceMetr M;
now
let F be Subset-Family of (TopSpaceMetr M); :: thesis: ( F is Cover of (TopSpaceMetr M) & F is open implies ex GG being Subset-Family of (TopSpaceMetr M) st
( GG c= F & GG is Cover of (TopSpaceMetr M) & GG is finite ) )

assume that
A8: F is Cover of (TopSpaceMetr M) and
A9: F is open ; :: thesis: ex GG being Subset-Family of (TopSpaceMetr M) st
( GG c= F & GG is Cover of (TopSpaceMetr M) & GG is finite )

set Z = { (Ball p,r) where p is Point of M, r is Real : ex P being Subset of (TopSpaceMetr M) st
( P in F & Ball p,r c= P )
}
;
{ (Ball p,r) where p is Point of M, r is Real : ex P being Subset of (TopSpaceMetr M) st
( P in F & Ball p,r c= P ) } c= bool the carrier of M
proof
let a be set ; :: according to TARSKI:def 3 :: thesis: ( not a in { (Ball p,r) where p is Point of M, r is Real : ex P being Subset of (TopSpaceMetr M) st
( P in F & Ball p,r c= P )
}
or a in bool the carrier of M )

assume a in { (Ball p,r) where p is Point of M, r is Real : ex P being Subset of (TopSpaceMetr M) st
( P in F & Ball p,r c= P )
}
; :: thesis: a in bool the carrier of M
then ex p being Point of M ex r being Real st
( a = Ball p,r & ex P being Subset of (TopSpaceMetr M) st
( P in F & Ball p,r c= P ) ) ;
hence a in bool the carrier of M ; :: thesis: verum
end;
then reconsider Z = { (Ball p,r) where p is Point of M, r is Real : ex P being Subset of (TopSpaceMetr M) st
( P in F & Ball p,r c= P )
}
as Subset-Family of M ;
A10: Z is being_ball-family
proof
let P be set ; :: according to TOPMETR:def 4 :: thesis: ( P in Z implies ex p being Point of M ex r being Real st P = Ball p,r )
assume P in Z ; :: thesis: ex p being Point of M ex r being Real st P = Ball p,r
then ex p being Point of M ex r being Real st
( P = Ball p,r & ex P being Subset of (TopSpaceMetr M) st
( P in F & Ball p,r c= P ) ) ;
hence ex p being Point of M ex r being Real st P = Ball p,r ; :: thesis: verum
end;
the carrier of M c= union Z
proof
let a be set ; :: according to TARSKI:def 3 :: thesis: ( not a in the carrier of M or a in union Z )
assume a in the carrier of M ; :: thesis: a in union Z
then reconsider p = a as Point of M ;
( the carrier of (TopSpaceMetr M) c= union F & the carrier of (TopSpaceMetr M) = the carrier of M ) by A8, Th1, Th16;
then p in union F by TARSKI:def 3;
then consider P being set such that
A11: p in P and
A12: P in F by TARSKI:def 4;
reconsider P = P as Subset of (TopSpaceMetr M) by A12;
P is open by A9, A12, TOPS_2:def 1;
then consider r being real number such that
A13: ( r > 0 & Ball p,r c= P ) by A11, Th22;
reconsider r' = r as Element of REAL by XREAL_0:def 1;
A14: a in Ball p,r by A13, TBSP_1:16;
Ball p,r' in Z by A12, A13;
hence a in union Z by A14, TARSKI:def 4; :: thesis: verum
end;
then Z is Cover of M by SETFAM_1:def 12;
then consider G being Subset-Family of M such that
A15: G c= Z and
A16: G is Cover of M and
A17: G is finite by A7, A10;
reconsider F' = F as non empty Subset-Family of (TopSpaceMetr M) by A8, TOPS_2:5;
defpred S1[ set , set ] means $1 c= $2;
A18: for a being set st a in G holds
ex u being set st
( u in F' & S1[a,u] )
proof
let a be set ; :: thesis: ( a in G implies ex u being set st
( u in F' & S1[a,u] ) )

assume a in G ; :: thesis: ex u being set st
( u in F' & S1[a,u] )

then a in Z by A15;
then consider p being Point of M, r being Real such that
A19: Ball p,r = a and
A20: ex P being Subset of (TopSpaceMetr M) st
( P in F & Ball p,r c= P ) ;
consider P being Subset of (TopSpaceMetr M) such that
A21: ( P in F & Ball p,r c= P ) by A20;
take P ; :: thesis: ( P in F' & S1[a,P] )
thus ( P in F' & S1[a,P] ) by A19, A21; :: thesis: verum
end;
consider f being Function of G,F' such that
A22: for a being set st a in G holds
S1[a,f . a] from FUNCT_2:sch 1(A18);
reconsider GG = rng f as Subset-Family of (TopSpaceMetr M) by TOPS_2:3;
take GG = GG; :: thesis: ( GG c= F & GG is Cover of (TopSpaceMetr M) & GG is finite )
thus GG c= F ; :: thesis: ( GG is Cover of (TopSpaceMetr M) & GG is finite )
the carrier of (TopSpaceMetr M) c= union GG
proof
let a be set ; :: according to TARSKI:def 3 :: thesis: ( not a in the carrier of (TopSpaceMetr M) or a in union GG )
assume A23: a in the carrier of (TopSpaceMetr M) ; :: thesis: a in union GG
( the carrier of (TopSpaceMetr M) = the carrier of M & the carrier of M c= union G ) by A16, Th16, SETFAM_1:def 12;
then consider P being set such that
A24: ( a in P & P in G ) by A23, TARSKI:def 4;
dom f = G by FUNCT_2:def 1;
then ( f . P in GG & P c= f . P ) by A22, A24, FUNCT_1:def 5;
hence a in union GG by A24, TARSKI:def 4; :: thesis: verum
end;
hence GG is Cover of (TopSpaceMetr M) by Th1; :: thesis: GG is finite
dom f = G by FUNCT_2:def 1;
hence GG is finite by A17, FINSET_1:26; :: thesis: verum
end;
then TopSpaceMetr M is compact by COMPTS_1:def 3;
hence M is compact by Def6; :: thesis: verum
end;