\documentclass{amsart}
\newcommand{\F}{\mathbb F}
\newcommand{\vv}{\vec{v}}
\newcommand{\vu}{\vec{u}}
\renewcommand{\L}{\mathcal L}
\newcommand{\R}{\mathbb R}
\newcommand{\C}{\mathbb C}
\newcommand{\bilin}[1]{\langle#1\rangle}

\theoremstyle{definition}
\newtheorem{defn}{Definition}
\theoremstyle{plain}
\newtheorem{thm}{Theorem}
\newtheorem{prop}{Proposition}
\newtheorem{lem}{Lemma}
\newtheorem{cor}{Corollary}

\title{Lecture 23: Metric Spaces}

\begin{document}
\maketitle

This lecture will look at the topological properties that arise from the notion of distance provided by the norm.

\begin{defn}
If $V$ is an inner product space, then the distance between $\vv$ and $\vu$ is
\[
d(\vv,\vu)=||\vv-\vu||.
\]
\end{defn}

\begin{prop}
The distance function satisfies
\begin{enumerate}
\item $d(\vv,\vu)\geq 0$ with equality iff $\vv=\vu$.
\item $d(\vv,\vu)=d(\vu,\vv)$ for all $\vu$ and $\vv$
\item $d(\vv,\vu)=d(\vv,\vec{w})+d(\vec{w},\vu)$ for all $\vv$, $\vu$, $\vec{w}$.
\end{enumerate}
\end{prop}
\begin{proof}
The first condition is positive-definteness, the second is symmetry, and the third is the triangle inequality.
\end{proof}

\begin{defn}
A metric space is a set $M$ with a function $d\colon M\times M\to\R$ that satisfies the three conditions in the previous proposition.
\end{defn}

Today's lecture will focus on metric spaces and establish some of the basic terminology. Next time we will start to look at the algebraic properties.

First some specific terms. 

\begin{defn}
The open ball of radius $r$ about $x$ is 
\[
B_r(x)=\{y\in M | d(x,y)<r\}.
\]

The closed ball of radius $r$ about $x$ is
\[
\overline{B_r(x)}=\{y\in M | d(x,y)\leq r\}.
\]
\end{defn}

The names come from $\R^2$ with the standard distance. Here
\[
B_r(x)=\{(x,y) \in\R^2 | d\big((a,b),(x,y)\big)<r\}=\{(x,y) | (x-a)^2+(y-b)^2<r^2\}.
\]

We can, however, put other distances on $\R^n$.

\begin{defn}
A \underline{norm} on $V$ is a function $||-||\colon V\to\R$ such that
\begin{enumerate}
\item $||\vv||\geq 0$ with equality iff $\vv=\vec{0}$.
\item $||r\vv||=|r|\cdot ||\vv||$
\item $||\vv+\vu||\leq ||\vv||+||\vu||$.
\end{enumerate}
\end{defn}

There are a number of important examples.

\begin{enumerate}
\item Let $p\geq 1$, and let $||-||_p$ on $\R^n$ be
    \[
    ||\vv||_p=\sqrt[p]{\sum |a_i|^p}.
    \]
    If $p=2$, then this is our Euclidean distance. If $p=1$, then this is the so called ``taxi-cab'' distance, since the distance between two points on the plane is how far a taxi would drive if it could only travel parallel to the x or y axis. For other values of $p$, we don't have such a fun description.
    
    The unit ball centered at the origin in each of these looks very different depending on the value of $p$. If $p=1$, then it looks like a diamond with vertices at $(\pm 1,0)$ and $(0,\pm 1)$. If $p=2$, then it is the standard unit circle, and as $p\to\infty$, it grows to the square with vertices at $(\pm 1,\pm 1)$.
\item Let $||-||_\infty$ on $\R^n$ be
\[
||\vv||_\infty=\max_{i\leq n} |a_i|.
\]
This serves as a kind of limit of the $||-||_p$ (if I hold $\vv$ constant and let $p\to\infty$, then the norms converge to the infinity norm).

The unit ball in this metric space is the square with vertices at $(\pm 1, \pm 1)$.

\item $\ell_p$: these are all infinite sequences of real numbers such that the $p$-norm makes sense (in other words, such that the associated sequence converges). For the infinity norm, these are all bounded sequences.
    
\item $L^p([a,b])$: these are all functions $[a,b]\to\R$ such that $\int_a^b |f(x)|^p dx <\infty$. The norm is then the $p$\textsuperscript{th} root of this integral. In particular, all continuous functions sit inside this space, but there are also discontinuous functions here too.
\end{enumerate}

The reason we consider metric spaces is that we can use this to talk about convergences of sequences.

\begin{defn}
Let $(x_n)$ be a sequence of elements in a metric space $M$. We say that $(x_n)$ \underline{converges} to $x$ if for every $\epsilon >0$, we can find an $N$ such that for all $n>N$, $x_n\in B_\epsilon(x)$.
\end{defn}

Put another way, if you give me some distance from $x$ (in this case, $\epsilon$), then all of the terms in the sequence are eventually within $\epsilon$ of $x$.

The fact that for all distinct $x,y$, $d(x,y)>0$ shows us that if a limit exists, then it must be unique (we just choose $\epsilon$ to be less than $\tfrac{1}{2}d(x,y)$ and use the triangle inequality to see that we can't be within epsilon of $x$ and of $y$).

In our case, we will use limits to talk about infinite series (as the limits of the partial sums). We'll focus on this in a later lecture. For now, we continue with just topological properties.

\begin{defn}
A set $U$ is \underline{open} if for every $x\in U$, there is an $r$ such that $B_r(x)\subset U$.

A set $T$ is \underline{closed} if $T^c$ is open.
\end{defn}

The following is immediate from the definition.

\begin{prop}
\begin{enumerate}
\item $\emptyset$ and $M$ are open.
\item If $U$ and $V$ are open, then so is $U\cap V$.
\item If $U_i$, $i\in I$ is a collection of open sets, then $\bigcup U_i$ is open.
\end{enumerate}
\end{prop}

A restatement of our result about limits is that $x$ is the limit of $(x_n)$ iff for every open set $U$ about $x$, all but finitely many of the terms in the sequence are in $U$.

A corresponding result is true for the closed sets, and we will return to that later. Our focus now is on limits.

\begin{defn}
A sequence $(x_n)$ is \underline{Cauchy} if for all $\epsilon>0$, there exists an $N$ such that for all $n,m>N$, 
\[
d(x_n,x_m)<\epsilon.
\]
\end{defn}

In other words, a sequence is Cauchy if the terms get arbitrarily close together as we proceed in the sequence.

\begin{prop}
If $(x_n)$ converges to $x$, then $(x_n)$ is Cauchy.
\end{prop}
\begin{proof}
We apply the triangle inequality to $d(x_n,x_m)$:
\[
d(x_n,x_m)\leq d(x_n,x)+d(x,x_m).
\]
Now choose $N$ such that $d(x_n,x)<\epsilon/2$ for all $n>N$, and we have that $(x_n)$ is Cauchy.
\end{proof}

The converse is not in general true. Consider the metric space of real numbers with the absolute value metric. The subspace of rational numbers is a submetric space, and in this, not every Cauchy sequence converges. In particular, take the decimal approximations to your favorite irrational number. This is a Cauchy sequence since it converges in $\R$, but not in $\mathbb Q$.

\begin{defn}
A metric space $M$ is complete if every Cauchy sequence converges.
\end{defn}

Like everything else we have talked about, there is a secret universal property underlying the following theorem. The proof of this is somewhat involved, so we will give only a sketch of the key ideas.

\begin{thm}
Every metric space can be embedded in a complete metric space.
\end{thm}

In fact, we can always embed $M$ as a dense subset, but such a discussion will have to await our discussion of density. We also postpone slightly what we mean by ``embed''. For now, we just describe the completion.

Let $\tilde{M}$ denote the collection of all Cauchy sequences from $M$. We can embed $M$ in here as the constant sequences. We then have that a Cauchy sequence in $M$ converges to ... that Cauchy sequence as an element of $\tilde{M}$. We can define a pseudometric on $\tilde{M}$ by saying
\[
d\big((x_n),(y_n)\big)=\lim d(x_n,y_n).
\]
The problem here (and the reason for the ``pseudo-'') is that different Cauchy sequences can converge to the same element (for example, in $\R$, we have, say, decimal and binary expansions for an irrational number). This means that our distance function is not always non-negative for distinct inputs. We can fix this by declaring that two elements are equivalent if $d(x,y)=0$. The set of equivalence classes inherits a distance from $d$, and this is a metric space. We let $\bar{M}$ denote the quotient of $\tilde{M}$ by this equivalence relation.

It is not difficult (but somewhat tedious) to show that $\bar{M}$ is a complete metric space. It is not difficult to show that $M$ embeds therein, completing the argument.

As an aside, this is one of the two main constructions of the real numbers. We begin with the rationals as a metric space and we complete them to the reals by adding in the limits of Cauchy sequences that don't converge in $\mathbb Q$ (namely the irrational numbers).

To finish the lecture, we turn to a notion of continuous. This was underlying our notion of ``embedding'' (though there we will use a slightly stronger notion of ``isometry''). Recall the definition from one variable calculus:
\begin{defn}
A function $f\colon \R\to \R$ is continuous at $a$ if for all $\epsilon>0$, there exists a $\delta>0$ such that
\[
|x-a|<\delta\Rightarrow |f(x)-f(a)|<\epsilon.
\]
\end{defn}

We can copy this definition {\emph{mutatis mutandis}} to the metric space context: we replace $|x-a|<\delta$ with $x\in B_\delta(a)$ and $|f(x)-f(a)|<\epsilon$ with $f(x)\in B_\epsilon(f(a))$. We can do better, and this is often easier to check.

\begin{prop}
A function $f\colon M\to N$ between two metric spaces is continuous if for all open sets $U$ in $N$, $f^{-1}(U)$ is open in $M$.
\end{prop}

This is an elementary exercise in the definitions. This relationship provides the {\emph{definition}} of continuous for functions between arbitrary topological spaces: the inverse image of open sets is open.

We close with an interpretation of this: open sets measure ``closeness''. This proposition / definition says ``close things map to close things'', which is exactly our intuition of continuity.

\end{document} 