TheoremComplete

Lagrange's Four-Square Theorem

Theorem8.2Lagrange's Four-Square Theorem (with Circle Method Perspective)

Every positive integer nn is the sum of four squares: n=x12+x22+x32+x42n = x_1^2 + x_2^2 + x_3^2 + x_4^2 for some xi∈Zβ‰₯0x_i \in \mathbb{Z}_{\geq 0}. The number of representations r4(n)=∣{(x1,x2,x3,x4)∈Z4:x12+x22+x32+x42=n}∣=8βˆ‘d∣n4∀ddr_4(n) = |\{(x_1,x_2,x_3,x_4) \in \mathbb{Z}^4 : x_1^2+x_2^2+x_3^2+x_4^2 = n\}| = 8\sum_{\substack{d | n \\ 4 \nmid d}} d (Jacobi's formula).


Proof (Circle Method)

Proof

Step 1: Generating function. r4(n)=∫01ΞΈ(Ξ±)4eβˆ’2Ο€inα dΞ±r_4(n) = \int_0^1 \theta(\alpha)^4 e^{-2\pi in\alpha}\,d\alpha where ΞΈ(Ξ±)=βˆ‘m∈Ze2Ο€im2Ξ±\theta(\alpha) = \sum_{m \in \mathbb{Z}} e^{2\pi im^2\alpha} is the Jacobi theta function.

Step 2: Major arcs. Near Ξ±=a/q+Ξ²\alpha = a/q + \beta with small qq, the theta function factors: ΞΈ(a/q+Ξ²)=1qG(a,q)β‹…ΞΈ0(Ξ²)+O(q1/2+Ξ΅)\theta(a/q + \beta) = \frac{1}{q}G(a, q) \cdot \theta_0(\beta) + O(q^{1/2+\varepsilon}) where G(a,q)=βˆ‘r=1qe2Ο€iar2/qG(a,q) = \sum_{r=1}^q e^{2\pi iar^2/q} is the Gauss sum (with ∣G(a,q)∣=q|G(a,q)| = \sqrt{q} for (a,q)=1(a,q)=1) and ΞΈ0(Ξ²)=∫Re2Ο€iΞ²t2dt=(2∣β∣)βˆ’1/2eΟ€isgn⁑(Ξ²)/4\theta_0(\beta) = \int_\mathbb{R} e^{2\pi i\beta t^2}dt = (2|\beta|)^{-1/2}e^{\pi i \operatorname{sgn}(\beta)/4}.

Step 3: Singular series. The major arc contribution gives r4(n)=S4(n)β‹…Ο€2n2+errorr_4(n) = \mathfrak{S}_4(n) \cdot \frac{\pi^2 n}{2} + \text{error} where S4(n)=βˆ‘q=1∞A4(q,n)\mathfrak{S}_4(n) = \sum_{q=1}^\infty A_4(q, n) with A4(q,n)=qβˆ’4βˆ‘a=1qG(a,q)4eβˆ’2Ο€ian/qA_4(q, n) = q^{-4}\sum_{a=1}^q G(a,q)^4 e^{-2\pi ian/q}.

Step 4: Computing S4(n)\mathfrak{S}_4(n). By multiplicativity and evaluation of Gauss sums: S4(n)=8Ο€2nβˆ‘d∣n4∀dd\mathfrak{S}_4(n) = \frac{8}{\pi^2 n}\sum_{\substack{d|n \\ 4\nmid d}} d for all nβ‰₯1n \geq 1, so r4(n)=8βˆ‘d∣n4∀ddr_4(n) = 8\sum_{\substack{d|n \\ 4\nmid d}} d. In particular, r4(n)β‰₯8>0r_4(n) \geq 8 > 0 for all nβ‰₯1n \geq 1 (taking d=1d = 1 in the sum).

Step 5: Minor arcs. For the four-square problem, the minor arc bound is actually unnecessary because Jacobi's formula provides an exact identity via modular forms. The theta function ΞΈ(Ο„)4\theta(\tau)^4 is a modular form of weight 2 for Ξ“0(4)\Gamma_0(4), and the Fourier coefficients are determined exactly by the Eisenstein series decomposition.

Alternatively, one can verify r4(n)>0r_4(n) > 0 for all nn directly from the formula: r4(n)=8(Οƒ(n)βˆ’4Οƒ(n/4))r_4(n) = 8(\sigma(n) - 4\sigma(n/4)) where Οƒ(m)=βˆ‘d∣md\sigma(m) = \sum_{d|m} d and Οƒ\sigma of a non-integer is 0. Since Οƒ(n)β‰₯n+1\sigma(n) \geq n + 1 and 4Οƒ(n/4)≀4Οƒ(n/4)4\sigma(n/4) \leq 4\sigma(n/4) (only relevant when 4∣n4|n), one verifies r4(n)β‰₯8r_4(n) \geq 8 always. β–‘\square

β– 

ExampleLegendre's Three-Square Theorem

nn is a sum of three squares if and only if nn is not of the form 4a(8b+7)4^a(8b + 7). Unlike four squares, the singular series S3(n)=0\mathfrak{S}_3(n) = 0 precisely when n=4a(8b+7)n = 4^a(8b+7), making three squares a more delicate problem. The proof uses the theory of ternary quadratic forms and the Hasse-Minkowski theorem (or Gauss's original argument).

RemarkWaring's Problem for Squares

G(2)=4G(2) = 4: four squares suffice for all sufficiently large nn (indeed, for all nn). The asymptotic formula rs(n)∼Ss(n)Js(n)r_s(n) \sim \mathfrak{S}_s(n)\mathfrak{J}_s(n) for sβ‰₯5s \geq 5 follows from the circle method, while s=4s = 4 requires exact modular form computations. The singular series Ss(n)\mathfrak{S}_s(n) is always positive for sβ‰₯5s \geq 5 and all nn, making the circle method proof cleaner.