In
modular arithmetic
In mathematics, modular arithmetic is a system of arithmetic for integers, where numbers "wrap around" when reaching a certain value, called the modulus. The modern approach to modular arithmetic was developed by Carl Friedrich Gauss in his bo ...
, Thue's lemma roughly states that every modular integer may be represented by a "modular fraction" such that the numerator and the denominator have
absolute values not greater than the
square root
In mathematics, a square root of a number is a number such that ; in other words, a number whose ''square'' (the result of multiplying the number by itself, or ⋅ ) is . For example, 4 and −4 are square roots of 16, because .
...
of the modulus.
More precisely, for every pair of
integer
An integer is the number zero (), a positive natural number (, , , etc.) or a negative integer with a minus sign ( −1, −2, −3, etc.). The negative numbers are the additive inverses of the corresponding positive numbers. In the language ...
s with , given two positive integers and such that , there are two integers and such that
:
and
:
Usually, one takes and equal to the smallest integer greater than the square root of , but the general form is sometimes useful, and makes the uniqueness theorem (below) easier to state.
The first known proof is attributed to who used a
pigeonhole argument.
It can be used to prove
Fermat's theorem on sums of two squares
In additive number theory, Fermat's theorem on sums of two squares states that an odd prime ''p'' can be expressed as:
:p = x^2 + y^2,
with ''x'' and ''y'' integers, if and only if
:p \equiv 1 \pmod.
The prime numbers for which this is tr ...
by taking ''m'' to be a
prime
A prime number (or a prime) is a natural number greater than 1 that is not a product of two smaller natural numbers. A natural number greater than 1 that is not prime is called a composite number. For example, 5 is prime because the only way ...
''p'' that is
congruent
Congruence may refer to:
Mathematics
* Congruence (geometry), being the same size and shape
* Congruence or congruence relation, in abstract algebra, an equivalence relation on an algebraic structure that is compatible with the structure
* In mod ...
to 1 modulo 4 and taking ''a'' to satisfy ''a''
2 + 1 = 0 mod ''p''. (Such an "''a''" is guaranteed for "''p''" by
Wilson's theorem
In algebra and number theory, Wilson's theorem states that a natural number ''n'' > 1 is a prime number if and only if the product of all the positive integers less than ''n'' is one less than a multiple of ''n''. That is (using the notations of ...
.)
Uniqueness
In general, the solution whose existence is asserted by Thue's lemma is not unique. For example, when there are usually several solutions , provided that and are not too small. Therefore, one may only hope for uniqueness for the
rational number
In mathematics, a rational number is a number that can be expressed as the quotient or fraction of two integers, a numerator and a non-zero denominator . For example, is a rational number, as is every integer (e.g. ). The set of all ra ...
, to which is congruent modulo if ''y'' and ''m'' are
coprime
In mathematics, two integers and are coprime, relatively prime or mutually prime if the only positive integer that is a divisor of both of them is 1. Consequently, any prime number that divides does not divide , and vice versa. This is equival ...
. Nevertheless, this rational number need not be unique; for example, if , and , one has the two solutions
:
.
However, for and small enough, if a solution exists, it is unique. More precisely, with above notation, if
:
and
:
,
with
:
and
:
then
:
This result is the basis for
rational reconstruction
Rational reconstruction is a philosophical term with several distinct meanings. It is found in the work of Jürgen Habermas and Imre Lakatos.
Habermas
For Habermas, rational reconstruction is a philosophical and linguistic method that systemat ...
, which allows using modular arithmetic for computing rational numbers for which one knows bounds for numerators and denominators.
The proof is rather easy: by multiplying each congruence by the other and subtracting, one gets
:
The hypotheses imply that each term has an absolute value lower than , and thus that the absolute value of their difference is lower than . This implies that
, hence the result.
Computing solutions
The original proof of Thue's lemma is not efficient, in the sense that it does not provide any fast method for computing the solution.
The
extended Euclidean algorithm
In arithmetic and computer programming, the extended Euclidean algorithm is an extension to the Euclidean algorithm, and computes, in addition to the greatest common divisor (gcd) of integers ''a'' and ''b'', also the coefficients of Bézout's ...
, allows us to provide a proof that leads to an efficient algorithm that has the same
computational complexity
In computer science, the computational complexity or simply complexity of an algorithm is the amount of resources required to run it. Particular focus is given to computation time (generally measured by the number of needed elementary operations) ...
of the
Euclidean algorithm
In mathematics, the Euclidean algorithm,Some widely used textbooks, such as I. N. Herstein's ''Topics in Algebra'' and Serge Lang's ''Algebra'', use the term "Euclidean algorithm" to refer to Euclidean division or Euclid's algorithm, is an ...
.
[Shoup, section 4.5]
More precisely, given the two integers and appearing in Thue's lemma, the extended Euclidean algorithm computes three sequences of integers , and such that
:
where the are non-negative and strictly decreasing. The desired solution is, up to the sign, the first pair such that .
See also
*
Padé approximant
In mathematics, a Padé approximant is the "best" approximation of a function near a specific point by a rational function of given order. Under this technique, the approximant's power series agrees with the power series of the function it is a ...
, a similar theory, for approximating
Taylor series
In mathematics, the Taylor series or Taylor expansion of a function is an infinite sum of terms that are expressed in terms of the function's derivatives at a single point. For most common functions, the function and the sum of its Taylor se ...
by
rational function
In mathematics, a rational function is any function that can be defined by a rational fraction, which is an algebraic fraction such that both the numerator and the denominator are polynomials. The coefficients of the polynomials need not be ...
s
References
*
{{Reflist
Lemmas in number theory
Modular arithmetic