Definition 35.1. Let \( M \) be a set. A metric on \( M \) is a function \( d \) from \( M \times M \) into \( [0, \infty) \) which satisfies (i) \( d(x, y) = 0 \) if and only if \( x = y \) (ii) \( d(x, y) = d(y, x) \) for all \( y \in M \) (iii) \( d(x, z) \leq d(x, y) + d(y, z) \) for all \( z \in M \)
Metric Space
Definition 35.2. A metric space is an ordered pair \( (M, d) \), where \( M \) is a set and \( d \) is a metric for \( M \).
Example
Example.(i) The pair $(\mathbb{R}, d)$ is a metric space, where $d$ is defined by $d(x, y) = |x - y|$. (ii) Let $X$ be a set. Define the $d(x, y)$ by $$d(x, y) = \begin{cases} 0 & \text{if } x = y \\ 1 & \text{if } x \neq y. \end{cases}$$ It is easy to verify that $d(x, y)$ is a metric on $X$. The metric $d$ is called the discrete metric for $X$, and we refer to the metric space $(X, d)$ as $X$ with the discrete metric. (iii) Let $\ell^1$ denote the set of all real sequences $\{ a_n \}$ such that $\sum_{n=1}^{\infty} a_n$ converges absolutely. Then $$d(\{ a_n \}, \{ b_n \}) = \sum_{n=1}^{\infty} |a_n - b_n|$$ defines a metric on $\ell^1$. (($\because$) Since $\sum_{n=1}^{\infty} |a_n|$ and $\sum_{n=1}^{\infty} |b_n|$ converges and $|a_n - b_n| \leq |a_n| + |b_n|, \forall n \in \mathbb{P}$, $d(\{ a_n \}, \{ b_n \}) = \sum_{n=1}^{\infty} |a_n - b_n|$ converges by the comparison test. Clearly, $d(\{a_n\}, \{ a_n \}) = \sum_{n=1}^{\infty} 0 = 0$ and $d(\{ a_n \}, \{ b_n \}) = d(\{ b_n \}, \{ a_n \})$. Since $|a_n - b_n| \leq |a_n - c_n| + |c_n - b_n|, \forall n \in \mathbb{P}$, we have $$\sum_{n=1}^{k} |a_n - b_n| \leq \sum_{n=1}^k |a_n - c_n| + \sum_{n=1}^k |c_n - b_n| \\ \Longrightarrow d(\{ a_n \}, \{ b_n \}) = \sum_{n=1}^{\infty} |a_n - b_n| \leq \sum_{n=1}^{\infty} |a_n - c_n| + \sum_{n=1}^{\infty} |c_n - b_n| \\ = d(\{ a_n \}, \{ c_n \}) + d( \{ c_n \}, \{ b_n\}).)$$ (iv) Let $\ell^2$ denote the set of all real sequences $\{ a_n \}$ for which the series $\sum_{n=1}^{\infty} a^2_n$ converges. Then $$d(\{a_n\}, \{b_n\}) = \sqrt{\sum_{n=1}^{\infty} (a_n - b_n)^2}$$ defines a metric on $\ell^2$ by Corollary 36.4 and Theorem 36.5. (v) The pair $(\mathbb{R}^n, d)$ is a metric space, where $d$ is defined by $$d(x, y) = \sqrt{\sum_{k=1}^n (x_k - y_k)^2}$$ where $x = (x_1, ..., x_n), y = (y_1, ..., y_n) \in \mathbb{R}^n$, by Theorem 36.2. The function $d$ is called the Euclidean metric for $\mathbb{R}^n$.
Cauchy-Schwarz Inequality for \(\mathbb{R}^n\)
Theorem 36.1 (Cauchy-Schwarz Inequality for \(\mathbb{R}^n\)). Let \(a_1, \ldots, a_n\) and \(b_1, \ldots, b_n\) be real numbers. Then \[ \left| \sum_{k=1}^n a_k b_k \right| \leq \sqrt{ \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right). }\]
Proof. If $b_k = 0, \forall k \in \{ 1, ..., k \}$, then the result follows immediately. Thus assume that $b_k \neq 0$ for some $k, 1 \leq k \leq n$. Then $\sum_{k=1}^n b_k > 0$, and for any real number $x$ we have $$0 \leq \sum_{k=1}^n (a_k - xb_k)^2 \\ = \sum_{k=1}^n a^2_k - 2x \sum_{k=1}^n a_kb_k + x^2 \sum_{k=1}^n b^2_k.$$ Let $A = \sum_{k=1}^n a^2_k$, $B = \sum_{k=1}^n b^2_k$, and $C = \sum_{k=1}^n a_k b_k$. If we take $x = \frac{C}{B}$, then we have $$0 \leq A - 2xC + x^2B \\ = A - 2 \frac{C^2}{B} + \frac{C^2}{B} \\ \Longrightarrow \left( \sum_{k=1}^n a_k b_k \right)^2 = C^2 \leq AB = \left( \sum_{k=1}^n a^2_k \right) \left( \sum_{k=1}^n b^2_k \right) \\ \Longrightarrow \left| \sum_{k=1}^n a_k b_k \right| \leq \sqrt{\left( \sum_{k=1}^n a^2_k \right) \left( \sum_{k=1}^n b^2_k \right)}. \blacksquare$$
Theorem 36.2
Theorem 36.2. The equation \[ d(x, y) = \sqrt{ \sum_{k=1}^n (x_k - y_k)^2 }, \] where \(x = (x_1, \ldots, x_n)\), \(y = (y_1, \ldots, y_n) \in \mathbb{R}^n\), defines a metric on \(\mathbb{R}^n\).
Proof. It is clear that $d(x, x) = 0$ and $d(x, y) = d(y, x)$. For any $z \in \mathbb{R}^n$, we must show that $$d(x, z) = \sqrt{\sum_{k=1}^n (x_k - y_k)^2} \leq \sqrt{\sum_{k=1}^n (x_k - z_k)^2} + \sqrt{\sum_{k=1}^n (z_k - y_k)^2} = d(x, z) + d(z, y).$$ If we let $a_k = x_k - z_k$ and $b_k = z_k - y_k$, then the above inequality is written by $$\sqrt{\sum_{k=1}^n (a_k + b_k)^2} \leq \sqrt{\sum_{k=1}^n a^2_k} + \sqrt{\sum_{k=1}^n b^2_k} \\ \Longrightarrow \sum_{k=1}^n a^2_k + 2 \sum_{k=1}^n a_kb_k + \sum_{k=1}^n b^2_k \leq \sum_{k=1}^n a^2_k + 2 \sqrt{\sum_{k=1}^n a^2_k b^2_k} + \sum_{k=1}^n b^2_k \\ \Longrightarrow \sum_{k=1}^n a_kb_k \leq \sqrt{\sum_{k=1}^n a^2_k b^2_k},$$ which is true by Cauchy-Schwarz Inequality. Thus $d$ is a metric on $\mathbb{R}^n$. $\blacksquare$
Theorem 36.3
Theorem 36.3. If \(\{a_k\}, \{b_k\} \in \ell^2\), then the series \(\sum_{k=1}^\infty a_k b_k\) converges absolutely.
Proof. By the Cauchy-Schwarz intequality, $$\left| \sum_{k=1}^n |a_k||b_k| \right| \leq \sqrt{\left( \sum_{k=1}^n |a_k|^2 \right) \left( \sum_{k=1}^n |b_k|^2 \right)}.$$ Since $\sum_{k=1}^n a^2_k$ and $\sum_{k=1}^n b^2_k$ converges, we have $$\sum_{k=1}^n |a_k||b_k| \leq \sqrt{\left( \sum_{k=1}^n a^2_k \right) \left( \sum_{k=1}^n b^2_k \right)} \\ \leq \sqrt{\left( \sum_{k=1}^{\infty} a^2_k \right) \left( \sum_{k=1}^{\infty} b^2_k \right)}$$ by the remark. Since the sequence $\sum_{k=1}^n |a_k||b_k|$ is increasing and bounded, it is convergent by Theorem 24.1. $\blacksquare$
Corollary 36.4
Corollary 36.4. If \(\{a_k\}, \{b_k\} \in \ell^2\), then the series \(\sum_{k=1}^\infty (a_k - b_k)^2\) converges.
Proof. Since $\sum_{k=1}^{\infty} a^2_k$ and $\sum_{k=1}^{\infty} b^2_k$ converges, $\sum_{k=1}^{\infty} a_kb_k$ converges absolutely by Theorem 36.3, so that $$\sum_{k=1}^{\infty} (a_k - b_k)^2 = \sum_{k=1}^{\infty} a^2_k - 2 \sum_{k=1}^{\infty} a_kb_k + \sum_{k=1}^{\infty} b^2_k$$ converges. $\blacksquare$
Theorem 36.5
Theorem 36.5. The equation \[ d(\{a_k\}, \{b_k\}) = \sqrt{ \sum_{k=1}^\infty (a_k - b_k)^2 } \] defines a metric on \(\ell^2\).
Proof. It is clear that $d(\{a_k\}, \{a_k\}) = 0$ and $d(\{a_k\}, \{b_k\}) = d(\{b_k\}, \{ a_k\})$. By Theorem 36.2, $$\sqrt{\sum_{k=1}^{n} (a_k - b_k)^2} \\ \leq \sqrt{\sum_{k=1}^{n} (a_k - c_k)^2} + \sqrt{\sum_{k=1}^{n} (c_k - b_k)^2},$$ for any $\{ c_k \} \in \ell^2$. Taking the limits, we have that $$d(\{a_k\}, \{b_k\}) = \\ \sqrt{\sum_{k=1}^{\infty} (a_k - b_k)^2} \leq \sqrt{\sum_{k=1}^{\infty} (a_k - c_k)^2} + \sqrt{\sum_{k=1}^{\infty} (c_k - b_k)^2} \\ = d(\{a_k\}, \{ c_k \}) + d(\{c_k\}, \{b_k\})$$ by Corollary 36.4. $\blacksquare$
Cauchy-Schwarz Inequality for \(\ell^2\)
Theorem 36.6 (Cauchy-Schwarz Inequality for \(\ell^2\)). If \(\{a_k\}, \{b_k\} \in \ell^2\), then the series \(\sum_{k=1}^\infty a_k b_k\) converges absolutely and \[ \left| \sum_{k=1}^\infty a_k b_k \right| \leq \sqrt{ \left( \sum_{k=1}^\infty a_k^2 \right) \left( \sum_{k=1}^\infty b_k^2 \right) }. \]
Proof. $\sum_{k=1}^{\infty} a_kb_k$ converges absolutely by Theorem 36.3, and the inequality holds by taking the limits to the inequality of Theorem 36.1. $\blacksquare$