Examples of metric spaces
$(X,d)$ is a metric space in the following:
-
$X=\R$, $d(x,y) = |x-y|$ the usual metric on $\R$.
-
$X=\R^n$
-
$d(x,y) = \sqrt{\sum_{i=1}^{n} |x_i - y_i|^2}$ the $l^2$ metric on $\R^n$.
-
$d(x,y) = \sum_{i=1}^n |x_i - y_i|$ the $l^1$ metric on $\R^n$.
-
$d(x,y) = \sqrt[p]{\sum_{i=1}^{n} |x_i - y_i|^p}$ the $l^p$ metric on $\R^n$, $p\geq 1$.
-
$d(x,y) = \max_{i\in\set{1,2,\ldots,n}} |x_i - y_i|$ the $l^\infty$ metric on $\R^n$.
-
-
$X = l_\infty I := \set{\text{bounded scalar functions } I \to \R}$ where $I\subseteq \R$, $d(f,g) = \sup_{x\in I} |f(x)-g(x)|$ the sup metric.
-
$X = C^0([0,1]) := \set{\text{continuous functions } [0,1]\to \R}$
-
$d(f,g) = \sup_{[0,1]}|f-g|$ the $L^\infty$ metric.
-
$d(f,g) = \left(\int_{0}^{1} |f(x)-g(x)|^p \d x\right)^{1/p}$ the $L^p$ metric.
-
-
$X$ is any set. $$ \begin{align*} d(x,y) = \begin{cases} 0, &\text{if } x = y, \\ 1, &\text{otherwise} \end{cases} \end{align*} $$ is the discrete metric. $(X,d)$ is called a discrete metric space.
-
$X=\N$. For $p$ a prime number, $$ \begin{align*} d_p(x,y) = \begin{cases} 0, &\text{if } y=x, \\ p^{-\nu_p(x-y)}, &\text{otherwise} \end{cases} \end{align*} $$ where $\nu_p(z) = \max\sb{n\in\Z_{\geq 0}}{p^n \text{ divides } z}$. This is the $p$-adic metric. (Derivation)
-
Let $X$ be a connected finite graph. Let $d(x,y)$ be the length of the shortest path between $x$ and $y$.