The set of rational numbers consists of the set of negative rational numbers, the number zero and the set of positive rational numbers. The definition of rational numbers is based on the representation of rational numbers by fractions, i.e. pairs of integers. It is constructed in such a way that arithmetic with rational numbers can be performed as usual using their fraction representations, but at the same time abstracts the rational number from its fraction representations. The rational numbers are not postulated as completely new things, but are traced back to the integers.
The definition starts with the set of all ordered pairs
integers with
. Important: These pairs are not the rational numbers.
One defines addition and multiplication on this set as follows:


These are the well-known calculation rules of the fraction calculation. The pairs of numbers can be understood as fractions.
One goal of the definition of rational numbers is that, for example, the fractions
and
denote the same "number". Thus, one considers fractions that are equivalent (of the same value) to each other. This is expressed by an equivalence relation, which is defined as follows:
.
It is important that this relation is actually an equivalence relation, i.e. that it decomposes the total set into subsets (here called equivalence classes) of mutually equivalent elements; this can be proved.
For the equivalence classes one defines again calculation rules which are based on the fraction calculus and ensure that what one understands by a rational number is abstracted from the concrete fraction representation. The addition
of the equivalence classes
and
is defined as follows:
From
chooses any element, i.e. an ordered pair
integers (thus one chooses a single element of
and not two). Similarly, from
chooses the element
.
and
now added according to the fraction calculus and a pair obtained
. This is an element of an equivalence class
which is the result of the addition.
It is important to note that regardless of the concrete choice of
and
always an element of one and the same equivalence class
, emerges; this property of addition, its well-definiteness, must and can be proved.
Analogously, the multiplication is
defined.
The equivalence classes
are taken to be elements of a new set
and call them rational numbers. A single rational number
is thus an infinite set of ordered pairs
. This set is very often
written as a fraction which is the equivalence class

of all
pairs equivalent to The horizontal or (from top right to bottom left) oblique separator between the two integers is called the fraction bar. The first named integer is the numerator, the second the denominator of the fraction. The denominator is always different from
and can be
positive because of The preferred representation of the rational number
is the (maximally) truncated fraction

with
,
where 
stands for the greatest common divisor of
and Thus the equivalence class
consists exactly of the pairs of integers
.
Identifying the integer
with the rational number
, then one has a number expansion of the integers, which is also called the formation of the quotient body. If
and are
two integers and
,
their sum and product, the calculation rules for fractions are just such, that
and
holds. Moreover, by virtue of this identification, a fraction is in fact the quotient of numerator and denominator. In this sense, the fraction stroke is also
used as an ordinary division sign instead of ÷