136 CHAPTER 7. METRIC SPACES AND TOPOLOGICAL SPACES
and so B(p,r) ⊆ B(x,r1). By similar reasoning, B(p,r) ⊆ B(z,r2). This proves the theo-rem.
Let K be a closed set. This means KC ≡ X \K is an open set. Let p be a limit point ofK. If p ∈ KC, then since KC is open, there exists B(p,r)⊆ KC. But this contradicts p beinga limit point because there are no points of K in this ball. Hence all limit points of K mustbe in K.
Suppose next that K contains its limit points. Is KC open? Let p ∈ KC. Then p is nota limit point of K. Therefore, there exists B(p,r) which contains at most finitely manypoints of K. Since p /∈ K, it follows that by making r smaller if necessary, B(p,r) containsno points of K. That is B(p,r)⊆ KC showing KC is open. Therefore, K is closed.
Suppose now that p is a limit point of S. Let x1 ∈ (S\{p})∩B(p,1) . If x1, · · · ,xk havebeen chosen, let
rk+1 ≡min{
d (p,xi) , i = 1, · · · ,k, 1k+1
}.
Let xk+1 ∈ (S\{p})∩B(p,rk+1) . This proves the lemma.
Lemma 7.1.5 If {xn} is a Cauchy sequence in a metric space, X and if some subsequence,{xnk
}converges to x, then {xn} converges to x. Also if a sequence converges, then it is a
Cauchy sequence.
Proof: Note first that nk ≥ k because in a subsequence, the indices, n1,n2, · · · are strictlyincreasing. Let ε > 0 be given and let N be such that for k > N,d
(x,xnk
)< ε/2 and for
m,n≥ N,d (xm,xn)< ε/2. Pick k > n. Then if n > N,
d (xn,x)≤ d(xn,xnk
)+d(xnk ,x
)<
ε
2+
ε
2= ε.
Finally, suppose limn→∞ xn = x. Then there exists N such that if n >N, then d (xn,x)< ε/2.it follows that for m,n > N,
d (xn,xm)≤ d (xn,x)+d (x,xm)<ε
2+
ε
2= ε.
This proves the lemma.A useful idea is the idea of distance from a point to a set.
Definition 7.1.6 Let (X ,d) be a metric space and let S be a nonempty set in X. Then
dist(x,S)≡ inf{d (x,y) : y ∈ S} .
The following lemma is the fundamental result.
Lemma 7.1.7 The function, x→ dist(x,S) is continuous and in fact satisfies
|dist(x,S)−dist(y,S)| ≤ d (x,y) .