# Metric spaces

A metric space is a nonempty set ${X}$ along with a function ${d:X\times X\rightarrow\mathbb R}$ such that

• ${d(x,y)\geqslant 0}$, with equality iff ${x=y}$.
• ${d(x,y) = d(y,x)}$
• ${d(x,z) \leqslant d(x,y) + d(y,z)}$.

Given a point ${x\in }$ and a positive number ${\varepsilon}$, the open ball centered at ${x}$ with radius ${\varepsilon}$ is

$\displaystyle B(x,\varepsilon) = \{y\in X: d(x,y) < \varepsilon \},$

and the closed ball centered at ${x}$ with radius ${\varepsilon}$ is

$\displaystyle \overline{B(x,\varepsilon)} = \{y\in X: d(x,y) \leqslant\varepsilon \}.$

A set ${U\subset X}$ is said to be open if for each ${x\in U}$, there exists ${\varepsilon_x>0}$ such that ${B(x,\varepsilon_x)\subset U}$. A set ${F\subset X}$ is said to be closed if ${F^c=\{x\in X: x\notin F\}}$ is open.

Theorem 1 An open ball is an open set.

Proof: Let ${x\in X}$ and ${\varepsilon>0}$, and let ${y\in B(x,\varepsilon)}$. Put ${\delta=\varepsilon - d(x,y)}$. Then if ${d(y,z)<\delta}$,

$\displaystyle d(x,z) \leqslant d(x,y) + d(y,z) < d(x,y) + (\varepsilon - d(x,y)) = \varepsilon,$

so that ${B(x,\varepsilon)}$ is open. $\Box$

Theorem 2 If ${X}$ is a metric space, then ${\varnothing}$ and ${X}$ are open, the union of any collection of open sets is open, and the intersection of finitely many closed sets is open.

Proof: It is clear that ${\varnothing}$ is open, as there is no ${x\in\varnothing}$. Since ${B(x,\varepsilon)\subset X}$ for any ${x\in X, \varepsilon>0}$, ${X}$ is open.

Let ${\{U_\alpha\}_{\alpha\in I}}$ be a collection of open sets in ${X}$. Put ${U=\bigcup_{\alpha\in I}U_\alpha}$. If ${x\in U}$, then ${x\in U_\beta}$ for some ${\beta\in I}$. Since ${U_\beta}$ is open, there exists ${\varepsilon_x}$ such that ${B(x,\varepsilon_x)\subset U_\beta\subset U}$. Hence ${U}$ is open.

Let ${U_1, U_2}$ be open sets in ${X}$. If ${x\in U_1,U_2}$ then there exist ${\varepsilon_1, \varepsilon_2}$ such that ${B(x,\varepsilon_1)\subset U_1}$ and ${B(x,\varepsilon_2)\subset U_2}$. Put ${\varepsilon = \min\{\varepsilon_1, \varepsilon_2\}}$, then ${B(x,\varepsilon)\subset (U_1\cap U_2)}$, so that ${U_1\cap U_2}$ is closed. The general result follows from induction. $\Box$