Definition:Absolute Value

Definition
Let $x$ be a number.

The absolute value of $x$ is denoted $\left\vert{x}\right\vert$, and is defined as follows:


 * $\left\vert{x}\right\vert = \begin{cases}

x & : x > 0 \\ 0 & : x = 0 \\ -x & : x < 0 \end{cases}$

Note that since $0 = -0$, the value of $\left\vert{x}\right\vert$ at $x = 0$ is often included in one of the other two cases, most commonly:
 * $\left\vert{x}\right\vert = \begin{cases}

x & : x \ge 0 \\ -x & : x < 0 \end{cases}$ but this can be argued as being less symmetrically aesthetic.

Note that the absolute value is functional.

It applies to the various number classes as follows:


 * Natural numbers $\N$: All elements of $\N$ are greater than or equal to zero, so the concept is irrelevant.
 * Integers $\Z$: As defined here.
 * Rational numbers $\Q$: As defined here.
 * Real numbers $\R$: As defined here.
 * Complex numbers $\C$: As $\C$ is not an ordered set, the concept as defined here can not be applied. The notation $\left\vert{z}\right\vert$, where $z \in \C$, is defined as the modulus of $z$ and has a different meaning.

This is sometimes called the modulus or magnitude of $x$, but note that modulus has a more specialized definition in the domain of complex numbers (see above), and that magnitude has a more specialized definition in reference to vectors (see above).

From Even Powers are Positive, it can be seen that $\left\vert{x}\right\vert$ can also be defined as $\left\vert{x}\right\vert = \sqrt {x^2}$.

Ordered Integral Domain
We can go still further back, and consider the general ordered integral domain $\left({D, +, \times}\right)$ whose ordering induced by the postivity property is $\le$.

Then for all $a \in D$, the absolute value of $a$ is defined as:


 * $\left\vert{a}\right\vert = \begin{cases}

a & : 0 \le a \\ -a & : a < 0 \end{cases}$

It is clear that the definition for numbers is compatible with this, from:
 * Integers form Ordered Integral Domain
 * Rational Numbers form Ordered Integral Domain
 * Real Numbers form Ordered Integral Domain

Field
For any field $\left({k, +, \cdot}\right)$, an absolute value on $k$ is a function $\left \vert {\cdot}\right \vert : k \to \R$ satisfying: for all $x, y \in k$.
 * $\left \vert {x}\right \vert \ge 0$ and $\left \vert {x}\right \vert = 0 \iff x = 0$
 * $\left \vert {x \cdot y}\right \vert = \left \vert {x}\right \vert \cdot \left \vert {y}\right \vert$
 * $\left \vert {x + y}\right \vert \le \left \vert {x}\right \vert + \left \vert {y}\right \vert$

The pair $\left({k, \left \vert {\cdot}\right \vert}\right)$ is called a valued field.

This is a special case of a norm.

Therefore, an absolute value defines a metric on $k$ (see Relation to Metrics).

This is given by:
 * $ d \left({x, y}\right) = \left\vert {x - y}\right\vert$

For any field $k$ an absolute value is given by $\left\vert {0} \right\vert = 0$ and $\left\vert {x}\right\vert = 1$ for all $x \in k \backslash \left\{{0}\right\}$. This is called the trivial absolute value on $k$.