Thue's lemma

{{Short description|Representation of modular integers by "small" fractions}}

{{about|modular arithmetic|Thue's theorem on Diophantine approximations|Roth's theorem#Discussion}}

In modular arithmetic, 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 of the modulus.

More precisely, for every pair of integers {{math|(a, m)}} with {{math|m > 1}}, given two positive integers {{math|X}} and {{math|Y}} such that {{math|Xm < XY}}, there are two integers {{mvar|x}} and {{mvar|y}} such that

:ay \equiv x \pmod{m}

and

:|x| < X,\quad 0 < y < Y.

Usually, one takes {{math|X}} and {{math|Y}} equal to the smallest integer greater than the square root of {{math|m}}, but the general form is sometimes useful, and makes the uniqueness theorem (below) easier to state.{{cite book|last1=Shoup|first1=Victor|title=A Computational Introduction to Number Theory and Algebra|date=2005|publisher=Cambridge University Press|url=http://shoup.net/ntb/ntb-v2.pdf|accessdate=26 February 2016}} Theorem 2.33.

The first known proof is attributed to {{harvs|txt|first=Axel |last=Thue|authorlink=Axel Thue|year=1902}}{{cite journal|first=A.|last= Thue|title= Et par antydninger til en taltheoretisk metode |journal= Kra. Vidensk. Selsk. Forh.|volume= 7 |year=1902|pages=57–75}} who used a pigeonhole argument.{{cite book

| last1 = Aigner | first1 = Martin | author1-link = Martin Aigner

| last2 = Ziegler | first2 = Günter M. | author2-link = Günter M. Ziegler

| doi = 10.1007/978-3-662-57265-8

| edition = 6th

| isbn = 978-3-662-57265-8

| page = 21

| publisher = Springer

| title = Proofs from THE BOOK

| year = 2018}} It can be used to prove Fermat's theorem on sums of two squares by taking m to be a prime p that is congruent to 1 modulo 4 and taking a to satisfy a2 + 1 ≡ 0 mod p. (Such an "a" is guaranteed for "p" by Wilson's theorem.{{cite book|first=Oystein|last=Ore|title=Number Theory and its History|pages=262–263|year=1948}})

Uniqueness

In general, the solution whose existence is asserted by Thue's lemma is not unique. For example, when {{math|1=a = 1}} there are usually several solutions {{math|1=(x, y) = (1, 1), (2, 2), (3, 3), ...}}, provided that {{math|X}} and {{math|Y}} are not too small. Therefore, one may only hope for uniqueness for the rational number {{math|{{sfrac|x|y}}}}, to which {{mvar|a}} is congruent modulo {{mvar|m}} if y and m are coprime. Nevertheless, this rational number need not be unique; for example, if {{math|1=m = 5}}, {{math|1=a = 2}} and {{math|1= X = Y = 3}}, one has the two solutions

:2a+1 \equiv -a+2 \equiv 0 \pmod 5.

However, for {{math|X}} and {{math|Y}} small enough, if a solution exists, it is unique. More precisely, with above notation, if

:2XY < m,

and

:ay_1-x_1\equiv ay_2-x_2 \equiv 0 \pmod m,

with

:\left | x_1\right |< X, \quad\left| y_1\right| < Y,

and

:\left| x_2\right| < X, \quad\left| y_2\right| < Y,

then

:\frac{x_1}{y_1}=\frac{x_2}{y_2}.

This result is the basis for rational reconstruction, which allows using modular arithmetic for computing rational numbers for which one knows bounds for numerators and denominators.{{sfn|Shoup|2005|loc=Section 4.6}}

The proof is rather easy: by multiplying each congruence by the other {{math|yi}} and subtracting, one gets

:y_2x_1-y_1x_2 \equiv 0 \pmod m.

The hypotheses imply that each term has an absolute value lower than {{math|XY < {{sfrac|m|2}}}}, and thus that the absolute value of their difference is lower than {{mvar|m}}. This implies that y_2x_1-y_1x_2 =0, 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, allows us to provide a proof that leads to an efficient algorithm that has the same computational complexity of the Euclidean algorithm.{{sfn|Shoup|2005|loc=Section 4.5}}

More precisely, given the two integers {{mvar|m}} and {{mvar|a}} appearing in Thue's lemma, the extended Euclidean algorithm computes three sequences of integers {{math|(ti)}}, {{math|(xi)}} and {{math|(yi)}} such that

:t_im+y_ia =x_i \quad \text{for } i=0, 1, ...,

where the {{math|xi}} are non-negative and strictly decreasing. The desired solution is, up to the sign, the first pair {{math|(xi, yi)}} such that {{math|xi < X}}.

See also

==References==

{{Reflist}}

Category:Lemmas in number theory

Category:Modular arithmetic