# Real Analysis

Metric Spaces

# Metric Spaces

A set \(X\) is a *metric space* if there exists a metric \(d : X \times X \rightarrow \mathbb{R}\) such that for all \(p, q \in X\)

- (non-negativity) \(d(p, q) \geq 0\) (\(= 0\) iff \(p = q\)),
- (symmetry) \(d(p, q) = d(q, p)\), and
- (triangle inequality) \(d(p, q) \leq d(p, r) + d(r, q)\) for all \(r \in X\).

For example,

- \(\mathbb{R}^n\) with \(d(\vec{x}, \vec{y}) = \sqrt{(x_1 - y_1)^2 + \dots + (x_n - y_n)^2}\), also known as the
*Euclidean metric*on \(\mathbb{R}^n\), which is the implicit metric on \(\mathbb{R}^n\) if left unspecified. - \(\mathbb{R}\) with \(d(x, y) = |x - y|\), a specialization of the above example where \(n = 1\).
- \(\mathbb{R}^n\) with \(d(\vec{x}, \vec{y}) = \sum_{i = 1}^n |x_i - y_i|\), also known as the staircase metric.
- For a space of trees, \(d_T(x, y) =\) length of the shortest path between \(x\) and \(y\).
- For a space of genome sequences, \(d_G(x, y) =\) number of letters that are different.
- For a space of continuous functions on \([a, b]\), denoted \(\mathcal{C}([a, b])\), \(d_I(f, g) = \int_a^b |f - g| dx\).
- For a space of continuous bounded functions on \(\mathbb{R}\), denoted \(\mathcal{C}_b(\mathbb{R})\), \(d_{\sup}(f, g) = \sup_{x \in R} |f(x) - g(x)|\), also known as
*sup norm*. The supremum exists because the functions are bounded in their values. - For any set \(X\), a
*discrete metric*is defined as \[\begin{align} d_{discrete} = \begin{cases} 0 & \text{ if } p = q\\ 1 & \text{ otherwise} \end{cases} \end{align}\]

# Open Balls

A *neighborhood*, or *open ball*, of radius \(r\) is \(N_r(x) = \{y : d(x, y) < r\}\), alternatively denoted as \(B_r(x)\) or \(B(x; r)\). It tells us which points are nearby each other.

# Closed Balls

A *closed ball* of radius \(r\) is \(\overline{N_r(x)} = \{y : d(x, y) \leq r\}\), alternatively denoted as \(B_r[x]\) or \(B[x; r]\).