# Real Analysis: Metric Topology

## 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 $S = X = \varnothing$ or if it is a subset of a ball. This is another way of saying that a set has 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

1. 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$.

2. Let $A$ be a finite subset of a metric space $(X, d)$. Show that $A$ is bounded.

Proof by induction.

Base case: Consider the set $A_0 = \varnothing$. Then either $A = X = \varnothing$ and so $A$ is bounded, or $A \subseteq \overline{B}_1(x)$ where $x \in X$, in which case $A$ is also bounded.

Inductive step: Assume any finite set $A_n$ with cardinality $n$ is bounded. Then there are some $x \in X$ and $r \in \mathbb{R}$ such that $A_n \subseteq \overline{B}_r(x)$. Take any value $p \in X$ where $p \notin A_n$ and form $A_{n+1} = A_n \cup \{p\}$. Set $s = \max\limits_{x \in A_{n+1}}(r, d(x, p)+1)$. Then $A_{n+1} \subseteq B_s(x)$, and so $A_{n+1}$ is bounded.

The result follows by induction.

3. Consider two subsets $S_1$ and $S_2$ of a metric space $(X, d)$ where $S_1$ is bounded by $\overline{B}_{r_1}(s_1)$ for some $s_1 \in X$ and $S_2$ is bounded by $\overline{B}_{r_2}(s_2)$ for some $s_2 \in X$. Show that $S_1 \cup S_2$ is bounded.

If either $S_1$ or $S_2$ is empty, then the union is trivially bounded.

Assume $S_1$ and $S_2$ are nonempty. Consider some $p_1 \in S_1$ and some $p_2 \in S_2$. By the triangle inequality, we make the following calculation:

$d(p_1, p_2) \leq d(p_1, s_1) + d(s_1, p_2) \\ d(p_1, p_2) \leq d(p_1, s_1) + d(s_1, s_2) + d(s_2, p_2)$

The maximum distance any individual element of $S_1$ can be from $s_1$ is $r_1$, and similarly for any individual element of $S_2$. Thus we can conclude the maximum distance between any two points is bounded by the following:

$d(p_1, p_2) \leq r_1 + d(s_1, s_2) + r_2$

Thus the distance between any two points in $S_1 \cup S_2$ is at most $r_1 + d(s_1, s_2) + r_2$. Therefore $S_1 \cup S_2$ is bounded by $\overline{B}_{r_1+d(s_1, s_2)+r_2}(s)$, where $s$ is any element in $S_1 \cup S_2$

4. Show that the finite union of bounded sets is bounded.

Proof by induction.

Base case: The union of the empty set is bounded.

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 bounded. The result follows by induction.

5. 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.

6. 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$.

7. 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.