# Comparison (numbers)

The order of the real numbers is illustrated by the number line . To the right the numbers get bigger, to the left they get smaller.

In mathematics , numbers from certain number ranges, such as natural , whole , rational or real numbers , can be compared in a fixed way . Comparison symbols are used for this in mathematical formulas . One writes something like:

• ${\ displaystyle x : The number is smaller than the number , e.g. B. the inequality holds .${\ displaystyle x}$${\ displaystyle y}$ ${\ displaystyle 1 <2}$
• ${\ displaystyle x> y}$: The number is greater than the number , e.g. B. applies .${\ displaystyle x}$${\ displaystyle y}$${\ displaystyle 2> 1}$
• ${\ displaystyle x \ leq y}$: The number is less than or equal , e.g. B. applies and .${\ displaystyle x}$ ${\ displaystyle y}$${\ displaystyle 1 \ leq 1}$${\ displaystyle 1 \ leq 2}$
• ${\ displaystyle x \ geq y}$: The number is greater than or equal , e.g. B. apply and .${\ displaystyle x}$ ${\ displaystyle y}$${\ displaystyle 1 \ geq 1}$${\ displaystyle 2 \ geq 1}$

These respective comparisons give those number ranges an order structure . The equality or inequality of numbers can also be viewed independently of this order, see Identity and Equality .

## Different comparisons

The tests set forth four are no independent relations : Each of them can be expressed through each other, so it is justified in spite of the various comparisons of the order of natural, real numbers, etc. to speak. For example, the other comparisons can be expressed using the relation as follows : ${\ displaystyle <}$

• ${\ displaystyle x \ leq y}$applies if and only if not applies.${\ displaystyle y
• ${\ displaystyle x> y}$applies if and only if applies.${\ displaystyle y
• ${\ displaystyle x \ geq y}$applies if and only if not applies.${\ displaystyle x

Equality and inequality are also clearly defined by each of the four comparisons, but the comparisons cannot be expressed in terms of equality or inequality alone. For example:

• ${\ displaystyle x = y}$if and only if neither still applies.${\ displaystyle x ${\ displaystyle y
• ${\ displaystyle x \ neq y}$applies if and only if applies or applies.${\ displaystyle x ${\ displaystyle y

## definition

On the number line, larger numbers are to the right.

On the natural numbers, the comparison can be defined using the successor function as the minimum relation that fulfills the following properties: ${\ displaystyle \ leq}$ ${\ displaystyle a \ mapsto a + 1}$

• Is so is .${\ displaystyle a = b}$${\ displaystyle a \ leq b}$
• Is the successor of and , so is .${\ displaystyle c}$${\ displaystyle b}$${\ displaystyle a \ leq b}$${\ displaystyle a \ leq c}$

In other words, is if and not greater than if of from by means of the successor function attainable is. ${\ displaystyle a}$${\ displaystyle b}$${\ displaystyle b}$${\ displaystyle a}$

In von Neumann's model of natural numbers is defined as (i.e., the set is an element of ) and by (i.e., is a subset of ). ${\ displaystyle a ${\ displaystyle a \ in b}$ ${\ displaystyle a}$${\ displaystyle b}$${\ displaystyle a \ leq b}$${\ displaystyle a \ subseteq b}$${\ displaystyle a}$${\ displaystyle b}$

The following definition of is possible for whole numbers : ${\ displaystyle a \ leq b}$

• Are and both non-negative, true if and only if for and natural numbers applies construed as.${\ displaystyle a}$${\ displaystyle b}$${\ displaystyle a \ leq b}$${\ displaystyle a \ leq b}$${\ displaystyle a}$${\ displaystyle b}$
• Is negative and not so is .${\ displaystyle a}$${\ displaystyle b}$${\ displaystyle a \ leq b}$
• Is negative and not, it is not .${\ displaystyle b}$${\ displaystyle a}$${\ displaystyle a \ leq b}$
• If and are both negative, then if and only applies.${\ displaystyle a}$${\ displaystyle b}$${\ displaystyle a \ leq b}$${\ displaystyle -b \ leq -a}$

Rational numbers can be represented as a fraction . So let two rational numbers be given by fractions and (let whole numbers and positive natural numbers). Then is defined by . ${\ displaystyle \ textstyle {\ frac {a_ {0}} {a_ {1}}}}$${\ displaystyle \ textstyle {\ frac {b_ {0}} {b_ {1}}}}$${\ displaystyle a_ {0}, b_ {0}}$${\ displaystyle a_ {1}, b_ {1}}$${\ displaystyle \ textstyle {\ frac {a_ {0}} {a_ {1}}} \ leq \ textstyle {\ frac {b_ {0}} {b_ {1}}}}$${\ displaystyle a_ {0} \ cdot b_ {1} \ leq b_ {0} \ cdot a_ {1}}$

In terms of order theory, the real numbers can be defined as Dedekind cuts of rational numbers. If , subsets of the rational numbers, subsets of the real numbers (that is, or is the set of all rational numbers smaller than or ), then if and only if a subset of is. ${\ displaystyle \ alpha, \ beta}$${\ displaystyle a, b}$${\ displaystyle \ alpha}$${\ displaystyle \ beta}$${\ displaystyle a}$${\ displaystyle b}$${\ displaystyle a \ leq b}$${\ displaystyle \ alpha}$ ${\ displaystyle \ beta}$

Real numbers can be as Cauchy sequences of rational numbers represent . Let and be rational Cauchy sequences representing the real numbers and respectively. It then applies if and only if (i.e. the equivalence of the two Cauchy sequences) or applies to all but a finite number . ${\ displaystyle (a_ {n})}$${\ displaystyle (b_ {n})}$${\ displaystyle a}$${\ displaystyle b}$${\ displaystyle a \ leq b}$${\ displaystyle a = b}$${\ displaystyle n \ in \ mathbb {N}}$ ${\ displaystyle a_ {n} \ leq b_ {n}}$

## Common organizational properties

For numbers with and also always applies . This property is called the transitivity of . In addition, either or or always applies . This property is called a trichotomy . On the basis of these two properties of the order on said number ranges, one abstracts in mathematics and calls every relation of mathematical objects that fulfills these two properties a strict total order . In this sense there is also a strict total order. Irreflexibility also follows from these properties : No number from the respective number range applies . The asymmetry also follows : if it applies , then it does not apply. ${\ displaystyle x, y, z}$${\ displaystyle x ${\ displaystyle y ${\ displaystyle x ${\ displaystyle <}$${\ displaystyle x ${\ displaystyle y ${\ displaystyle x = y}$${\ displaystyle>}$${\ displaystyle x}$${\ displaystyle x ${\ displaystyle x ${\ displaystyle y

Transitivity also applies to: If and , then also always applies . Another property is reflexivity : The following applies to any number from the respective number range . The relation is antisymmetric : For cannot hold for at the same time and . The property that at least or hold for every two numbers is called totality. Again abstracting, every relation that fulfills these properties is called a total order . These properties apply analogously to , which thus also forms a total order. ${\ displaystyle \ leq}$${\ displaystyle x \ leq y}$${\ displaystyle y \ leq z}$${\ displaystyle x \ leq z}$${\ displaystyle x}$${\ displaystyle x \ leq x}$${\ displaystyle \ leq}$${\ displaystyle x \ neq y}$${\ displaystyle x \ leq y}$${\ displaystyle y \ leq x}$${\ displaystyle x, y}$${\ displaystyle x \ leq y}$${\ displaystyle y \ leq x}$${\ displaystyle \ geq}$

## Compatibility with arithmetic structure

From follows${\ displaystyle x ${\ displaystyle x + a

The order of natural, real, etc. numbers is compatible with addition : If and is any such number, then also applies . Conversely, it follows from also and thus . If the subtraction is defined (which is not the case for the natural numbers, but for the whole , the rational and the real numbers), then if and only if . Analog exactly when . The comparison between and is therefore determined by whether the difference is positive or negative . ${\ displaystyle x ${\ displaystyle a}$${\ displaystyle x + a ${\ displaystyle x + a ${\ displaystyle x + a + (- a) ${\ displaystyle x ${\ displaystyle x ${\ displaystyle yx> 0}$${\ displaystyle x> y}$${\ displaystyle yx <0}$${\ displaystyle x}$${\ displaystyle y}$

The formation of the additive inverse , i.e. H. the mapping that assigns the number to each number (geometrically speaking, a reflection ), on the other hand, is not compatible with the order. Rather, it applies precisely when . ${\ displaystyle x}$${\ displaystyle -x}$${\ displaystyle x ${\ displaystyle -x> -y}$

In the case of multiplication, a distinction is necessary: ​​The compatibility applies completely analogously to multiplication with a positive number. A two-sided multiplication with zero, on the other hand, always leads to equality: for any number . For and , therefore, there is at least a compatibility with the multiplication of non-negative numbers: If and if it is not negative, then also applies . However, the reverse does not necessarily follow from this inequality . Multiplication by a negative number, on the other hand, can be expressed as the above reflection followed by multiplication by a positive number (e.g. ). Thus, the inequality holds for two numbers with and negative . ${\ displaystyle x \ cdot 0 = y \ cdot 0}$${\ displaystyle x, y}$${\ displaystyle \ leq}$${\ displaystyle \ geq}$${\ displaystyle x \ leq y}$${\ displaystyle a}$${\ displaystyle x \ cdot a \ leq y \ cdot a}$${\ displaystyle x \ leq y}$${\ displaystyle x \ cdot (-2) = x \ cdot (-1) \ cdot 2 = (- x) \ cdot 2}$${\ displaystyle x, y}$${\ displaystyle x ${\ displaystyle a}$${\ displaystyle x \ cdot a> y \ cdot a}$

For the mathematical abstraction of these compatibility properties, see ordered body .

## Special properties of the respective orders

The orders presented here on the natural, the whole, the rational and the real numbers have certain properties that are independent of the arithmetic structure, but do not apply to any total orders.

The order on the natural numbers has a minimum , the number (in some definitions also , here for the sake of simplicity it is always contained in the natural numbers). Every natural number has a successor ; H. a minimum number greater than . This is just the number . ${\ displaystyle \ mathbb {N}}$${\ displaystyle 0}$${\ displaystyle 1}$${\ displaystyle 0}$${\ displaystyle x}$${\ displaystyle y}$${\ displaystyle x}$${\ displaystyle x + 1}$

• The order of is a discrete one .${\ displaystyle \ mathbb {N}}$
• The natural numbers are unlimited (upwards) - there is no maximum natural number.
• It is the only natural number that has no predecessor.${\ displaystyle 0}$
• The natural numbers are well ordered ; H. every non- empty subset of the natural numbers has a minimum.

The whole numbers also form a discrete order. In them each element has a predecessor and a successor . There is also no maximum, but also no minimum element. They are therefore no longer well-ordered. ${\ displaystyle \ mathbb {Z}}$${\ displaystyle x}$${\ displaystyle x-1}$${\ displaystyle x + 1}$

The rational numbers do not form a discrete order: in the rational numbers no number has a predecessor or a successor, much more lies between every two rational numbers (at least) a third rational number, e.g. with . The rational numbers thus form a dense order . ${\ displaystyle \ mathbb {Q}}$${\ displaystyle x ${\ displaystyle y: = {\ tfrac {x + z} {2}},}$${\ displaystyle x

The real numbers also form a dense order. An additional important property is the supremum property or order completeness : Every limited subset has a supremum and an infimum , i.e. H. a smallest upper or a largest lower bound. The natural numbers lie confinally in the rational and even the real numbers, i.e. That is, for every real number there is a natural number that is at least as large. The order on the real numbers thus has countable connectivity . The orders each induce an order topology . Concerning. According to the order topology of the real numbers, the rational numbers lie close to the real numbers.

## calculation

Using place value systems , natural numbers can be represented as sequences of digits . Using such representations, two natural numbers can be compared, i. That is, it can be calculated whether the number represented by one sequence of digits is smaller than the other. Two natural numbers and by their respective digit strings without leading zeros added to a priority system, if and only if ${\ displaystyle a}$${\ displaystyle b}$${\ displaystyle a

• the sequence of digits is too shorter than that for or${\ displaystyle a}$${\ displaystyle b}$
• both are of the same length and the sequence of digits is too lexicographically smaller than zu .${\ displaystyle a}$ ${\ displaystyle b}$

The lexicographic comparison is based on the comparison of single-digit numbers. Using place value systems, natural numbers are also displayed in modern digital computers , based on which comparisons are possible. The numbers with which arithmetic-logical units of such computers can deal directly have fixed sizes , i.e. contain leading zeros, so that a comparison is possible according to the lexicographical order. Using the above definition of the order, comparisons of any whole or rational numbers can also be calculated. When representing rational numbers in scientific notation , two numbers can be compared by first comparing the exponent and then, if the exponent is the same for both, the mantissa . This applies in particular to floating point numbers representing dyadic fractions , which are often used on digital computers for - especially approximate  - calculations. Many processors ( e.g. those based on x86 ) provide their own instructions for comparing integer and floating point numbers .

Since the real numbers form an uncountable set, there is no scheme according to which all real numbers can be represented. The question of a general calculation rule for comparison is thus also superfluous . An important basic approach is to represent certain real numbers using calculation rules that can calculate any precise upper and lower bounds for the number in the form of rational numbers, for example by gradually calculating further decimal places. This leads to the concept of the calculable number . Two different calculable numbers can be compared by calculating ever more precise upper and lower bounds for both until the two intervals are separated from each other (see interval arithmetic ). In contrast, the equality of two numbers shown in this way cannot be calculated , so the other comparisons cannot be calculated for possibly identical numbers. For many applications it is sufficient, for example in numerical analysis , to allow a tolerance, i. H. the comparison is carried out correctly as long as the distance between the two numbers is greater than a fixed tolerance that can be selected as small as desired, otherwise the numbers are considered to be the same. Such a comparison can be calculated for general calculable numbers. In important special cases, however, an exact comparison is also possible: Algebraic numbers can be represented by polynomials with integer coefficients whose zero they are, and an interval with a rational minimum and maximum that defines the respective zero. In an algebraic way, it can now be determined for two numbers represented in this way whether they are the same by determining common zeros. These are precisely determined by the greatest common divisor of the two polynomials. In the case of inequality, the comparison can again be carried out using upper and lower bounds. These also allow the algebraic calculation to be dispensed with if the inequality has already been proven by calculated bounds. Assuming that Schanuel's previously unproven conjecture applies, an algorithm was also constructed that calculates comparisons also for numbers that are given as zeros of systems of equations that can contain elementary functions . For algebraic numbers that are given as square root expressions or as zeros of low- degree polynomials , special methods of comparison exist.

Such methods for exact comparisons find use in computer algebra systems and algorithmic geometry .

## Relation to arithmetic

In natural numbers, the order can be used to define the as the minimum element. A definition of the successor function , i.e. the successor to every number, is possible accordingly . By means of Sukzessorfunktion can be recursively the arithmetic operations like addition and multiplication defined. In all, rational and real numbers, however no element is distinguished by the order, which is why the arithmetic operations (which as always as a neutral element would distinguish the addition) can not be defined by the order. ${\ displaystyle 0}$${\ displaystyle 0}$

Conversely, however, in all these cases the order can be defined using arithmetic. In the case of natural numbers, an elementary definition is possible solely by means of addition (i.e. in Presburger arithmetic ): It applies if and only if there exists with . In the whole, the rational and the real numbers, an unambiguous definition by means of addition alone is not possible, because the mapping in the respective number range is a group automorphism in the respective additive group, which, however, is not compatible with the order. With the addition of the multiplication, i. H. in the respective ring structure , on the other hand, an elementary definition of the order is also possible. This is particularly easy in the real numbers and more generally in every Euclidean field : because there the non-negative numbers are characterized precisely by the fact that they have a square root . This gives the following definition: ${\ displaystyle x \ leq y}$${\ displaystyle a \ in \ mathbb {N}}$${\ displaystyle x + a = y}$${\ displaystyle x \ mapsto -x}$

${\ displaystyle x \ leq y: \ Leftrightarrow \ exists a: x + a \ cdot a = y}$

A corresponding definition is possible in the whole numbers using the four-squares theorem : A whole number is not negative if and only if it can be represented as the sum of four square numbers. This provides the definition

${\ displaystyle x \ leq y: \ Leftrightarrow \ exists a, b, c, d: x + a \ cdot a + b \ cdot b + c \ cdot c + d \ cdot d = y}$,

which can be transferred to the rational numbers (a rational number is not negative if and only if it is the quotient of two sums of four square numbers ).

## Extensions

• The real numbers can be the hyper real numbers expand , which also has a friendly with the addition and multiplication order, but again have other proper theoretical properties.
• The natural numbers can be expanded to cardinal numbers and ordinal numbers , which are still well ordered.
• The surreal numbers form another number range provided with an order.