The identity that multiplies sums of squares
Worth reading first: A multiplication that remembers the order · Two squares, and a lattice.
Every step of the previous rung used that the length of a product is the product of the lengths. Written out in coordinates, that innocuous sentence is an algebraic identity in eight variables, and it is one of the oldest useful facts in number theory.
Take two sums of four squares, multiply them, and the answer is again a sum of four squares — with the four numbers written explicitly in terms of the eight given ones. That is Euler’s identity of 1748, and it is the quaternion product with the letters kept.
Where the identity comes from
The norm of a quaternion is , which is a sum of four squares by construction. And the norm is multiplicative: , so .
Write out from Hamilton’s rule and the four coordinates of the product are
So , and every is a whole number whenever every and every is.
The identity is the multiplication table, and nothing else. That is why the four expressions look arbitrary written out and are obviously right derived: each is a coefficient of a product nobody had to invent.
The same construction one level down gives the two-square identity, which Diophantus knew: , and that is the complex product with the letters kept. Multiplication as turning and the two-square identity are the same statement.
Why the primes are the only hard case
Lagrange proved in 1770 that every positive integer is a sum of four squares. The identity reduces that theorem to a statement about primes.
Every integer factors into primes. If each prime is a sum of four squares, then multiplying them together — using the identity at each step — makes the product a sum of four squares too, since the identity produces whole numbers from whole numbers. And , so only the odd primes need attention.
That reduction is not a small saving. Proving every integer is a sum of four squares directly means dealing with numbers of every shape; proving it for primes means one argument, and the argument that works is a descent: show that some multiple with is a sum of four squares, then show can always be reduced, and land at .
The same statement about lattice points
There is a geometric reading, and it makes the difference between the cases into a difference between shapes.
A sum of four squares is the squared distance from the origin to a point of the four-dimensional integer lattice. So n is a sum of four squares means the sphere of radius √n in four-space passes through a lattice point, and Lagrange’s theorem says every such sphere does — which is a statement that the four-dimensional lattice is dense enough that no sphere of integer squared radius misses it.
In two dimensions the corresponding statement is false, and visibly so: the circle of radius √3 passes through no lattice point, and circles that miss the lattice are common. In three dimensions it is false but only just, failing on the thin set the last section names. In four it is true with room to spare.
The identity, read geometrically, says that multiplying a point of one lattice by a point of another produces a point of the same lattice at the product of the distances. That is a closure property of the lattice under a multiplication, and it is exactly what a ring is.
Three squares will not do, and the reason is two numbers
The pattern invites an obvious guess: two squares work, four work, so surely three do.
They do not, and the disproof is a pair of small numbers. Three is . Five is . Their product is fifteen, and fifteen is not a sum of three squares — the largest square below it is nine, and , , , none of which is a sum of two squares.
So there is no identity expressing a product of two sums of three squares as a sum of three squares, because any such identity would apply to and produce a representation that does not exist.
One counterexample kills every possible identity at once, which is a much stronger conclusion than checking any particular candidate formula. That is what makes the argument worth stating carefully: it does not say nobody has found a three-square identity, it says none exists.
Which numbers really need four
The three-square case is not hopeless, merely conditional. Legendre and Gauss settled it: a positive integer is a sum of three squares exactly when it is not of the form .
Fifteen is , so it fails. Twenty-eight is , so it fails. Seven, twenty-three, thirty-one — the numbers needing all four squares are exactly those, and the hero figure’s strip finds them by search and then checks them against the condition rather than colouring them from it.
The condition explains the failure of the identity in one line. The set of numbers that are sums of three squares is not closed under multiplication, because and are in it and is not; a set that is not closed under multiplication cannot be the value set of a multiplicative norm.
Eight squares, and where it stops
There is an eight-square identity too, found by Degen in 1818 and rediscovered by Graves and Cayley, and it comes from the octonions in exactly the way the four-square identity comes from the quaternions.
Then it stops. Hurwitz proved in 1898 that a bilinear identity expressing a product of two sums of squares as a sum of squares exists only for . The proof is a piece of linear algebra about the matrices such an identity would require, and it is one of the cleanest impossibility results in the subject.
So the list of dimensions is , arrived at here from a question about integers with no algebra in sight. The same list arrives at the tower of division algebras from a question about dividing, and at the composition algebras from a question about norms. Three independent questions with one answer is a sign that they are one question.
The identity as a rule for combining representations
Set aside the theorems and there is a practical use, which is how the identity was actually employed for two centuries.
Given a number written as a sum of four squares, and another, the identity produces a representation of their product without any search. Since and — the hero’s pair — the identity produces as directly, with no trial division and no hunting.
Before computers that mattered a great deal. Tables of representations were built multiplicatively, and the identity is the multiplication step. The same is true of the two-square identity, which is how tables of numbers as sums of two squares were assembled from the primes upward.
A constructive identity is worth more than an existence theorem when somebody has to produce an answer, and this is a case where the constructive version came first and the existence theorem was built on it.
Jacobi’s count, which the identity makes possible
Existence is the theorem everybody quotes; the count is the theorem that is actually used, and it is prettier.
Jacobi proved in 1829 that the number of ways to write as an ordered sum of four squares, signs and orders counted separately, is eight times the sum of the divisors of that are not divisible by four. For that is , which is the four coordinates times two signs. For the divisors are and , neither divisible by four, so — and indeed has six arrangements times four sign choices.
No integer has zero such divisors, so the count is never zero, and Lagrange’s theorem falls out of the formula as a corollary. That is a much more satisfying proof than a descent, because it explains rather than merely establishes: the number of representations is a divisor sum, and a divisor sum is positive.
The reason such a formula exists at all traces back to the identity. Counting representations of counts elements of norm in a ring of quaternions, and elements of a given norm are counted by looking at how the norm factors — which is possible exactly because the norm is multiplicative. The divisor structure of a number is doing the work, as it does in every count of this kind.
The order matters, and what that costs
One subtlety separates the four-square identity from the two-square one, and it is the non-commutativity again.
For complex numbers and are equal, so the two-square identity has one form. For quaternions they differ, so there are two four-square identities — one from and one from — giving generally different representations of the same product.
That is not a defect. It is the reason the number of representations of an integer as a sum of four squares is large: Jacobi’s formula says it is eight times the sum of the divisors not divisible by four, which grows, and the multiplicity comes from exactly this kind of freedom.
The count of asymmetric entries is worth having: of the sixteen products of basis units, six differ from their reverse and ten do not, since anything involving commutes and the three squares are equal to their own reverses. Six differences is what makes two identities rather than one, and each of those six is a sign.
Compare the two-square case, where the count is small and rigid — four times a difference of divisor counts — and the difference traces back to having four units and the integer quaternions having twenty-four. The number of units in a ring controls how many ways its elements factor, and the counts above are that principle in two instances.
Doing the descent, at seventeen
The reduction to primes is worth seeing once, because it is where the identity does its work.
Seventeen is , a sum of two squares, so nothing is needed. Take instead, which is and so needs four: . Now , and rather than search for a representation of , feed the two into the identity.
Writing and , the quaternion product is , which is . And .
No search, and the answer is exact. The whole cost was one quaternion multiplication, and the guarantee that it would work was the multiplicativity of the norm.
Why a norm has to be a quadratic form
There is a reason all of this is about squares rather than about cubes or higher powers, and it is short.
A norm that multiplies has to satisfy , and if is a polynomial of degree in the coordinates then the two sides have degree in each of and — which forces the norm to come from a bilinear multiplication. Requiring in addition that be positive definite, so that only zero has norm zero and division is possible, forces : a positive definite form of odd degree does not exist, and one of degree four or more cannot be multiplicative for a bilinear product.
So sums of squares is not one case among many. It is the only kind of expression that can behave this way at all, and the question of which admit an identity is the whole question rather than a first instance of a family.
Who found what, and how long the gap was
The chronology is worth a paragraph because the pieces arrived in an order nobody would design.
Diophantus had the two-square identity in the third century, as a rule for combining representations, with no algebra behind it. Fibonacci restated it in 1225. Euler wrote down the four-square identity in a letter to Goldbach in 1748 — ninety-five years before Hamilton found the quaternions — and he found it by algebraic experiment, looking for an expression that would work, not by deriving it from a multiplication.
So the identity that is the quaternion product was known for a century before the quaternions were, and used throughout that century for exactly the purpose it is used for here: reducing Lagrange’s theorem to the primes. Lagrange’s proof came in 1770 and leaned on Euler’s identity; Euler completed the descent in 1773.
The structure came last. Hamilton’s discovery in 1843 did not produce the identity; it explained one that had been in use for three generations, and the explanation is the whole of this essay’s first section. That is a common shape in mathematics and it is worth naming: a formula that works for no visible reason usually means a structure has not been found yet, and finding it converts a trick into a consequence.
The eight-square identity followed the same pattern in miniature. Degen wrote it down in 1818; Graves constructed the octonions in 1843, days after hearing of the quaternions, and found that the identity was their norm. Twenty-five years of a formula with no home.
What the pictures cannot show
An identity in eight variables is not a picture. The hero evaluates it at one pair of quaternions and checks both sides in exact integers, which is a demonstration and not a proof. The proof is the multiplication table, which is four lines of algebra and no geometry.
The strip stops at forty-eight, and the theorem does not. Every number in it needs at most four squares, and the pattern of which need exactly four is visible; that the pattern continues forever is Legendre’s theorem and nothing here bears on it.
And the non-existence of a three-square identity is shown by two numbers. That is a complete proof, and it is the one thing on this page that a figure could not have made more convincing — a picture of fifteen failing to be three squares is a picture of an absence.
Where the ladder goes next
The identity above worked in whole numbers because the quaternion product of whole quaternions is whole. The next rung asks what ring those whole quaternions form, and finds that the obvious answer is the wrong one: the integers among the quaternions include sixteen with half-integer coordinates, and without them there is no division algorithm and Lagrange’s theorem loses its cleanest proof.
Sideways: the primes that are sums of two squares is the two-dimensional case done properly, and what the coefficients already know is where identities of this kind live in the algebra of polynomials.
What is worth carrying away
An algebraic structure’s arithmetic properties are usually its geometric ones written in coordinates.
The quaternions were built to rotate space, and the fact making that work — the length of a product is the product of the lengths — becomes, on writing out coordinates, a theorem about which integers are sums of four squares. Neither statement mentions the other and they are the same statement.
So the way to find an identity is often to find a structure whose norm is the expression wanted. Sums of two squares need the complex numbers, four need the quaternions, eight need the octonions, and three need something that does not exist — which is why there is no identity, and why two small numbers are enough to say so.
What links here
Computed from the collection, not written here: the essays that point at this one.
Reads more easily once this is understood
Essays that name this one as worth reading first.
Shares its objects with
Essays that name at least two of the same things, and that neither author linked.
- Numbers that are their own parts — both name multiplicative function, primes
- The sieve written as a product — both name multiplicative function, primes
- The two supplements, and where the eight comes from — both name primes, sums of two squares
- Which primes a form takes — both name primes, sums of two squares
Named objects
A dashed tag is an object no other essay names yet.
Complex numbersDivision algebraIdentityMultiplicative functionNormPrimesQuaternionSums of two squares