# Real Analysis: Metric Spaces

## Distance Within and Between Sets

### Diameter

The **diameter** of a set is the maximum distance between any two points in the set. Formally, the diameter of a set $S$ is defined as $\text{Diam}(S) = \text{sup}\{d(x, y) : x, y \in S\}$. Note that this definition of diameter does not require that the set itself contain a "path" of length $\text{Diam}(S)$ connecting the two points. For example, if $S = \{0\} \cup \{2\}$, then $\text{Diam}(S) = 2$, even though if we were to visualize $\text{Diam}(S)$ by drawing a line connecting the two points, this line would travel outside of $S$.

### Bounded Sets

Let $(X, d)$ be a metric space. A subset $S$ is **bounded** if it has a finite diameter. Note that boundedness is dependent on the metric. Some sets may be bounded under one metric and unbounded under another. For example, $\mathbb{R}$ itself is unbounded under the Euclidean metric but bounded under the discrete metric.

### Distance Between Sets

Consider two subsets $S$ and $T$ of a metric space $(X, d)$. The **distance** between them is defined as $\text{dist}(S, T) = \inf\{d(s, t) : s \in S, t \in T\}$. The **distance** between a point $x$ and a set $S$ is defined as $\text{dist}(x, S) = \text{dist}(\{x\}, S)$. In other words, we simply wrap the individual point into its own little set and then use the first definition of distance.

### Computing Diameters, Bounds, and Distances

Diameters, bounds, and distances can be computed for any pair of finite sets by simply exhausting all possible combinations of inputs to the functions used in their respective definitions. However, most sets of interest are infinite, and many that are finite may still be large enough such that exhausting all possible combinations of inputs is impractical. In these instances, more structure describing the sets is needed to reason about the corresponding values. That said, metric topology is only concerned with the general properties of these concepts, and it only requires simple sets like neighborhoods to lay the groundwork for future topics in analysis related to concepts like continuity, differentiability, and integrability. Subjects like differential geometry use these tools to explore distances and bounds for visually interesting shapes such as curves and surfaces.

## Problems

Consider the set $A = \{2, 5, 17, 1066, 1976\}$ taken as a subset of $\mathbb{R}$. Is $A$ bounded? If so, give an example of a ball that contains it and compute its diameter. If not, provide a counterexample.

$A$ is bounded, as it is a subset of the ball $\overline{B}_{2000}(0)$. The diameter of $A$ is $1976 - 2 = 1974$.

Show that the empty set is bounded.

Pick some $r \in \mathbb{R}.$ Because the empty set has no members, it is vacuously true that the distance between any two of them is less than $r.$ Therefore the empty has finite diameter and is therefore bounded.

Show that singleton sets are bounded.

Consider some singleton set $\{x\}.$ Then $\sup\{ d(a, b) : a, b \in \{x\} \} = \sup\{ d(x, x) \} = \sup\{ 0 \} = 0.$

Show that finite sets are bounded.

Consider some set $A$ such that $|A| = n$ for some $n \in \mathbb{N}.$ Then $\text{Diam}(A) = \inf\{ d(x, y) : x, y \in A \} = \text{max}\{ d(x, y) : x, y \in A \}.$ Thus $\text{Diam}(A)$ is finite and therefore bounded.

Show that the distance between any two sets is finite.

Let $A$ and $B$ be two subsets of a metric space $(X, d).$ Then the distance between them is $\text{dist}(A, B) = \inf(\{d(a, b) : a \in A, b \in B\}).$ Pick any $a_0 \in A$ and $b_0 \in B.$ Since $d(a_0, b_0) \in \mathbb{R},$ it follows that $d(a_0, b_0)$ is an upper bound of $\text{dist}(A, B).$ Thus $\text{dist}(A, B) \leq d(a_0, b_0)$ and is therefore finite.

Show that the union of two bounded subsets is bounded.

Let $S_1$ and $S_2$ be bounded subsets of a metric space $(X, d).$ If either $S_1$ or $S_2$ is empty, then their union is trivially bounded. Assume then that neither $S_1$ nor $S_2$ is empty. We must show that $\text{sup}\{d(p_1, p_2) : p_1, p_2 \in S_1 \cup S_2\}$ is finite.

First, pick some $q_1 \in S_1$ and $q_2 \in S_2.$ Next, consider any $p_1, p_2 \in S_1 \cup S_2.$ If $p_1, p_2 \in S_1,$ then $d(p_1, p_2) \leq \text{Diam}(S_1)$ and therefore finite. If $p_1, p_2 \in S_2,$ then $d(p_1, p_2) \leq \text{Diam}(S_2)$ and therefore finite. If instead $p_1 \in S_1$ and $p_2 \in S_2,$ then by the triangle inequality, it follows that

$ d(p_1, p_2) \leq d(p_1, q_1) + d(q_1, p_2) \\ d(p_1, p_2) \leq d(p_1, q_1) + d(q_1, q_2) + d(q_2, p_2) \\ d(p_1, p_2) \leq \text{Diam}(S_1) + d(q_1, q_2) + \text{Diam}(S_2) $

Therefore $\sup\{ d(p_1, p_2) : p_1 \in S_1, p_2 S_2\} \leq \text{Diam}(S_1) + d(q_1, q_2) + \text{Diam}(S_2).$ Finally, if $p_1 \in S_2$ and $p_2 \in S_1,$ then swap them and repeat the aforementioned calculation. Thus in all cases $d(p_1, p_2)$ is bounded above, so $S_1 \cup S_2$ is bounded.

Show that the finite union of bounded sets is bounded.

Proof by induction.

Base case: Let $A_1$ be bounded a bounded set. Then $\bigcup\limits_{i=1}^1 A_i = A_1,$ which is bounded by definition.

Inductive step: Assume the sets $A_1, \ldots, A_n$ are bounded and that $\bigcup\limits_{i=1}^n A_i$ is bounded. Let $A_{n+1}$ be another bounded set. By the preceding proof, $\left(\bigcup\limits_{i=1}^n A_i \right) \cup A_{n+1} = \left(\bigcup\limits_{i=1}^{n+1} A_i \right) $ is a union of two bounded sets and is therefore bounded. The result follows by induction.

Show that the arbitrary union of bounded sets is not necessarily bounded.

Consider the set of all intervals of length $2$ centered at the integers, i.e. $\ldots, [-2, 0], [-1, 1], [0, 2], \ldots$. Each set is bounded, but their union, $\mathbb{R}$, is unbounded.

Show that $\text{dist}(\mathbb{Q}, \mathbb{R}) = 0$.

Take $0 \in \mathbb{Q}$ and $0 \in \mathbb{R}$. Then $d(0,0) = 0$, therefore $\text{inf}\{d(q, r) : q \in \mathbb{Q}, r \in \mathbb{R}\} = 0$.

Show that $\text{dist}(\mathbb{Q}, \mathbb{R} - \mathbb{Q}) = 0$.

Proof by contradiction. Assume $\text{dist}(\mathbb{Q}, \mathbb{R} - \mathbb{Q}) = \varepsilon > 0$. Then $\inf\{d(q, r) : q \in \mathbb{Q}, r \in \mathbb{R}\} = \varepsilon$. Take $q \in \mathbb{Q}$. Then $q + \frac{\varepsilon}{2} \in \mathbb{R}$, and there exists an irrational $p$ such that $q < p < q + \frac{\varepsilon}{2}$. But this means that $d(q, p) < \frac{\varepsilon}{2} < \varepsilon$, which is a contradiction. Therefore $\text{dist}(\mathbb{Q}, \mathbb{R} - \mathbb{Q}) = 0$ after all.

Show for any $S \subseteq \mathbb{R}$ that if $\inf(S)$ exists, then $\text{Dist}(\inf(S), S) = 0.$

Let $S \subseteq \mathbb{R},$ and assume $S$ has a greatest lower bound. If $\inf(S) \in S,$ then $\text{Dist}(\inf(S), S) = 0$ by definition. If $\inf(S) \notin S,$ then proceed by contradiction and assume $\text{Dist}(\inf(S), S) = r > 0.$ It follows that $d(\inf(S), x) \geq r$ for all $x \in S.$ But this implies that $\inf(S) + \frac{r}{2}$ is a lower bound for $S,$ which is a contradiction. Therefore $\text{Dist}(\inf(S), S) = 0$ after all.

Show for any $S \subseteq \mathbb{R}$ that if $\sup(S)$ exists, then $\text{Dist}(\sup(S), S) = 0.$

Let $S \subseteq \mathbb{R},$ and assume $S$ has a least upper bound. If $\sup(S) \in S,$ then $\text{Dist}(\sup(S), S) = 0$ by definition. If $\sup(S) \notin S,$ then proceed by contradiction and assume $\text{Dist}(\sup(S), S) = r > 0.$ It follows that $d(\sup(S), x) \geq r$ for all $x \in S.$ But this implies that $\sup(S) - \frac{r}{2}$ is an upper bound for $S,$ which is a contradiction. Therefore $\text{Dist}(\sup(S), S) = 0$ after all.