Norm vs. metric vs. inner product
Norms, metrics, and inner products measure size, distance, and angle, and each one gives the next in a natural way. A norm measures the lengths of vectors, a metric measures distances between points, and an inner product measures both lengths and angles. An inner product gives a norm, and a norm gives a metric, but not the reverse.
An inner product gives a norm, $\norm{x} = \sqrt{\ip{x}{x}}$, and a norm gives a metric, $d(x, y) = \norm{x - y}$.
Definitions
A vector is arrow between two points. Such a vector has a direction and a length. The norm of the vector is its length: how long the arrow is.
Consider a vector $x = (x_1, \dots, x_n)$. The norm of $x$ is its length:
\[\norm{x} = \sqrt{x_1^2 + \dots + x_n^2}.\]Consider a vector space $V$ and a function $\norm{\cdot} : V \to [0, \infty)$. The function is a norm on $V$ if
- $\norm{x} = 0$ only for $x = 0$
- $\norm{c x} = \abs{c} \norm{x}$, and
- $\norm{x + y} \leq \norm{x} + \norm{y}$ (the triangle inequality).
Examples
-
The Euclidean norm $x \mapsto \sqrt{x_1^2 + x_2^2}$ on $\reals^2$
$x \mapsto \sqrt{x_1^2 + x_2^2}$ is a norm: the Euclidean norm, which comes from the dot product.
-
$x \mapsto \abs{x_1} + \abs{x_2}$ on $\reals^2$
$x \mapsto \abs{x_1} + \abs{x_2}$ is a norm.
Non-examples
-
Great-circle distance on the surface of the Earth
Great-circle distance does not come from a norm, because the sphere is not a vector space.
-
$d(x, y) = 1$ for $x \neq y$, and $d(x, x) = 0$
(definition)
The discrete metric does not come from a norm, because it does not scale: $d(2x, 0) = 1 = d(x, 0)$ for every $x \neq 0$.
Properties
- Every norm satisfies $\abs{\norm{x} - \norm{y}} \leq \norm{x - y}$, so it is a continuous function.
- On a finite-dimensional space, all norms are equivalent: they give the same open sets and the same convergent sequences.
A metric is a way of generalizing the concept of distance. Consider a set of points, and a rule that gives a “distance” between every two of them. The rule is a metric if
- no distance is negative,
- the distance is zero only from a point to itself,
- the distance is the same in both directions, and
- no distance is longer than a detour through a third point (the triangle inequality).
Consider a set $X$ and a function $d : X \times X \to [0, \infty)$. The function $d$ is a metric on $X$ if, for all $x, y, z \in X$,
- $d(x, y) = 0$ if and only if $x = y$,
- $d(x, y) = d(y, x)$ (symmetry), and
- $d(x, z) \leq d(x, y) + d(y, z)$ (the triangle inequality).
The last condition is the triangle inequality. The set $X$ need not be a vector space.
Examples
-
$d(x, y) = \sqrt{(x_1 - y_1)^2 + (x_2 - y_2)^2}$ on $\reals^2$
The Euclidean distance is a metric, and it comes from the Euclidean norm, as $d(x, y) = \norm{x - y}$.
-
Great-circle distance on the surface of the Earth
Great-circle distance is a metric on the sphere.
-
$d(x, y) = 1$ for $x \neq y$, and $d(x, x) = 0$
(definition)
The discrete metric is a metric.
An inner product is a way of multiplying two vectors to get a number, generalizing the dot product, that gives a way to measure lengths and angles.
Consider a real vector space $V$ and a function $\ip{\cdot}{\cdot} : V \times V \to \reals$. The function is an inner product if
- it is linear in its first argument: $\ip{a x + y}{z} = a \ip{x}{z} + \ip{y}{z}$ for all $x, y, z \in V$ and $a \in \reals$,
- it is symmetric: $\ip{x}{y} = \ip{y}{x}$ for all $x, y \in V$, and
- it is positive definite: $\ip{x}{x} > 0$ for for all $x \neq 0 in $V$.
Consider a vector space $V$ over $\mathbb{F}$, where $\mathbb{F}$ is $\reals$ or $\mathbb{C}$, and a sesquilinear form $\ip{\cdot}{\cdot}$ on $V$: a function $V \times V \to \mathbb{F}$ that is linear in its first argument and conjugate-linear in its second. The form is an inner product if, for all $x, y \in V$,
- it is Hermitian: $\ip{x}{y} = \overline{\ip{y}{x}}$, and
- it is positive definite: $\ip{x}{x} > 0$ for $x \neq 0$.
Over $\reals$, a sesquilinear form is a bilinear form, and Hermitian means symmetric.
Examples
-
$(x, y) \mapsto 2 x_1 y_1 + x_2 y_2$ on $\reals^2$
$(x, y) \mapsto 2 x_1 y_1 + x_2 y_2$ is an inner product, because it is symmetric and positive definite.
-
$(x, y) \mapsto x_1 y_1 + x_2 y_2$ on $\reals^2$
$(x, y) \mapsto x_1 y_1 + x_2 y_2$ is an inner product: the dot product on $\reals^2$.
Non-examples
-
$x \mapsto \abs{x_1} + \abs{x_2}$ on $\reals^2$
$x \mapsto \abs{x_1} + \abs{x_2}$ does not come from an inner product, because it fails the parallelogram law: with $x = (1, 0)$ and $y = (0, 1)$, $\norm{x + y}^2 + \norm{x - y}^2 = 8$, but $2 \norm{x}^2 + 2 \norm{y}^2 = 4$.
-
$(x, y) \mapsto x_1 y_1 - x_2 y_2$ on $\reals^2$
$(x, y) \mapsto x_1 y_1 - x_2 y_2$ is not an inner product, because it is not positive definite: $(0, 1)$ paired with itself gives $-1$.
Examples
| Example | norm | metric | inner product | Why |
|---|---|---|---|---|
| The Euclidean norm $x \mapsto \sqrt{x_1^2 + x_2^2}$ on $\reals^2$ | ✓ | – | – | The Euclidean norm, which gives the length of a vector in the plane. |
| $x \mapsto \abs{x_1} + \abs{x_2}$ on $\reals^2$ | ✓ | – | ✗ | |
| $d(x, y) = \sqrt{(x_1 - y_1)^2 + (x_2 - y_2)^2}$ on $\reals^2$ | – | ✓ | – | The Euclidean distance between points in the plane. |
| $d(x, y) = 1$ for $x \neq y$, and $d(x, x) = 0$ (definition) | ✗ | ✓ | – | |
| Great-circle distance on the surface of the Earth | ✗ | ✓ | – | |
| $(x, y) \mapsto x_1 y_1 + x_2 y_2$ on $\reals^2$ | – | – | ✓ |
Notes
-
A norm comes from an inner product exactly when it satisfies the parallelogram law,
\[\norm{x + y}^2 + \norm{x - y}^2 = 2 \norm{x}^2 + 2 \norm{y}^2.\] - A metric comes from a norm only if it is translation invariant ($d(x + z, y + z) = d(x, y)$) and scales ($d(c x, c y) = \abs{c} d(x, y)$).
- Each structure needs a different setting. An inner product and a norm are defined only on a (real or complex) vector space, because their definitions add vectors and multiply them by scalars. A metric needs only a set: the discrete metric works on any set, and the great-circle distance works on a sphere, which is not a vector space. So every inner product space is a normed space, and every normed space is a metric space, but a metric space need not have a norm or an inner product.