Distance
A distance $d$ on a set $X$ is a map
$$
d:X\times X\to[0,\infty)
$$
such that:
-
$d(x,y)=0$ iff $x=y$;
-
$d(x,y)=d(y,x)$ for all $x,y\in X$;
-
$d(x,y)+d(y,z)\geq d(x,z)$ for all $x,y,z\in X$.
Natural topology on $(X,d)$
We set
$$
B_r(x) =\left\{y\in X|d(x,y) < r\right\}
$$
and we call it ball of radius $r$ centered at $x$.
We say that a set $U_x$ is a neighborhood of $x$ if it contains
a ball of some positive radius centered at $x$ and we say that
a set $U$ is open if it contains a neighborhood of each
of its point.
The set of all open sets of a metric space satisfies the axioms
for a topology and so defines a topology on $X$. This is the weakest
topology that makes $d$ continuous (namely it is the intersection of
all topologies that make $d$ continuous).
Exercise
Examples
To be done, I accept volunteers :-)
Complete metric spaces
We say that a sequence $\{x_n\}$ is Cauchy when,
for every $\epsilon>0$, there is a $N$ s.t.
$$
d(x_n,x_m) < \epsilon
$$
for all $n,m\geq N$.
We say that $(X,d)$ is complete when all of its Cauchy sequences
converge in $X$.
The set of rationals $\Bbb Q$ is a metric space with respect to
the distance $d(r,s)=|r-s|$ but it is not complete. For instance,
the sequence $\{r_k\}$, where $r_k$ is the truncation of $\sqrt{2}$
in decimal to the $k$-th digit, is clearly Cauchy (prove it!) but
it does not converge to any rational.
Complete metric spaces
The set of real numbers $\Bbb R$ is a complete metric space with
respect to the distance $d(r,s)=|r-s|$.
Every Cauchy sequence is bounded (prove it!) and so (by Bolzano-Weierstrass)
it has at least an accumulation point. Since Cauchy sequences cannot have
more than one accumulation point (prove it!), the sequence converges.
Completion of a metric space
Given any metric space $(X,d)$, there is a complete metric
space $(\hat X,\hat d)$ and an injection $i:X\to\hat X$ such that:
-
$\hat d(i(x),i(y)) = d(x,y)$ for all $x,y\in X$;
-
$i(X)$ is dense in $\hat X$;
-
$\hat X$ is unique modulo homeomorphisms.
TBW
The completion of $\Bbb Q$ with the "absolute value" distance
is $\Bbb R$ with the same distance.
An exotic example: $p$-adic spaces
Every rational number $r$ writes as $r=\Pi_{n=1}^\infty p_n^{a_n}$,
where $p_1,p_2,\dots$ is the list of all prime numbers and the $a_i$ are integers
(almost all of the $a_n$ are of course equal to zero).
This decomposition is unique. We denote by $ord_p r$ the exponent of $p$
in the decomposition of $r$. The function
$$
d_p(r,s) = \begin{cases}p^{-ord_p(r-s)}&,r\neq s\\ 0&,r=s\\\end{cases}
$$
is a metric on $\Bbb Q$ (prove it!).
Moreover, $\Bbb Q$ is not complete with respect to any of this norms.
The relative completions are the sets $\Bbb Q_p$ of p-adic numbers,
each of which is therefore a sort of "alternate version" of the set of real numbers.
If you are curious about these spaces, a good reference on the topology
of the $\Bbb Q_p$ is
this set of notes from ETH (Swisse).
A few fundamental results
Continuous functions are enough to separate closed sets:
(Urysohn Lemma) Let $A,B$ two closed non-empty disjoint subsets of $(X,d)$.
Then there exists a continous function $f:X\to[0,1]$ s.t.
- $f|_A=0$;
- $f|_B=1$;
- $f(x)\in(0,1)$ for all $x\in X\setminus(A\cup B)$.
Continuous functions defined on any closed subset can be extended to the whole space:
(Tietze extension thm) Let $A$ be a closed bounded subset of $(X,d)$
and $f:A\to[a,b]$ a continuous functions. Then there is a continuous
function $g:X\to[a,b]$ s.t. $g|_A=f$.