Courses
Courses for Kids
Free study material
Offline Centres
More
Store Icon
Store

Lagrange's Four-Square Theorem

Reviewed by:
ffImage
hightlight icon
highlight icon
highlight icon
share icon
copy icon
SearchIcon

An Introduction to Lagrange's Four-Square Theorem

According to Lagrange's four-square theorem, also referred to as Lagrange's theorem, every positive integer can be expressed as the sum of squares of four non-negative numbers. Thus, the squares constitute an order of four additive bases. Fermat used infinite descent to demonstrate the theorem, but the proof was disregarded. The theorem could not be validated by Euler. Lagrange provided the initially published proof. Lagrange's Four-Square Theorem will be covered in this session.


History of the Joseph-Louis Lagrange

Joseph-Louis Lagrange, sometimes known as Giuseppe Luigi Lagrange or Lagrangian, was a mathematician and astronomer from Italy who eventually acquired French citizenship. Analysis, number theory, and both classical and celestial mechanics all benefited from his substantial contributions. In 1770, he released the original proof of the four-square theorem.


Joseph-Louis Lagrange


Joseph-Louis Lagrange


Lagrange's Theorem Statement

According to Lagrange's four-square theorem, commonly known as Bachet's conjecture, every natural number can be written as the sum of four integer squares. In other words, the squares create a four-order additive basis.


Lagrange's Theorem Formula

According to the Lagrange theorem,

\[p = a_0^2 + a_1^2 + a_2^2 + a_3^2\]

where the four numbers \[{a_0},{a_1},{a_2},{a_3}\] are integers.


Lagrange Theorem Proof

The Classical Proof:

Every odd prime integer p can be used to prove the theorem. This naturally results from Euler's identity of a four-square (and from the fact that the theorem is true for the numbers 1 and 2).


Every a between 0 and \[\dfrac{{\;\left( {p\; - 1} \right)}}{2}\] has a different set of residues for a2 modulo p (inclusive). Take some a and define c as a2 mod p to show this. The polynomial \[{x^2} - c\;\] over the field \[\dfrac{Z}{{pZ}}\] has a root called a. Likewise, p - a (which is different from a). There are no other polynomials with this property, especially not among 0 to \[\dfrac{{\;\left( {p\; - 1} \right)}}{2}\], according to the Lagrange theorem (numerical theory), which states that each polynomial of degree n in a field K has at most n different roots.


The\[ - \;{b^2}\; - 1\] are distinct for b taking integral values between 0 and \[\dfrac{{\;\left( {p\; - 1} \right)}}{2}\] (inclusive). According to the pigeonhole principle, a and b exist in this range for which $a^{2}$ and $b^{2}$ are congruent modulo p, or for which

\[{a^2} + {b^2} + {1^2} + {0^2} = np\]


Let m be the smallest positive integer that has the property that mp is the sum of the four squares \[{x_1}^2\; + \;{x_2}^2\; + \;{x_3}^2\; + \;{x_4}^2\] (we just proved that there is at least one m, namely n, that has this property; hence, m is smaller than p). We prove the existence of a positive integer r less than m, for which RP is also the sum of four squares if our proof that m equals 1 is false (this is in the spirit of the infinite descent method of Fermat).


In order to achieve this, we take into account the \[{y_i}\] for each \[{x_i}\] that belongs to the same residue class modulo m and falls between \[\dfrac{{\left( { - m\; + \;1} \right)}}{2}\] and \[\dfrac{m}{2}\] (possibly included). It follows that for some strictly positive integer r less than m, \[{y_1}^2\; + \;{y_2}^2\; + \;{y_3}^2\; + \;{y_4}^2\; = \;mr\]


Euler's four-square identity is then used once more to demonstrate that \[mpmr\; = \;{z_1}^2\; + \;{z_2}^{2\;} + \;{z_3}^2\; + \;{z_4}^2.\]. But since each \[{x_i}\] coincides with its corresponding \[{y_i}\], it follows that all\[{z_i}\] are divisible by m. Indeed,


\[\left\{ \begin{array}{l}{z_1} = {x_1}{y_1} + {x_2}{y_2} + {x_3}{y_3} + {x_4}{y_4} \equiv x_1^2 + x_2^2 + x_3^2 + x_4^2 = mp = 0(\bmod m)\\{z_2} = {x_1}{y_2} - {x_2}{y_1} + {x_3}{y_4} - {x_4}{y_3} \equiv {x_1}{x_2} - {x_2}{x_1} + {x_3}{x_4} - {x_4}{x_3} = 0(\bmod m)\\{z_3} = {x_1}{y_3} - {x_2}{y_4} - {x_3}{y_1} + {x_4}{y_2} \equiv {x_1}{x_3} - {x_2}{x_4} - {x_3}{x_1} + {x_4}{x_2} = 0(\bmod m)\\{z_4} = {x_1}{y_4} + {x_2}{y_3} - {x_3}{y_2} - {x_4}{y_1} \equiv {x_1}{x_4} + {x_2}{x_3} - {x_3}{x_2} - {x_4}{x_1} = 0(\bmod m)\end{array} \right\}\]


For \[{w_i}\; = \;\dfrac{{{z_i}}}{m}\], it follows that \[{w_i}\; = \;\dfrac{{z_i}}{m},\;{w_1}^2\; + \;{w_2}^2\; + \;{w_3}^2\; + \;{w_4}^2\; = \;rp\], which is in conflict with m's minimality.


Both the situation \[{y_1}\; = \;{y_2}\; = \;{y_3}\; = \;{y_4}\; = \dfrac{{\;m}}{2}\] (which would give r = m and no descent) and the case\[\;{y_1}\; = \;{y_2}\; = \;{y_3}\; = \;{y_4}\; = \;0\] (which would give r = 0 rather than strictly positive) must be ruled out in the aforementioned descent. In both instances, it is possible to verify that \[mp\; = \;{x_1}^2\; + \;{x_2}^2\; + \;{x_3}^2\; + \;{x_4}^2\] would be a multiple of \[{m^2}\], which would be in opposition to the assertion that p is a prime number bigger than m.


Applications of Lagrange's Four-Square Theorem

Lagrange's Four-Square Theorem gives a formula for the number of ways that a given natural number n can be represented as the sum of four squares. The theorem can be applied to every natural number. Like even for big numbers like one lakh or one crore.


Lagrange's Four-Square Theorem Examples

1. Express the number 23 as a sum of four squares using Lagrange's four-square theorem.

Ans: By Lagrange's four-square theorem,

\[p = a_0^2 + a_1^2 + a_2^2 + a_3^2\]

That means \[p\; = 23\]

And if we consider

$a_{0} = 1 \\ a_{1} = 2 \\ a_{2} = 3 \\ a_{3} = 3$

Then,

\[\begin{array}{l}23\; = \;1 + 4 + 9 + 9\\23 = \;23\end{array}\]

This is true.

So, 23 can be expressed as

\[23\; = \;{1^2}\; + {2^2} + {3^2} + {3^2}\].


2. How will you write 2012 as a sum of four squares using Lagrange's four-square theorem?

Ans: By Lagrange's four-square theorem,

\[p = a_0^2 + a_1^2 + a_2^2 + a_3^2\]

That means \[p\; = 2012\]

And if we consider,

$a_{0} = 44 \\ a_{1} = 6 \\ a_{2} = 6 \\ a_{3} = 2$

Then,

\[\begin{array}{l}2012\; = \;1936 + 36 + 36 + 4\\2012\; = \;2012\end{array}\]

This is true.

So, 2012 can be expressed as

\[2012\; = \;{44^2} + {6^2} + {6^2} + {2^2}\].


3. Show that 7839 can be written as the sum of four squares.

Ans: Using Lagrange's four-square theorem, we can say that 7839 can be written as sums of four squares.

\[p = a_0^2 + a_1^2 + a_2^2 + a_3^2\]

Using Lagrange's four-square theorem,

That means \[p\; = 7839\]

Consider

$a_{0} = 77 \\ a_{1} = 31 \\ a_{2} = 30 \\ a_{4} = 7$

Then,

\[\begin{array}{l}7839\; = 5929 + 961 + 900 + 49\\7839\; = \;7839\end{array}\]

This is true.

So, 7839 can be expressed as

\[7839 = \;{77^2} + {31^2} + {30^2} + {7^2}\,\].


Important Points to Remember

  • Any positive integer can be represented as the sum of the squares of four positive numbers.

  • The Lagrange's Four-Square theorem is applicable to every single natural number.


Important Formula from the Theorem

Any natural number p can be expressed as

\[p = a_0^2 + a_1^2 + a_2^2 + a_3^2\]

where the four numbers \[{a_0},{a_1},{a_2},{a_3}\] are integers.


Conclusion

In this article, we went over Lagrange's four-square theorem and its proof in great depth. It is evident from the previous discussion of Lagrange's four-square theorem that Lagrange's four-square theorem provides us with a way to write every natural number in the form of four squares.

Competitive Exams after 12th Science
tp-imag
bottom-arrow
tp-imag
bottom-arrow
tp-imag
bottom-arrow
tp-imag
bottom-arrow
tp-imag
bottom-arrow
tp-imag
bottom-arrow
Best Seller - Grade 10
View More>
Previous
Next

FAQs on Lagrange's Four-Square Theorem

1. What is Lagrange's four-square theorem?

Lagrange's four-square theorem, also known as Bachet's conjecture, is a fundamental concept in number theory. It states that every natural number can be represented as the sum of four integer squares. This means for any positive integer 'n', we can find integers a, b, c, and d such that n = a² + b² + c² + d², where the integers can be positive, negative, or zero.

2. Can you give an example of expressing a number as the sum of four squares?

Certainly. Let's take the number 31 as an example. According to Lagrange's theorem, we can express it as a sum of four squares. One possible representation is:

  • 31 = 5² + 2² + 1² + 1²
  • Because 25 + 4 + 1 + 1 = 31.
Another example is the number 7, which cannot be written as the sum of three squares, but can be as four:
  • 7 = 2² + 1² + 1² + 1²
  • Because 4 + 1 + 1 + 1 = 7.

3. How is Euler's four-square identity important for proving Lagrange's theorem?

Euler's four-square identity is a crucial stepping stone in the proof of Lagrange's theorem. The identity demonstrates that if two numbers can each be written as a sum of four squares, then their product can also be expressed as a sum of four squares. This powerful property allows mathematicians to simplify the main proof. Instead of proving the theorem for all natural numbers, they only need to prove it for prime numbers. Since every natural number greater than 1 is a product of primes, Euler's identity guarantees the theorem holds for all composite numbers as well.

4. Why does the four-square theorem work for all natural numbers, while the three-square theorem does not?

The reason lies in a specific class of numbers. Legendre's three-square theorem states that a natural number can be written as the sum of three squares if and only if it is not of the form 4ᵏ(8m + 7) for non-negative integers k and m. Numbers like 7, 15, 23, and 28 fall into this excluded category and cannot be expressed as the sum of three squares. Lagrange's four-square theorem is more general because adding a fourth square (which can be 0²) provides the necessary flexibility to represent all natural numbers without exception.

5. Is there a practical algorithm to find the four squares for any given integer?

Yes, there are several algorithms to find the four squares for a given integer 'n', many of which are based on the constructive proofs of the theorem. A common approach involves these steps:

  • First, if the number is composite, find its prime factorization.
  • Use an algorithm to find the four-square representation for each prime factor. A notable method for primes is based on Hurwitz quaternions.
  • Finally, repeatedly apply Euler's four-square identity to combine the representations of the prime factors to get the final result for 'n'.
More efficient methods, like Rabin and Shallit's randomized polynomial-time algorithm, also exist for computational purposes.

6. How does Jacobi's four-square theorem differ from Lagrange's?

The primary difference between the two theorems is about existence versus quantity.

  • Lagrange's theorem is an existence theorem. It guarantees that at least one representation as a sum of four squares exists for any natural number. It doesn't say how many such representations there are.
  • Jacobi's theorem is a quantitative theorem. It goes a step further by providing an exact formula for the total number of ways a given integer can be written as the sum of four squares. This formula depends on the divisors of the integer.
In short, Lagrange tells you it's possible, while Jacobi tells you how many times it's possible.

7. What is the historical context of the four-square theorem?

The concept was first mentioned by the Greek mathematician Diophantus in his work 'Arithmetica'. The problem was later studied extensively by the French mathematician Pierre de Fermat in the 17th century, who claimed to have a proof but never published it. The first complete and published proof was provided by the Italian-French mathematician Joseph-Louis Lagrange in 1770, which is why the theorem is named after him.