\documentclass{amsart}

\usepackage{amssymb}


\theoremstyle{plain}
\newtheorem{thm}{Theorem}[section]
\newtheorem{cor}[thm]{Corollary}
\newtheorem{lem}[thm]{Lemma}



\theoremstyle{definition}
\newtheorem{defn}[thm]{Definition}
\newtheorem{exer}{Exercise}
\newtheorem{exam}{Example}


\theoremstyle{remark}
\newtheorem{rem}[thm]{Remark}
\newtheorem{fact}[thm]{Fact}






\newcommand{\R}{\mathbb{R}}
\newcommand{\std}{\text{std}}




\begin{document}

We define the notion of a metric.

\begin{defn}
A metric $\rho$ on a set $X$ is a fuction $\rho\colon X^2 \to \R$
satisfying the following:

\begin{enumerate}
\item
$\rho(x,y)\geq 0$ for all $x,y \in X$, and $\rho(x,y)=0$ iff $x=y$.
\item (symmetry)
$\rho(x,y)=\rho(y,x)$ for all $x,y \in X$.
\item (triangle inequality)
$\rho(x,z)\leq \rho(x,y)+\rho(y,z)$ for all $x,y,z\in X$.
\end{enumerate}
\end{defn}


\begin{rem}
If we remove the requirement that $\rho(x,y)=0$ iff $x=y$, then we get the notion
of a {\em pseudometric}.
\end{rem}


If $\rho$ is a metric on a set $X$, then we define the $\rho$-metric topology $\tau_\rho$ on $X$
as follows. $U\subseteq X$ is $\tau_\rho$ iff $\forall x \in U\ \exists \epsilon >0 \
(B_\rho(x,\epsilon)\subseteq U)$, where $B_\rho(x,\epsilon)=\{ y\in X\colon \rho(x,y)<\epsilon\}$.

Show this is a topology on $X$. Note, this does not use the triangle inequality, or the other axioms
of a metric, only the fact that if $\epsilon_1<\epsilon_2$, then
$B_\rho(x,\epsilon_1)\subseteq B_\rho(x,\epsilon_2)$, which is immediate from the definition of
of $B_\rho(x,\epsilon)$.

On the other hand, using the triangle inequality we have the following basic fact.

\begin{fact}
For any metric $\rho$ on a set $X$, the ball $B_\rho(x,\epsilon)$
is open.
\end{fact}

\begin{proof}
Let $y \in B_\rho(x,\epsilon)$. So, $\rho(x,y)<\epsilon$. Let $\delta=\epsilon- \rho(x,y)>0$.
If $z \in B_\rho(y,\delta)$, then $\rho(x,z)\leq \rho(x,y)+\rho(y,z)
<\rho(x,y)+\delta =\epsilon$. This shows $B_\rho(x,\epsilon)$ is open in $\tau_\rho$.
\end{proof}




\begin{exam} \label{exam:e1}
Some examples:
\begin{enumerate}
\item
$X=\R$, $\rho(x,y)=|x-y|$, the standard metric on $\R$. This gives the standard topology
$\tau_\std$ on $\R$. We call the space $\R_\std$.
\item
$X=\R^n$. The standard Euclidean metric is
\[\rho(\vec{x},\vec{y})=\sqrt{(x_1-y_1)^2+\dots +(x_n-y_n)^2}.
\]
\item
On $X=\R^n$ we also have the following metrics.
\begin{equation*}
\begin{split}
\rho_2(\vec{x},\vec{y})&= |x_1-y_1|+\dots+|x_n-y_n|\\
\rho_3(\vec{x},\vec{y})&=\max \{ |x_1-y_1|,\dots, |x_n-y_n|\}
\end{split}
\end{equation*}
We show below that these metrics are {equivalent}, that is, they give the same topology
on $\R^n$.
\item
$X$ any set. The {\em discrete metric} on $X$ is the metric given by
\[
\rho(x,y)=\begin{cases} 0 & \text{ if } x=y \\ 1 & \text{ if } x \neq y\end{cases}.
\]
Show this is a metric, and it gives the discrete topology on $X$.
\end{enumerate}
\end{exam}


\begin{exam}
If $(X,\rho)$ is a metric space and $Y \subseteq X$, then
$\rho \restriction (Y\times Y)$ is also a metric.
\end{exam}

\begin{proof}
It is trivial that the axioms go down from $X$ to $Y$ as they are all universal.
\end{proof}



We say two metrics $\rho$, $d$ on a set $X$ are {\em equivalent} if they give the same
topology on $X$.


\begin{fact} \label{mi}
If $\rho$, $d$ are metrics on $X$, then $\tau_\rho \subseteq \tau_d$ iff
\begin{equation} \label{me}
\forall x \in X\ \forall \epsilon >0\ \exists \delta >0 \ (B_d(x,\delta)
\subseteq B_\rho(x,\epsilon)).
\end{equation}
\end{fact}


\begin{proof}
Suppose first that (\ref{me}) holds. Let $U\in \tau_\rho$. Let $x \in U$. Since
$U\in \tau_\rho$, there is an $\epsilon>0$ such that $B_\rho(x,\epsilon)\subseteq U$.
From (\ref{me}), there is a $\delta>0$ such that $B_d(x,\delta)\subseteq B_\rho(x,\epsilon)
\subseteq U$, which shows $U\in \tau_d$. 

Conversely, suppose $\tau_\rho\subseteq \tau_d$. We show (\ref{me}).
Let $x \in X$ and fix $\epsilon >0$. Since $B_\rho(x,\epsilon)\in \tau_\rho \subseteq \tau_d$,
we have from the definition of $\tau_d$ that there is a $\delta>0$ such that $B_d(x,\delta)
\subseteq U$. This shows (\ref{me}).

\end{proof}



\begin{cor}
Given two metrics $\rho$, $d$ on a set $X$, we have that $\tau_\rho=\tau_d$
iff $\forall x \in X\ \forall \epsilon >0\ \exists \delta >0 \ (B_d(x,\delta)
\subseteq B_\rho(x,\epsilon))$ and
$\forall x \in X\ \forall \epsilon >0\ \exists \delta >0 \ (B_\rho(x,\delta)
\subseteq B_d(x,\epsilon))$.
\end{cor}




We have the particular special case of Fact~\ref{mi}.

\begin{fact}
If $\rho$, $d$ are metrics on a set $X$ and there is a constant $C\in \R$
such that $\rho(x,y)\leq C d(x,y)$ for all $x,y \in X$, then $\tau_\rho \subseteq \tau_d$.
\end{fact}


\begin{proof}
Let $x \in X$, and fix $\epsilon >0$. We need to find a $\delta>0$ such that
$B_d(x,\delta)\subseteq B_\rho(x,\epsilon)$.
Let $\delta = \frac{\epsilon}{C}$ (note that wlog $C>0$). Then if
$y \in B_d(x,\delta)$ we have $d(x,y)<\delta=\frac{\epsilon}{C}$, so
$\rho(x,y)< C \frac{\epsilon}{C}=\epsilon$, so $y \in B_\rho(x,\epsilon)$.
\end{proof}


\begin{cor}
If $\rho$, $d$ are metrics on $X$ and there are constants $C$, $D$ such that
$\rho \leq C d$ and $d \leq D \rho$, then $\tau_\rho=\tau_d$, that is,
$\rho$ and $d$ are equivalent metrics.
\end{cor}



Using the above we have the following fact.



\begin{fact} \label{tfa}
Let $\rho$ be a metric on $X$. Let $f\colon X\to \R$. Define $d$ by
$d(x,y)=\rho(x,y)+|f(x)-f(y)|$. Then $d$ is a metric on $X$
and $\tau_\rho\subseteq \tau_d$.
\end{fact}

\begin{proof}
It is easy to show that $d$ is a metric on $X$. Since we clearly have that
$\rho \leq d$, it follows that $\tau_\rho \subseteq \tau_d$.
\end{proof}





\begin{exam}
Let $\rho(x,y)=|x-y|$ be the standard metric on $\R$, and let
$d(x,y)= \rho(x,y)+|x^2-y^2|$. From Fact~\ref{tfa} we have that
$\tau_\rho \subseteq \tau_d$. Using the fact that the function $f(x)=x^2$
is continuous, it is easy to see that $\tau_d \subseteq \tau_\rho$.
So, $\rho$ and $d$ are equivalent metric on $R$. However, it is not the case
that there is a constant $C$ such that $d \leq C\rho$ (easy to see). 
\end{exam}




\begin{fact} \label{fact:f1}
The metrics $\rho$, $\rho_2$, and $\rho_3$ on $\R^n$ of Example~\ref{exam:e1}
are all equivalent.
\end{fact}

\begin{proof}
The three metrics are all bounded in terms of each other.
We have $\rho_3 \leq \rho \leq \rho_2 \leq n \rho_3$ (for the second inequality,
square both sides).

\end{proof}




\begin{exam}
Let $X=\R^\omega$ be the set of all sequences $x=(x_0,x_1,\dots,)$ of real numbers. 
For $1 \leq p \leq \infty$, we define the map $x \in X \mapsto \| x\|_p \in \R^{\geq 0} \cup \{ \infty\}$
as follows. If $p<\infty$ then we set $\| x\|_p= \left( \sum_i |x_i|^p \right)^{\frac{1}{p}}$ (if the
sum diverges then we set $\| x\|=\infty$). For $p=\infty$ we define 
$\| x\|_\infty= \sup \{ |x_i|\}$, where we take the ``sup'' to be $\infty$
if the sequence of $| x_i|$ is not bounded. For $1 \leq p \leq \infty$
we let $\ell_p \subseteq X$ be the set of sequences $x$ such that $\| x\|_p <\infty$. 
It can be shown that this is {\em norm} on $\ell_p$, that is we have:
\begin{enumerate}
\item
$\| cx\|_p=|c| \| x\|_p$ for all $c \in \R$. 
\item
$\| x+y\|_p\leq \| x\|_p+\|y\|_p$ for all $x,y \in \ell
_p$.
\end{enumerate}
From these it follows that we have a metric $d_p$ on $\ell_p$ defined by 
$d_p(x,y)=\| x-y\|_p$ (note that addition and scalar multiplication are defined on $\ell_p$,
and that it is a vector space over $\R$). For $p=1,2, \infty$, these metrics generalize the metrics
of Example~\ref{exam:e1} from $\R^n$ to infinite dimensional versions of these spaces. 
For finite dimensional spaces, the $\R^n$, these metrics are equivalent as shown
in Fact~\ref{fact:f1}. On $\R^\omega$, however, they are not equivalent. 
If $1 \leq p \leq q \leq \infty$ we do have $\| x\|_q \leq \| x\|_p$, and so 
$\ell_p \subseteq \ell_q$. Thus, as topological (metric) spaces we have that 
$\tau_{d_q}\subseteq \tau_{d_p}$ (on the space $\ell_p$) To see this norm inequality note that 
we may assume wlog that $p<\infty$ and $\| x\|_p<\infty$, in which case the terms $\| x_i\|$ must tend to $0$. 
So, $B=\max \{ |x_i|\}$ is well-defined. Since both norms scale under scalar multiplication, we may assume
that $B=1$. We then have:
\[
\| x \|_q= \left( \sum_i |x_i|^q\right)^{\frac{1}{q}}
\leq \left( \sum_i |x_i|^p\right)^{\frac{1}{q}} 
= \left( \sum_i |x_i|^p\right)^{\frac{1}{p} \frac{p}{q}}
=(\| x\|_p )^{\frac{p}{q}} \leq \| x\|_p.
\]
The first inequality is from $| x_i|\leq 1$ (since $B=1$), and the last inequality is from 
$\| x\|_p \geq 1$ and $\frac{p}{q} \leq 1$. In particular, $\ell_1 \subseteq \ell_2\subseteq \ell_\infty$. 
The metrics $d_1,d_2,d_\infty$ (or more generally, $d_p$, $d_q$ for $1 \leq p\leq q \leq \infty)$
are not equivalent metrics on $\ell_1$, though we do have that $\tau_{d_\infty}\subseteq \tau_{d_2}
\subseteq \tau_{d_1}$ (and more generally $\tau_{d_q} \subseteq \tau_{d_p}$ for $1\leq p \leq q\leq \infty$ 
on $\ell_p$). To see, for example, that the metrics $d_1$ and $d_2$ are not equivalent on $\ell_1$
let $x^n\in \R^\omega$ be the point defined by $x^n_m= \begin{cases} \frac{1}{m} & \text{ if }
m \leq n\\ 0 & \text{ otherwise} \end{cases}$.  Clearly all of the $x^n$ are in $\ell_1$
(so are in all of the $\ell_p$) as their supports are finite. For any $\epsilon>0$, there is an $N$
so that if $m,n \geq N$ then $d_2(x^n,x^m) <\epsilon$, since the series $\sum_i \frac{1}{i^2}$
converges. On the other hand, if we fix $m \geq N$, then if we let $n$ get large enough we 
have that $d_1(x^n,x^m)$ get arbitrarily large (since $\sum_{i>m} \frac{1}{i}$ diverges). 
Using this, it follows that $\{ x^n\}$ is a closed set in $\tau_{d_1}$ but not in $\tau_{d_2}$. 




\end{exam}











\begin{fact}
For any metric $\rho$ on a set $X$,
$B_{\bar{\rho}}(x,\epsilon)=\{ y \colon \rho(x,y)\leq \epsilon\}$ is a closed set.
\end{fact}

\begin{proof}
Let $y \notin B_{\bar{\rho}}(x,\epsilon)$, so $\rho(x,y) >\epsilon$. Let $\delta
=\rho(x,y)-\epsilon>0$. Then $B_\rho(y,\delta)\cap B_{\bar{\rho}}(x,\epsilon)
=\emptyset$. To see this, suppose $z \in B_\rho(y,\delta)\cap B_{\bar{\rho}}(x,\epsilon)$.
Then $\rho(x,y)\leq \rho(x,z)+\rho(z,y) \leq \epsilon +\rho(z,y)<\epsilon +\delta =\rho(x,y)$,
a contradiction.
\end{proof}


Thus, we always have that $\overline{B_\rho(x,\epsilon)} \subseteq B_{\bar{\rho}}(x,\epsilon)$,
but in general we do not have equality. For example, let $\rho$ be the discrete metric
on $X$ and let $\epsilon = 1$. Then $\overline{B_\rho(x,\epsilon)}=\{ x\}$, but
$B_{\bar{\rho}}(x,\epsilon)=X$.


Another example: let $Y=\R^2-S^1 \subseteq \R^2$, and
$\rho$ the standard metric on $\R^2$. Then in the metric space $(Y,\rho)$ we have
$\overline{B_\rho((0,0),1)}=B_\rho((0,0),1)$, so $B_\rho((0,0),1)$ is closed. 
So, the open ball $B_\rho((0,0),1)$ is closed. 



\begin{thm}
For every metric $\rho$ on a set $X$, there is an equivalent metric $\rho'$
on $X$ which is bounded, in fact $\rho'(x,y)\leq 1$.
\end{thm}


\begin{proof}
Let $\rho'(x,y)=\min \{ \rho(x,y),1\}$. To show the triangle inequality:
let $x,y,z \in X$. We must show that $\rho'(x,z)\leq \rho'(x,y)+\rho'(y,z)$.
If (at least) one of $\rho'(x,y)$, $\rho'(y,z)$ is $\geq 1$ then the RHS is $\geq 1$,
and the LHS is $\leq 1$, so the result is immediate. If both 
$\rho'(x,y)$, $\rho'(y,z)$ are $<1$, then $\rho'(x,y)=\rho(x,y)$ and $\rho'(y,z)=\rho(y,z)$.
So, $\rho'(x,z)\leq \rho(x,z) \leq \rho(x,y)+\rho(y,z)=\rho'(x,y)+\rho'(y,z)$. 


To see the metrics are equivalent, first note that $\rho'\leq \rho$,
so $\tau_{\rho'}\subseteq \tau_\rho$. For the other direction,
let $x \in X$ and fix $\epsilon>0$. Let $\delta= \min \{ \epsilon, 1\}$.
If $\rho'(x,y)< \delta$, then since $\delta \leq 1$ we have $\rho'(x,y)=\rho(x,y)$,
so $\rho(x,y) <\delta \leq \epsilon$. So, $B_{\rho'}(x,\delta)
\subseteq B_\rho(x,\epsilon)$. This shows $\tau_\rho \subseteq \tau_{\rho'}$.


\end{proof}



It is also true that we can define $\rho'(x,y)=\frac{\rho(x,y)}{1+\rho(x,y)}$,
and also get an equivalent metric.




\begin{exer}
Show that if $\rho$ is a metric on the set $X$, then so is $\rho'=\frac{\rho}{1+\rho}$.
[hint: in showing the triangle inequality, there are are two ways to proceed. One is purely
algebraic, just multiply both sides of the desired inequality out and see what it becomes.
The other way is use the fact that the function $f(x)=\frac{x}{1+x}$ is increasing and convex.
Show that $f(a+b)\leq f(a)+f(b)$.]
\end{exer}


If $\rho$ is a metric on a set $X$, we extend $\rho$ to define $\rho(x,A)$
for $x \in X$ and $A\subseteq X$ (with $A\neq \emptyset$) as follows:
\[
\rho(x,A)= \inf \{ \rho(x,a)\colon a \in A\}.
\]

\begin{fact}
If $F\subseteq X$ is closed in the $\rho$-metric topology, then
for all $x \in X$ we have that $x\in F$ iff $\rho(x,F)=0$. Conversely,
if $F\subseteq X$ and for all $x \in X$ we have that $x\in F$ iff $\rho(x,F)=0$,
then $F$ is closed.
\end{fact}

\begin{proof}
Suppose $F$ is closed. If $x \in F$ we clearly have that $\rho(x,F)=0$.
If $x \notin F$, then for some $\epsilon >0$ we have $B_\rho(x,\epsilon) \subseteq F^c$.
That is, if $y \in F$, then $\rho(x,y)\geq \epsilon$, and so $\rho(x,F)\geq \epsilon$.

Suppose next that $F\subseteq X$ and for all $x \in X$ we have that $x\in F$ iff $\rho(x,F)=0$.
Suppose $x \in \overline{F}$. Then for any $\epsilon >0$ we have that $B_\rho(x,\epsilon)
\cap F\neq \emptyset$. In particular, this says that $\rho(x,F)\leq \epsilon$ for any
$\epsilon>0$. Thus, $\rho(x,F)=0$. By assumption this means $x \in F$. So,
$\overline{F}=F$ and thus $F$ is closed.
\end{proof}



\begin{exam}
Let $X= \{ 0\} \cup (1,\infty) \subseteq \R$ and let $\rho$ be the restriction of the standard metric on 
$\R$ to $X$. Let $F=(1,\infty)\subseteq X$. Then $F$ is a closed set in $X$. We have that 
$d(x,F)=1$, but $d(x,y)>1$ for all $y \in F$. So, distances to closed sets are not necessarily attained
in metric spaces.
\end{exam}



\begin{exer}
Show that $\rho(y,A)\leq \rho(x,A)+ \rho(x,y)$ for any $A\subseteq X$ (with $A\neq \emptyset$),
$x,y\in X$. Deduce that for any $A$ and $\epsilon>0$ the set
$B_\rho(A,\epsilon)=\{ x\colon \rho(x,A)<\epsilon\}$ is open,
as is the set $\{ x \in X \colon \rho(x,A)>\epsilon\}$. Also, the set
$B_{\bar{\rho}}(A,\epsilon)=\{ x \colon \rho(x,A)\leq \epsilon\}$ is closed, as is
the set $\{ x \in X \colon \rho(x,A)\geq \epsilon\}$.
\end{exer}



\begin{exer}
Show that in every metric space $(X,\rho)$, every open set $U$ is a countable increasing
union of closed sets $U=\bigcup_n F_n$. [hint: define the $F_n$ by considering distances to the
closed set $U^c$.]
\end{exer}




We can further extend a metric $\rho$ on the set $X$ to the non-empty subsets of $X$
by $\rho(A,B)=\inf \{ \rho(a,b)\colon a \in A, b\in B\}$. This is not, however, a metric
in general. In fact, if $X$ has more that two elements it is not a metric:
Let $x,y,z$ be distinct elements of $X$, and let $A=\{ x\}$, $B=\{ x,y\}$, and
$C=\{y,z\}$. Then $\rho(A,B)=0$, $\rho(B,C)=0$, but $\rho(A, C)>0$. 


















\end{document}
