let M be non empty Reflexive symmetric triangle MetrStruct ; :: thesis: ( M is totally_bounded iff for r being Real
for A being Subset of M st r > 0 & ( for p, q being Point of M st p <> q & p in A & q in A holds
dist (p,q) >= r ) holds
A is finite )

thus ( M is totally_bounded implies for r being Real
for A being Subset of M st r > 0 & ( for p, q being Point of M st p <> q & p in A & q in A holds
dist (p,q) >= r ) holds
A is finite ) :: thesis: ( ( for r being Real
for A being Subset of M st r > 0 & ( for p, q being Point of M st p <> q & p in A & q in A holds
dist (p,q) >= r ) holds
A is finite ) implies M is totally_bounded )
proof
assume A1: M is totally_bounded ; :: thesis: for r being Real
for A being Subset of M st r > 0 & ( for p, q being Point of M st p <> q & p in A & q in A holds
dist (p,q) >= r ) holds
A is finite

let r be Real; :: thesis: for A being Subset of M st r > 0 & ( for p, q being Point of M st p <> q & p in A & q in A holds
dist (p,q) >= r ) holds
A is finite

let A be Subset of M; :: thesis: ( r > 0 & ( for p, q being Point of M st p <> q & p in A & q in A holds
dist (p,q) >= r ) implies A is finite )

assume that
A2: r > 0 and
A3: for p, q being Point of M st p <> q & p in A & q in A holds
dist (p,q) >= r ; :: thesis: A is finite
r / 2 > 0 by A2, XREAL_1:215;
then consider G being Subset-Family of M such that
A4: G is finite and
A5: the carrier of M = union G and
A6: for C being Subset of M st C in G holds
ex w being Point of M st C = Ball (w,(r / 2)) by A1;
defpred S1[ object , object ] means ex D2 being set st
( D2 = $2 & $1 in D2 & $2 in G );
A7: for x being object st x in A holds
ex y being object st
( y in bool the carrier of M & S1[x,y] )
proof
let x be object ; :: thesis: ( x in A implies ex y being object st
( y in bool the carrier of M & S1[x,y] ) )

assume x in A ; :: thesis: ex y being object st
( y in bool the carrier of M & S1[x,y] )

then consider y being set such that
A8: x in y and
A9: y in G by A5, TARSKI:def 4;
reconsider y = y as Subset of M by A9;
take y ; :: thesis: ( y in bool the carrier of M & S1[x,y] )
thus ( y in bool the carrier of M & S1[x,y] ) by A8, A9; :: thesis: verum
end;
consider F being Function of A,(bool the carrier of M) such that
A10: for x being object st x in A holds
S1[x,F . x] from FUNCT_2:sch 1(A7);
now :: thesis: for x1, x2 being object st x1 in A & x2 in A & F . x1 = F . x2 holds
x1 = x2
let x1, x2 be object ; :: thesis: ( x1 in A & x2 in A & F . x1 = F . x2 implies x1 = x2 )
assume that
A11: x1 in A and
A12: x2 in A and
A13: F . x1 = F . x2 ; :: thesis: x1 = x2
reconsider p1 = x1, p2 = x2 as Point of M by A11, A12;
A14: S1[x1,F . x1] by A10, A11;
then F . x1 in G ;
then consider w being Point of M such that
A15: F . x1 = Ball (w,(r / 2)) by A6;
p1 in Ball (w,(r / 2)) by A15, A14;
then A16: dist (p1,w) < r / 2 by METRIC_1:11;
A17: dist (p1,p2) <= (dist (p1,w)) + (dist (w,p2)) by METRIC_1:4;
S1[x2,F . x2] by A10, A12;
then p2 in Ball (w,(r / 2)) by A13, A15;
then dist (w,p2) < r / 2 by METRIC_1:11;
then (dist (p1,w)) + (dist (w,p2)) < (r / 2) + (r / 2) by A16, XREAL_1:8;
then dist (p1,p2) < (r / 2) + (r / 2) by A17, XXREAL_0:2;
hence x1 = x2 by A3, A11, A12; :: thesis: verum
end;
then A18: F is one-to-one by FUNCT_2:19;
A19: rng F c= G
proof
let x be object ; :: according to TARSKI:def 3 :: thesis: ( not x in rng F or x in G )
assume x in rng F ; :: thesis: x in G
then consider y being object such that
A20: ( y in dom F & x = F . y ) by FUNCT_1:def 3;
S1[y,F . y] by A10, A20;
then consider D2 being set such that
A21: ( D2 = F . y & y in D2 & F . y in G ) ;
thus x in G by A20, A21; :: thesis: verum
end;
dom F = A by FUNCT_2:def 1;
then A, rng F are_equipotent by A18, WELLORD2:def 4;
hence A is finite by A4, A19, CARD_1:38; :: thesis: verum
end;
assume A22: for r being Real
for A being Subset of M st r > 0 & ( for p, q being Point of M st p <> q & p in A & q in A holds
dist (p,q) >= r ) holds
A is finite ; :: thesis: M is totally_bounded
let r be Real; :: according to TBSP_1:def 1 :: thesis: ( r <= 0 or ex b1 being Element of bool (bool the carrier of M) st
( b1 is finite & the carrier of M = union b1 & ( for b2 being Element of bool the carrier of M holds
( not b2 in b1 or ex b3 being Element of the carrier of M st b2 = Ball (b3,r) ) ) ) )

assume A23: r > 0 ; :: thesis: ex b1 being Element of bool (bool the carrier of M) st
( b1 is finite & the carrier of M = union b1 & ( for b2 being Element of bool the carrier of M holds
( not b2 in b1 or ex b3 being Element of the carrier of M st b2 = Ball (b3,r) ) ) )

reconsider r = r as Real ;
consider A being Subset of M such that
A24: for p, q being Point of M st p <> q & p in A & q in A holds
dist (p,q) >= r and
A25: for p being Point of M ex q being Point of M st
( q in A & p in Ball (q,r) ) by A23, Th29;
deffunc H1( Point of M) -> Element of bool the carrier of M = Ball ($1,r);
set BA = { H1(p) where p is Point of M : p in A } ;
A26: A is finite by A22, A23, A24;
A27: { H1(p) where p is Point of M : p in A } is finite from FRAENKEL:sch 21(A26);
{ H1(p) where p is Point of M : p in A } c= bool the carrier of M
proof
let x be object ; :: according to TARSKI:def 3 :: thesis: ( not x in { H1(p) where p is Point of M : p in A } or x in bool the carrier of M )
assume x in { H1(p) where p is Point of M : p in A } ; :: thesis: x in bool the carrier of M
then ex p being Point of M st
( x = H1(p) & p in A ) ;
hence x in bool the carrier of M ; :: thesis: verum
end;
then reconsider BA = { H1(p) where p is Point of M : p in A } as Subset-Family of M ;
take BA ; :: thesis: ( BA is finite & the carrier of M = union BA & ( for b1 being Element of bool the carrier of M holds
( not b1 in BA or ex b2 being Element of the carrier of M st b1 = Ball (b2,r) ) ) )

the carrier of M c= union BA
proof
let x be object ; :: according to TARSKI:def 3 :: thesis: ( not x in the carrier of M or x in union BA )
assume x in the carrier of M ; :: thesis: x in union BA
then reconsider p = x as Point of M ;
consider q being Point of M such that
A28: q in A and
A29: p in H1(q) by A25;
H1(q) in BA by A28;
hence x in union BA by A29, TARSKI:def 4; :: thesis: verum
end;
hence ( BA is finite & union BA = the carrier of M ) by A27, XBOOLE_0:def 10; :: thesis: for b1 being Element of bool the carrier of M holds
( not b1 in BA or ex b2 being Element of the carrier of M st b1 = Ball (b2,r) )

let C be Subset of M; :: thesis: ( not C in BA or ex b1 being Element of the carrier of M st C = Ball (b1,r) )
assume C in BA ; :: thesis: ex b1 being Element of the carrier of M st C = Ball (b1,r)
then ex p being Point of M st
( C = H1(p) & p in A ) ;
hence ex b1 being Element of the carrier of M st C = Ball (b1,r) ; :: thesis: verum