Lagrange's Four Square Theorem/Proof 2
![]() | This page has been identified as a candidate for refactoring of basic complexity. In particular: Separate out the proof for Primes and Composites into their separate transcluded pages. Until this has been finished, please leave {{Refactor}} in the code.
New contributors: Refactoring is a task which is expected to be undertaken by experienced editors only. Because of the underlying complexity of the work needed, it is recommended that you do not embark on a refactoring task until you have become familiar with the structural nature of pages of $\mathsf{Pr} \infty \mathsf{fWiki}$.To discuss this page in more detail, feel free to use the talk page. When this work has been completed, you may remove this instance of {{Refactor}} from the code. |
Theorem
Every positive integer can be expressed as a sum of four squares.
Proof
Proof for Odd Primes
Suppose $p$ is an odd prime.
Define:
- $S := \set {\alpha^2 \pmod p: \alpha \in \hointr 0 {\dfrac p 2} \cap \Z}$
Define:
- $S' := \set {-1 - \beta^2 \pmod p: \beta \in \hointr 0 {\dfrac p 2} \cap \Z}$
Suppose for $\alpha, \alpha' \in S$:
- $\alpha^2 \equiv \alpha'^2 \pmod p$
Obviously:
- $\paren {\alpha + \alpha'} \paren {\alpha - \alpha'} = \alpha^2 - \alpha'^2 \equiv 0 \pmod p$
Since $0 \le \alpha$, $\alpha' < \dfrac p 2$:
- $\alpha + \alpha' \not \equiv 0 \pmod p$
Therefore $\alpha - \alpha' \equiv 0 \pmod p$.
This shows that $\alpha = \alpha'$.
Thus we have $\size S = \size {\hointr 0 {\dfrac p 2} \cap \Z} = 1 + \dfrac {p - 1} 2 = \dfrac {p + 1} 2$.
Choose $\beta, \beta' \in S'$:
- $-1 - \beta^2 \equiv -1 - \beta'^2 \pmod p$
By simple algebraic manipulation:
- $-1 - \beta^2 \equiv -1 - \beta'^2 \pmod p \iff \beta^2 \equiv \beta'^2 \pmod p$
Then by the same reasoning as above:
- $\card {S'} = \card S = \dfrac {p + 1} 2$
By the Pigeonhole Principle:
- $S \cap S' \ne \O$
Thus $\exists \alpha, \beta \in \Z$:
- $(1): \quad \alpha^2 + \beta^2 + 1 \equiv 0 \pmod p$
Define:
- $L = \set {\vec x = \tuple {x_1, x_2, x_3, x_4} \in \Z^4: x_1 \equiv \alpha x_3 + \beta x_4 \pmod p, x_2 \equiv \beta x_3 - \alpha x_4 \pmod p}$
If $\vec x$, $\vec y \in L$ and $\vec z = \tuple {z_1, z_2, z_3, z_4}$, then:
\(\ds z_1\) | \(=\) | \(\ds x_1 + y_1\) | ||||||||||||
\(\ds \) | \(\equiv\) | \(\ds \alpha x_3 + \beta x_4 + \alpha y_3 + \beta y_4\) | \(\ds \pmod p\) | |||||||||||
\(\ds \) | \(\equiv\) | \(\ds \alpha \paren {x_3 + y_3} + \beta \paren {x_4 + y_4}\) | \(\ds \pmod p\) | |||||||||||
\(\ds \) | \(\equiv\) | \(\ds \alpha z_3 + \beta z_4\) | \(\ds \pmod p\) | |||||||||||
\(\ds z_2\) | \(=\) | \(\ds x_2 + y_2\) | ||||||||||||
\(\ds \) | \(\equiv\) | \(\ds \beta x_3 - \alpha x_4 + \beta y_3 - \alpha y_4\) | \(\ds \pmod p\) | |||||||||||
\(\ds \) | \(\equiv\) | \(\ds \beta \paren {x_3 + y_3} - \alpha \paren {x_4 + y_4}\) | \(\ds \pmod p\) | |||||||||||
\(\ds \) | \(\equiv\) | \(\ds \beta z_3 - \alpha z_4\) | \(\ds \pmod p\) | |||||||||||
\(\ds \leadsto \ \ \) | \(\ds \vec x + \vec y\) | \(=\) | \(\ds \vec z\) | |||||||||||
\(\ds \) | \(\in\) | \(\ds L\) |
So $L$ is closed under vector addition.
\(\ds -x_1\) | \(\equiv\) | \(\ds -\paren {\alpha x_3 + \beta x_4}\) | \(\ds \pmod p\) | |||||||||||
\(\ds \) | \(\equiv\) | \(\ds \alpha \paren {-x_3} + \beta \paren {-x_4}\) | \(\ds \pmod p\) | |||||||||||
\(\ds -x_2\) | \(\equiv\) | \(\ds -\paren {\beta x_3 - \alpha x_4}\) | \(\ds \pmod p\) | |||||||||||
\(\ds \) | \(\equiv\) | \(\ds \beta \paren {-x_3} - \alpha \paren {-x_4}\) | \(\ds \pmod p\) | |||||||||||
\(\ds \leadsto \ \ \) | \(\ds -\vec x\) | \(\in\) | \(\ds L\) | |||||||||||
\(\ds \leadsto \ \ \) | \(\ds L\) | \(\le\) | \(\ds \R^4\) |
So $L$ has additive inverses.
By Two-Step Subgroup Test, $\struct {L, +}$ is a subgroup of $\struct {\R^4, +}$.
For each $\vec x = \tuple {x_1, x_2, x_3, x_4} \in L$, one can write:
- $\vec x = x_3 \tuple {\alpha, \beta, 1, 0} + x_4 \tuple {\beta, -\alpha, 0, 1} + \floor {\dfrac {x_1} p} \tuple {p, 0, 0, 0} + \floor {\dfrac{x_2} p} \tuple {0, p, 0, 0}$
Thus:
- $\set {\tuple {\alpha, \beta, 1, 0}, \tuple {\beta, -\alpha, 0, 1}, \tuple {p, 0, 0, 0}, \tuple {0, p, 0, 0} }$
spans $L$.
Suppose we have for some $c_1, c_2, c_3, c_4 \in \Z$:
- $\vec 0 = c_1 \tuple {\alpha, \beta, 1, 0} + c_2 \tuple {\beta, -\alpha , 0, 1} + c_3 \tuple {p, 0, 0, 0} + c_4 \tuple {0, p, 0, 0}$
Extracting the various coordinates:
\(\ds \alpha c_1 + \beta c_2 + p c_3\) | \(=\) | \(\ds 0\) | ||||||||||||
\(\ds \beta c_1 - \alpha c_2 + p c_4\) | \(=\) | \(\ds 0\) | ||||||||||||
\(\ds c_1\) | \(=\) | \(\ds 0\) | ||||||||||||
\(\ds c_2\) | \(=\) | \(\ds 0\) |
and so:
\(\ds \alpha c_1 + \beta c_2\) | \(=\) | \(\ds 0\) | ||||||||||||
\(\ds \alpha c_1 - \beta c_2\) | \(=\) | \(\ds 0\) | ||||||||||||
\(\ds \leadsto \ \ \) | \(\ds c_3\) | \(=\) | \(\ds 0\) | |||||||||||
\(\ds \leadsto \ \ \) | \(\ds c_4\) | \(=\) | \(\ds 0\) |
So:
- $\set {\tuple {\alpha, \beta, 1, 0}, \tuple {\beta, -\alpha, 0, 1}, \tuple {p, 0, 0, 0}, \tuple {0, p, 0, 0} }$
is linearly independent and thus a basis for $L$.
Thus:
\(\ds \map {\dim_\R} {\span_\R L}\) | \(=\) | \(\ds \dim_\Z L\) | ||||||||||||
\(\ds \) | \(=\) | \(\ds \card {\set {\tuple {\alpha, \beta, 1, 0}, \tuple {\beta, -\alpha, 0, 1}, \tuple {p, 0, 0, 0}, \tuple {0, p, 0, 0} } }\) | ||||||||||||
\(\ds \) | \(=\) | \(\ds 4\) |
Thus:
- $\span_\R L = \R^4$
So $L$ is a lattice.
Define the quotient map:
- $\varphi: \N_p^2 \times \set {\tuple {0, 0} } \to \Z^4 / L$
- $\tuple {x, y, 0, 0} \mapsto \sqbrk {\tuple {x, y, 0, 0} }$
Since quotient maps are surjective:
- $\paren {\Z^4 / L} \le \size {\N_p^2 \times \set {\tuple {0, 0} } } = p^2$
So:
- $\map \det L = \# \paren {\Z^4 / L} < p^2$
![]() | This article, or a section of it, needs explaining. In particular: $\#$ You can help $\mathsf{Pr} \infty \mathsf{fWiki}$ by explaining it. To discuss this page in more detail, feel free to use the talk page. When this work has been completed, you may remove this instance of {{Explain}} from the code. |
Let $\norm {\, \cdot \,}$ denote the Euclidean metric.
![]() | This article, or a section of it, needs explaining. In particular: Work out exactly which version of the Definition:Euclidean Metric links is relevant here. You can help $\mathsf{Pr} \infty \mathsf{fWiki}$ by explaining it. To discuss this page in more detail, feel free to use the talk page. When this work has been completed, you may remove this instance of {{Explain}} from the code. |
Consider $\map {B_{\sqrt {2 p} } } {\vec 0}$, the open ball of radius $\sqrt {2 p}$.
Then:
- $\forall \vec x, \vec y \in \map {B_{\sqrt {2 p} } } {\vec 0}, \forall t \in \closedint 0 1$:
\(\ds \norm {t \vec x + \paren {1 - t} \vec y}\) | \(\le\) | \(\ds \norm {t \vec x} + \norm {\paren {1 - t} \vec y}\) | Definition of Metric | |||||||||||
\(\ds \) | \(=\) | \(\ds \size t \norm {\vec x} + \size {1 - t} \norm {\vec y}\) | Definition of Metric | |||||||||||
\(\ds \) | \(<\) | \(\ds \size t \sqrt {2 p} + \size {1 - t} \sqrt {2 p}\) | Definition of Open Ball $\map {B_{\sqrt{2 p} } } {\vec 0}$ | |||||||||||
\(\ds \) | \(=\) | \(\ds \paren {\size t + \size {1 - t} } \sqrt {2 p}\) | Real Multiplication Distributes over Addition | |||||||||||
\(\ds \) | \(=\) | \(\ds \paren {t + 1 - t} \sqrt{2 p}\) | since $t \in \closedint 0 1 \implies t \ge 0$ | |||||||||||
\(\ds \) | \(=\) | \(\ds \sqrt {2 p}\) | since $t + 1 - t = 1$ is the multiplicative identity of $\R$ |
Thus the line between $\vec x$ and $\vec y$ is contained in $\map {B_{\sqrt{2 p} } } {\vec 0}$.
So $\map {B_{\sqrt {2 p} } } {\vec 0}$ is convex.
Let $\vec x \in \map {B_{\sqrt{2 p} } } {\vec 0}$.
Then $\vec x < \sqrt {2 p}$.
That means:
- $\norm {-\vec x} = \size {-1} \norm {\vec x} = \norm {\vec x} < \sqrt{2 p}$
So:
- $-\vec x \in \map {B_{\sqrt{2 p} } } {\vec 0}$
Then $\map {B_{\sqrt{2 p} } } {\vec 0}$ is symmetric about the origin.
By the formula for the volume of an $n$-ball (with respect to the standard measure on $\R^n$):
![]() | This article, or a section of it, needs explaining. In particular: Change the above to be a page on $\mathsf{Pr} \infty \mathsf{fWiki}$ -- external links of material of a mathematical nature are disallowed by house rules. You can help $\mathsf{Pr} \infty \mathsf{fWiki}$ by explaining it. To discuss this page in more detail, feel free to use the talk page. When this work has been completed, you may remove this instance of {{Explain}} from the code. |
- $\map {\operatorname {Vol} } {\map {B_{\sqrt{2 p} } } {\vec 0} } = \dfrac {\pi^2 \paren {\sqrt {2 p} }^4} 2 = 2 \pi^2 p^2$
Since $2\pi^2 > 1$:
- $\map {\operatorname {Vol} } {\map {B_{\sqrt{2 p} } } {\vec 0} } > \map \det L$
- $L \cap \map {B_{\sqrt{2 p} } } {\vec 0} \ne \O$
Thus, if:
- $\vec a = \tuple {a_1, a_2, a_3, a_4} \in L \cap \map {B_{\sqrt{2 p} } } {\vec 0}$
then:
- $0 < a_1^2 + a_2^2 + a_3^2 + a_4^2 = \norm {\vec a}^2 < 2 p$
However:
\(\ds a_1^2 + a_2^2 + a_3^2 + a_4^2\) | \(\equiv\) | \(\ds \paren {\alpha a_3 + \beta a_4}^2 + \paren {\beta a_3 - \alpha a_4}^2 + a_3^2 + a_4^2\) | \(\ds \pmod p\) | Definition of $L$ | ||||||||||
\(\ds \) | \(\equiv\) | \(\ds \alpha^2 a_3^2 + 2 \alpha \beta a_3 a_4 + \beta^2 a_4^2 + \beta^2 a_3^2 - 2 \alpha \beta a_3 a_4 + \alpha^2 a_4^2 + a_3^2 + a_4^2\) | \(\ds \pmod p\) | Binomial Theorem | ||||||||||
\(\ds \) | \(\equiv\) | \(\ds \paren {\alpha^2 + \beta^2 + 1} \paren {a_3 + a_4}\) | \(\ds \pmod p\) | Real Multiplication Distributes over Addition | ||||||||||
\(\ds \) | \(\equiv\) | \(\ds 0 \paren {a_3 + a_4}\) | \(\ds \pmod p\) | by $(1)$ from above | ||||||||||
\(\ds \) | \(\equiv\) | \(\ds 0\) | \(\ds \pmod p\) |
So $\exists k \in \Z$:
- $(2): \quad 0 < a_1^2 + a_2^2 + a_3^2 + a_4^2 = k p \le 2 p$
Dividing $(2)$ by $p$:
- $0 < k < 2 \implies k = 1$
Thus:
- $a_1^2 + a_2^2 + a_3^2 + a_4^2 = p$
$\Box$
Proof for Composites
Suppose $x, y \in \Z$ are a sum of four squares with neither of $x$ or $y$ being primes.
Suppose either one is equal to $1$.
Then $x * 1 = x$ is a sum of four squares.
![]() | This article, or a section of it, needs explaining. In particular: $x * 1$? Is multiplication meant here? You can help $\mathsf{Pr} \infty \mathsf{fWiki}$ by explaining it. To discuss this page in more detail, feel free to use the talk page. When this work has been completed, you may remove this instance of {{Explain}} from the code. |
Suppose neither of them is equal to $1$.
Let $\mathbb H$ denote the set of Hurwitz quaternions.
Let $N: \mathbb H \to \R, a + b i + c j + d k \mapsto a^2 + b^2 + c^2 + d^2$ be the standard norm on $\mathbb H$.
Notice:
- $x$ is a sum of four squares if and only if $x$ is a norm of a Hurwitz quaternion
Then:
- $\exists \mu, \lambda \in \mathbb H: x = \map N \mu, y = \map N \lambda$
From Norm is Homomorphism:
- $ x y = \map N \mu \, \map N \lambda = \map N {\mu \lambda}$
Since $\mathbb H$ is a ring, we have:
- $\mu \lambda \in \mathbb H$
and thus $x y$ is a sum of four squares.
From the Fundamental Theorem of Arithmetic, every number can be written as a unique product of primes.
Then
![]() | This needs considerable tedious hard slog to complete it. To discuss this page in more detail, feel free to use the talk page. When this work has been completed, you may remove this instance of {{Finish}} from the code.If you would welcome a second opinion as to whether your work is correct, add a call to {{Proofread}} the page. |