# 3.11. Special Topics#

This section covers details on specific functions from the perspective of metric spaces

## 3.11.1. Distance from a Point#

Theorem 3.122 (Distance function is uniformly continuous)

Let $$(X,d)$$ be a metric space. Fix some point $$a \in X$$. Define a function $$f: X \to \RR$$ as:

$f(x) = d(x, a) \Forall x \in X.$

Then, $$f$$ is uniformly continuous on $$X$$.

Proof. Let $$x, y \in X$$. Recall from triangle inequality that:

$|d (x, a) - d(y, a)| \leq d(x,y).$
1. Let $$\epsilon > 0$$.

2. Choose $$\delta = \epsilon$$.

3. Assume $$d(x, y) < \delta$$.

4. Then

$|f(x) - f(y)| = |d (x, a) - d(y, a)| \leq d(x,y) < \delta = \epsilon.$
5. Thus, $$d(x,y) < \delta \implies |f(x) - f(y)| < \epsilon$$.

6. Thus, $$f$$ is uniformly continuous.

## 3.11.2. Distance from a Set#

Recall from Definition 3.5 that the distance between a point $$x \in X$$ and a set $$A \subseteq X$$ is given by:

$d(x, A) = \inf \{ d(x,a) \Forall a \in A \}.$

Proposition 3.32 (Distance from a singleton set)

For every $$x, y \in X$$,

$d(x, \{ y \}) = d(x, y).$

Proof. Let $$A = \{ y \}$$ be a singleton set. Then

$d(x, A) = d(x, \{ y \}) = \inf\{ d(x, y) \} = d(x, y).$

Proposition 3.33 (Distance from a subset)

Let $$\EmptySet \neq A \subseteq B \subseteq X$$. Then, for any $$x \in X$$

$d(x, A) \geq d(x, B).$

Proof. We note that since $$A \subseteq B$$, hence:

$\{ d(x,a) \Forall a \in A \} \subseteq \{ d(x,a) \Forall a \in B \}.$

The infimum over a larger set is smaller. Hence,

$d(x, B) \leq d(x, A).$

Proposition 3.34 (Distance from a containing subset)

Let $$x \in A \subseteq X$$. Then

$d(x, A) = 0.$

Proof. We note that:

$d(x, x) \in \{ d(x,a) \Forall a \in A \}$

since $$x \in A$$.

Thus,

$d(x,A) = d(x, x) = 0.$

Theorem 3.123 (Continuity of set distance function)

Let $$A \subseteq X$$ be nonempty. Then, the function $$f: X \to \RR$$ given by:

$f(x) = d(x, A) = \inf \{ d(x,a) \Forall a \in A \}$

is continuous.

We provided a proof in Example 3.16. We rephrase it here.

Proof. Let $$a \in X$$. We shall show that $$f$$ is continuous at $$a$$.

1. Let $$r > 0$$.

2. Consider the open ball/interval $$V = B(f(a), r)$$ in $$\RR$$.

3. Consider the open ball in $$X$$ given by $$U = B(a, r)$$.

4. Let $$x \in U$$ and let $$y \in A$$.

5. Then, using triangle inequality:

$d(a, y) + d(x, a) \geq d(x, y)$

and

$d(a, x) + d(x, y) \geq d(a, y).$
6. Taking the infimum over $$y \in A$$ in both the inequalities, we get:

$d(a, A) + d(x, a) \geq d(x, A)$

and

$d(x, a) + d(x, A) \geq d(a, A).$
7. Rewriting it further, we get:

$d(x, A) \leq d(a, A) + d(x, a)$

and

$d(a, A) - d(x, a) \leq d(x, A).$
8. Since $$d(a,x) < r$$, hence, we obtain:

$d(a, A) - r < d(x, A) < d(a, A) + r.$
9. Substituting $$f(x) = d(x, A)$$ and $$f(a) = d(a, A)$$,

$f(a) - r < f(x) < f(a) + r.$
10. Thus, $$f(x) \in B(f(a), r) = V$$.

11. In other words, $$f(U) \subseteq V$$.

We have shown that for every $$r > 0$$, there exists $$\delta = r$$ such that $$x \in B(a, \delta)$$ implies $$f(x) \in B(f(a), r)$$. Thus, $$f$$ is continuous at $$a$$.

Theorem 3.124 (Open neighborhoods of a set)

Let $$A \subseteq X$$ be nonempty. Let $$\epsilon > 0$$ and consider the set $$A_{\epsilon}$$ given by

$A_{\epsilon} = \{x \in X \ST d(x, A) < \epsilon \}.$

Then $$A_{\epsilon}$$ is open for every $$\epsilon > 0$$.

Proof. We established in Theorem 3.123 that $$f(x) = d(x, A)$$ is continuous. The set $$A_{\epsilon}$$ is the inverse image of the open interval $$(-\epsilon, \epsilon)$$ in $$\RR$$. Since $$f$$ is continuous, hence the inverse image of an open interval is an open set.

Following is a direct proof.

1. Let $$x \in A_{\epsilon}$$.

2. Then, there is $$y \in A$$ such that $$d(x, y) < \epsilon$$.

3. Let $$\delta > 0$$ be small enough such that $$d(x,y) + \delta < \epsilon$$.

4. Consider the open ball $$B(x, \delta)$$.

5. For all $$z \in B(x, \delta)$$, we have:

$d(z, y) \leq d(z, x) + d(x, y) < \delta + d(x,y) < \epsilon.$
6. Thus, $$d(z, A) < \epsilon$$ since $$y \in A$$.

7. Thus, $$z \in A_{\epsilon}$$.

8. Thus, $$B(x, \delta) \subseteq A_{\epsilon}$$.

9. Thus, $$A_{\epsilon}$$ is open.

Theorem 3.125 (Closure and set distance)

Let $$A \subseteq X$$ be a nonempty set. Then, for any $$x \in X$$, $$d(x, A) = 0$$ if and only if $$x \in \closure A$$.

In other words, the distance of a point from a set is zero if and only if the point is a closure point of the set.

Proof. Let $$x \in \closure A$$.

1. Then either $$x \in A$$ or $$x \in \boundary A$$.

2. If $$x \in A$$, then by Proposition 3.34, $$d(x,A) = 0$$.

3. Now, assume $$x \notin A$$ and $$x \in \boundary A$$.

4. Let $$r > 0$$.

5. Since $$x \in \boundary A$$, hence there exists $$y \in A$$ such that $$d(x, y) < r$$.

6. Therefore,

$d(x, A) = \inf \{d (x, y) \ST y \in A \} < r.$
7. Since this is true for every $$r > 0$$, hence $$d(x, A) = 0$$.

Now assume that $$x \notin \closure A$$.

1. Thus, there exists an open ball $$B(x, r)$$ for some $$r > 0$$ such that $$B(x, r) \cap A = \EmptySet$$.

2. Therefore, for every $$a \in A$$, $$d(x, a) \geq r > 0$$.

3. Therefore,

$d(x, A) = \inf \{ d(x, a) \ST a \in A \} \geq r > 0.$

Corollary 3.4

Let $$A \subseteq X$$ be a nonempty closed set. Then, for any $$x \in X$$, $$d(x, A) = 0$$ if and only if $$x \in A$$.

Proof. A closed set contains all its closure points. Thus, $$d(x, A) = 0$$ if and only if $$x$$ is a closure point of $$A$$ if and only if $$x \in A$$.

Theorem 3.126 (Distance minimizer in a compact set)

Let $$A$$ be a nonempty compact subset of $$X$$. Let $$x \in X$$. Then, there exists an $$a \in A$$ such that

$d(x, A) = d(x, a).$

Proof. For a fixed $$x \in X$$, consider the real valued function $$f : X \to \RR$$ given by:

$f(y) = d(y, x) \Forall y \in X.$

Then, $$f$$ is continuous as it is a distance function from a singleton set $$\{ x \}$$.

Hence, $$f(A)$$ attains a minimum value at some $$a \in A$$. See Theorem 3.85.

Theorem 3.127 (Distance minimizer in a closed set)

Let $$X$$ be a Euclidean metric space. Let $$A \subseteq X$$ be a nonempty closed set. Let $$x \in X$$. Then, there exists an $$a \in A$$ such that

$d(x, A) = d(x, a).$

In other words, the infimum of the distance between $$x$$ and points of $$A$$ is realized at a point in $$A$$.

Proof. Since $$A$$ is nonempty, we can pick some $$b \in A$$ and compute $$r = d(x, b)$$. Clearly,

$d(x,A) \leq d(x, b) = r.$

Consider the set

$C = \{a \in A \ST d(x, a) \leq d(x, b) = r\} = A \cap B[x,r].$

In other words, $$C$$ is the intersection of $$A$$ and the closed ball $$B[x,r]$$ centered at $$x$$ and of radius $$r$$. Since $$A$$ is closed and $$B[x,r]$$ is closed, hence $$C$$ is closed.

It is easy to see that

$d(x,A) = d(x, C).$

For any points $$u,v \in C$$, we have:

$d(u, v) \leq d(u, x) + d(x, v) \leq r + r = 2 r.$

Thus, $$C$$ is closed and bounded. By Heine-Borel theorem, $$C$$ is compact.

Now, for a fixed $$x \in X$$, consider the function $$f : X \to \RR$$ given by:

$f(y) = d(y, x) \Forall y \in X.$

Then, $$f$$ is continuous.

1. By Theorem 3.78, $$f(C)$$ is compact (continuous images of compact sets are compact).

2. But $$f(C) \subseteq \RR$$.

3. Hence, $$f(C)$$ is closed and bounded as $$\RR$$ is Euclidean (Heine-Borel theorem).

4. Hence, $$f(C)$$ attains a minimum value at some $$a \in C$$. See Theorem 3.85.

## 3.11.3. Distance Between Sets#

Recall from Definition 3.6 that the distance between two subsets of a metric space is given by

$d(A, B) = \inf \{ d(a,b) \ST a \in A, b \in B \}.$

Theorem 3.128 (Distance between disjoint compact and closed sets)

Let $$(X, d)$$ be a metric space. Let $$A, B \subseteq X$$ be disjoint (i.e., $$A \cap B = \EmptySet$$). Assume that $$A$$ is compact and $$B$$ is closed.

Then, there is $$\delta > 0$$ such that

$|x - y | \geq \delta \Forall x \in A, y \in B.$

In other words, the distance between $$A$$ and $$B$$ is nonzero; i.e., $$d(A, B) > 0$$.

Proof. We prove this by contradiction.

1. Assume that there is no such $$\delta > 0$$.

2. Then there exist sequences $$\{x_n \}$$ of $$A$$ and $$\{ y_n \}$$ of $$B$$ such that

$\lim_{n \to \infty} | x_n - y_n | = 0.$
3. Since $$A$$ is compact, hence $$\{x_n \}$$ has a convergent subsequence, say $$\{ x_{n_k} \}$$ which converges to some $$x \in A$$.

4. Now,

$|x - y_{n_k}| \leq | x - x_{n_k} | + |x_{n_k} - y_{n_k} |.$
5. Since $$\{ x_n - y_n \}$$ is a convergent sequence, hence $$\{ x_{n_k} - y_{n_k} \}$$ also converges to $$0$$.

6. Thus,

$\lim_{n \to \infty} |x - y_{n_k}| \leq \lim_{n \to \infty} | x - x_{n_k} | + \lim_{n \to \infty} |x_{n_k} - y_{n_k} | = 0 + 0 = 0.$
7. Thus, $$\{ y_{n_k} \}$$ is a convergent sequence of $$B$$ converging to $$x$$.

8. Since $$B$$ is closed, hence $$x \in B$$.

9. But then, $$x \in A \cap B$$.

10. Thus, $$A \cap B \neq \EmptySet$$ which is a contradiction.