For any pair of quadruples from a commutative ring , the following expressions are equal:
(
a
1
2
+
a
2
2
+
a
3
2
+
a
4
2
)
(
b
1
2
+
b
2
2
+
b
3
2
+
b
4
2
)
=
(
a
1
b
1
−
a
2
b
2
−
a
3
b
3
−
a
4
b
4
)
2
+
(
a
1
b
2
+
a
2
b
1
+
a
3
b
4
−
a
4
b
3
)
2
+
(
a
1
b
3
−
a
2
b
4
+
a
3
b
1
+
a
4
b
2
)
2
+
(
a
1
b
4
+
a
2
b
3
−
a
3
b
2
+
a
4
b
1
)
2
.
{\displaystyle {\begin{aligned}&\left(a_{1}^{2}+a_{2}^{2}+a_{3}^{2}+a_{4}^{2}\right)\left(b_{1}^{2}+b_{2}^{2}+b_{3}^{2}+b_{4}^{2}\right)\\[3mu]&\qquad =\left(a_{1}b_{1}-a_{2}b_{2}-a_{3}b_{3}-a_{4}b_{4}\right)^{2}+\left(a_{1}b_{2}+a_{2}b_{1}+a_{3}b_{4}-a_{4}b_{3}\right)^{2}\\[3mu]&\qquad \qquad +\left(a_{1}b_{3}-a_{2}b_{4}+a_{3}b_{1}+a_{4}b_{2}\right)^{2}+\left(a_{1}b_{4}+a_{2}b_{3}-a_{3}b_{2}+a_{4}b_{1}\right)^{2}.\end{aligned}}}
Euler wrote about this identity in a letter dated May 4, 1748 to Goldbach [ 1] [ 2] (but he used a different sign convention from the above). It can be verified with elementary algebra .
The identity was used by Lagrange to prove his four square theorem . More specifically, it implies that it is sufficient to prove the theorem for prime numbers , after which the more general theorem follows. The sign convention used above corresponds to the signs obtained by multiplying two quaternions. Other sign conventions can be obtained by changing any
a
k
{\displaystyle a_{k}}
to
−
a
k
{\displaystyle -a_{k}}
, and/or any
b
k
{\displaystyle b_{k}}
to
−
b
k
{\displaystyle -b_{k}}
.
If the
a
k
{\displaystyle a_{k}}
and
b
k
{\displaystyle b_{k}}
are real numbers , the identity expresses the fact that the absolute value of the product of two quaternions is equal to the product of their absolute values, in the same way that the Brahmagupta–Fibonacci two-square identity does for complex numbers . This property is the definitive feature of composition algebras .
Hurwitz's theorem states that an identity of form,
(
a
1
2
+
a
2
2
+
a
3
2
+
⋯
+
a
n
2
)
(
b
1
2
+
b
2
2
+
b
3
2
+
⋯
+
b
n
2
)
=
c
1
2
+
c
2
2
+
c
3
2
+
⋯
+
c
n
2
{\displaystyle \left(a_{1}^{2}+a_{2}^{2}+a_{3}^{2}+\dots +a_{n}^{2}\right)\left(b_{1}^{2}+b_{2}^{2}+b_{3}^{2}+\dots +b_{n}^{2}\right)=c_{1}^{2}+c_{2}^{2}+c_{3}^{2}+\dots +c_{n}^{2}}
where the
c
i
{\displaystyle c_{i}}
are bilinear functions of the
a
i
{\displaystyle a_{i}}
and
b
i
{\displaystyle b_{i}}
is possible only for n = 1, 2, 4, or 8.
Proof of the identity using quaternions
edit
Comment: The proof of Euler's four-square identity is by simple algebraic evaluation. Quaternions derive from the four-square identity, which can be written as the product of two inner products of 4-dimensional vectors, yielding again an inner product of 4-dimensional vectors: (a ·a )(b ·b ) = (a ×b )·(a ×b ) . This defines the quaternion multiplication rule a ×b , which simply reflects Euler's identity, and some mathematics of quaternions. Quaternions are, so to say, the "square root" of the four-square identity. But let the proof go on:
Let
α
=
a
1
+
a
2
i
+
a
3
j
+
a
4
k
{\displaystyle \alpha =a_{1}+a_{2}i+a_{3}j+a_{4}k}
and
β
=
b
1
+
b
2
i
+
b
3
j
+
b
4
k
{\displaystyle \beta =b_{1}+b_{2}i+b_{3}j+b_{4}k}
be a pair of quaternions. Their quaternion conjugates are
α
∗
=
a
1
−
a
2
i
−
a
3
j
−
a
4
k
{\displaystyle \alpha ^{*}=a_{1}-a_{2}i-a_{3}j-a_{4}k}
and
β
∗
=
b
1
−
b
2
i
−
b
3
j
−
b
4
k
{\displaystyle \beta ^{*}=b_{1}-b_{2}i-b_{3}j-b_{4}k}
. Then
A
:=
α
α
∗
=
a
1
2
+
a
2
2
+
a
3
2
+
a
4
2
{\displaystyle A:=\alpha \alpha ^{*}=a_{1}^{2}+a_{2}^{2}+a_{3}^{2}+a_{4}^{2}}
and
B
:=
β
β
∗
=
b
1
2
+
b
2
2
+
b
3
2
+
b
4
2
.
{\displaystyle B:=\beta \beta ^{*}=b_{1}^{2}+b_{2}^{2}+b_{3}^{2}+b_{4}^{2}.}
The product of these two is
A
B
=
α
α
∗
β
β
∗
{\displaystyle AB=\alpha \alpha ^{*}\beta \beta ^{*}}
, where
β
β
∗
{\displaystyle \beta \beta ^{*}}
is a real number, so it can commute with the quaternion
α
∗
{\displaystyle \alpha ^{*}}
, yielding
A
B
=
α
β
β
∗
α
∗
.
{\displaystyle AB=\alpha \beta \beta ^{*}\alpha ^{*}.}
No parentheses are necessary above, because quaternions associate . The conjugate of a product is equal to the commuted product of the conjugates of the product's factors, so
A
B
=
α
β
(
α
β
)
∗
=
γ
γ
∗
{\displaystyle AB=\alpha \beta (\alpha \beta )^{*}=\gamma \gamma ^{*}}
where
γ
{\displaystyle \gamma }
is the Hamilton product of
α
{\displaystyle \alpha }
and
β
{\displaystyle \beta }
:
γ
=
(
a
1
+
⟨
a
2
,
a
3
,
a
4
⟩
)
(
b
1
+
⟨
b
2
,
b
3
,
b
4
⟩
)
=
a
1
b
1
+
a
1
⟨
b
2
,
b
3
,
b
4
⟩
+
⟨
a
2
,
a
3
,
a
4
⟩
b
1
+
⟨
a
2
,
a
3
,
a
4
⟩
⟨
b
2
,
b
3
,
b
4
⟩
=
a
1
b
1
+
⟨
a
1
b
2
,
a
1
b
3
,
a
1
b
4
⟩
+
⟨
a
2
b
1
,
a
3
b
1
,
a
4
b
1
⟩
−
⟨
a
2
,
a
3
,
a
4
⟩
⋅
⟨
b
2
,
b
3
,
b
4
⟩
+
⟨
a
2
,
a
3
,
a
4
⟩
×
⟨
b
2
,
b
3
,
b
4
⟩
=
a
1
b
1
+
⟨
a
1
b
2
+
a
2
b
1
,
a
1
b
3
+
a
3
b
1
,
a
1
b
4
+
a
4
b
1
⟩
−
a
2
b
2
−
a
3
b
3
−
a
4
b
4
+
⟨
a
3
b
4
−
a
4
b
3
,
a
4
b
2
−
a
2
b
4
,
a
2
b
3
−
a
3
b
2
⟩
=
(
a
1
b
1
−
a
2
b
2
−
a
3
b
3
−
a
4
b
4
)
+
⟨
a
1
b
2
+
a
2
b
1
+
a
3
b
4
−
a
4
b
3
,
a
1
b
3
+
a
3
b
1
+
a
4
b
2
−
a
2
b
4
,
a
1
b
4
+
a
4
b
1
+
a
2
b
3
−
a
3
b
2
⟩
γ
=
(
a
1
b
1
−
a
2
b
2
−
a
3
b
3
−
a
4
b
4
)
+
(
a
1
b
2
+
a
2
b
1
+
a
3
b
4
−
a
4
b
3
)
i
+
(
a
1
b
3
+
a
3
b
1
+
a
4
b
2
−
a
2
b
4
)
j
+
(
a
1
b
4
+
a
4
b
1
+
a
2
b
3
−
a
3
b
2
)
k
.
{\displaystyle {\begin{aligned}\gamma &=\left(a_{1}+\langle a_{2},a_{3},a_{4}\rangle \right)\left(b_{1}+\langle b_{2},b_{3},b_{4}\rangle \right)\\[3mu]&=a_{1}b_{1}+a_{1}\langle b_{2},\ b_{3},\ b_{4}\rangle +\langle a_{2},\ a_{3},\ a_{4}\rangle b_{1}+\langle a_{2},\ a_{3},\ a_{4}\rangle \langle b_{2},\ b_{3},\ b_{4}\rangle \\[3mu]&=a_{1}b_{1}+\langle a_{1}b_{2},\ a_{1}b_{3},\ a_{1}b_{4}\rangle +\langle a_{2}b_{1},\ a_{3}b_{1},\ a_{4}b_{1}\rangle \\&\qquad -\langle a_{2},\ a_{3},\ a_{4}\rangle \cdot \langle b_{2},\ b_{3},\ b_{4}\rangle +\langle a_{2},\ a_{3},\ a_{4}\rangle \times \langle b_{2},\ b_{3},\ b_{4}\rangle \\[3mu]&=a_{1}b_{1}+\langle a_{1}b_{2}+a_{2}b_{1},\ a_{1}b_{3}+a_{3}b_{1},\ a_{1}b_{4}+a_{4}b_{1}\rangle \\&\qquad -a_{2}b_{2}-a_{3}b_{3}-a_{4}b_{4}+\langle a_{3}b_{4}-a_{4}b_{3},\ a_{4}b_{2}-a_{2}b_{4},\ a_{2}b_{3}-a_{3}b_{2}\rangle \\[3mu]&=(a_{1}b_{1}-a_{2}b_{2}-a_{3}b_{3}-a_{4}b_{4})\\&\qquad +\langle a_{1}b_{2}+a_{2}b_{1}+a_{3}b_{4}-a_{4}b_{3},\ a_{1}b_{3}+a_{3}b_{1}+a_{4}b_{2}-a_{2}b_{4},\ a_{1}b_{4}+a_{4}b_{1}+a_{2}b_{3}-a_{3}b_{2}\rangle \\[3mu]\gamma &=(a_{1}b_{1}-a_{2}b_{2}-a_{3}b_{3}-a_{4}b_{4})+(a_{1}b_{2}+a_{2}b_{1}+a_{3}b_{4}-a_{4}b_{3})i\\&\qquad +(a_{1}b_{3}+a_{3}b_{1}+a_{4}b_{2}-a_{2}b_{4})j+(a_{1}b_{4}+a_{4}b_{1}+a_{2}b_{3}-a_{3}b_{2})k.\end{aligned}}}
Then
γ
∗
=
(
a
1
b
1
−
a
2
b
2
−
a
3
b
3
−
a
4
b
4
)
−
(
a
1
b
2
+
a
2
b
1
+
a
3
b
4
−
a
4
b
3
)
i
−
(
a
1
b
3
+
a
3
b
1
+
a
4
b
2
−
a
2
b
4
)
j
−
(
a
1
b
4
+
a
4
b
1
+
a
2
b
3
−
a
3
b
2
)
k
.
{\displaystyle {\begin{aligned}\gamma ^{*}&=(a_{1}b_{1}-a_{2}b_{2}-a_{3}b_{3}-a_{4}b_{4})-(a_{1}b_{2}+a_{2}b_{1}+a_{3}b_{4}-a_{4}b_{3})i\\&\qquad -(a_{1}b_{3}+a_{3}b_{1}+a_{4}b_{2}-a_{2}b_{4})j-(a_{1}b_{4}+a_{4}b_{1}+a_{2}b_{3}-a_{3}b_{2})k.\end{aligned}}}
If
γ
=
r
+
u
→
{\displaystyle \gamma =r+{\vec {u}}}
where
r
{\displaystyle r}
is the scalar part and
u
→
=
⟨
u
1
,
u
2
,
u
3
⟩
{\displaystyle {\vec {u}}=\langle u_{1},u_{2},u_{3}\rangle }
is the vector part, then
γ
∗
=
r
−
u
→
{\displaystyle \gamma ^{*}=r-{\vec {u}}}
so
γ
γ
∗
=
(
r
+
u
→
)
(
r
−
u
→
)
=
r
2
−
r
u
→
+
r
u
→
−
u
→
u
→
=
r
2
+
u
→
⋅
u
→
−
u
→
×
u
→
=
r
2
+
u
→
⋅
u
→
=
r
2
+
u
1
2
+
u
2
2
+
u
3
2
.
{\displaystyle {\begin{aligned}\gamma \gamma ^{*}&=(r+{\vec {u}})(r-{\vec {u}})=r^{2}-r{\vec {u}}+r{\vec {u}}-{\vec {u}}{\vec {u}}=r^{2}+{\vec {u}}\cdot {\vec {u}}-{\vec {u}}\times {\vec {u}}\\&=r^{2}+{\vec {u}}\cdot {\vec {u}}=r^{2}+u_{1}^{2}+u_{2}^{2}+u_{3}^{2}.\end{aligned}}}
So,
A
B
=
γ
γ
∗
=
(
a
1
b
1
−
a
2
b
2
−
a
3
b
3
−
a
4
b
4
)
2
+
(
a
1
b
2
+
a
2
b
1
+
a
3
b
4
−
a
4
b
3
)
2
+
(
a
1
b
3
+
a
3
b
1
+
a
4
b
2
−
a
2
b
4
)
2
+
(
a
1
b
4
+
a
4
b
1
+
a
2
b
3
−
a
3
b
2
)
2
.
{\displaystyle {\begin{aligned}AB=\gamma \gamma ^{*}&=(a_{1}b_{1}-a_{2}b_{2}-a_{3}b_{3}-a_{4}b_{4})^{2}+(a_{1}b_{2}+a_{2}b_{1}+a_{3}b_{4}-a_{4}b_{3})^{2}\\&\qquad +(a_{1}b_{3}+a_{3}b_{1}+a_{4}b_{2}-a_{2}b_{4})^{2}+(a_{1}b_{4}+a_{4}b_{1}+a_{2}b_{3}-a_{3}b_{2})^{2}.\end{aligned}}}