# Hurwitz integers represented as sums of two squares of Hurwitz integers

I wonder if there exists a characterisation of Hurwitz integers which are represented as sums of two squares of Hurwitz integers, up to multiplication by a unit. And if so, could you please point to a reference?

By a Hurwitz integer I mean an integer in the ring of quaternions, that is, a quaternion whose components are either all integers or all half-integers.

It can be proved that we only need to concentrate on Hurwitz integers with integer components.

Thanks, and regards, Guillermo

-
Would a monograph by Linnik be helpful? –  Włodzimierz Holsztyński Dec 5 '13 at 6:01
Hmmm. Entire 1919 book by Hurwitz, and a chapter in Algebras and their Arithmetics by L. E. Dickson, about 1923 or so. –  Will Jagy Dec 5 '13 at 6:48
By analogy, is it true that any element of $\mathrm{M}_2(A)$ is of the form $X(Y^2+Z^2)$ with $X\in\mathrm{GL}_2(A)$ ? Some quick computations seem to show that it is true when $A=\mathbf Z_p$ ... but the problem seems to be more difficult with $A=\mathbf Z$. (Maybe this is very well known...) –  few_reps Dec 9 '13 at 10:28
@few_reps, apparently Guillermo's interest began with such matrix problems. arxiv stuff arxiv.org/find/math/1/au:+Delorme_C/0/1/0/all/0/1 also he sent me the 2006 dissertation of Anuhadha Gadre on Waring's problem for matrices over commutative rings with untiy –  Will Jagy Dec 9 '13 at 17:43
@WillJagy : done ! –  few_reps Dec 9 '13 at 21:36

I wrote a program; I like to know what I'm getting into before trying to prove things. I can already suggest that it appears all Hurwitz quaternions are expressible as $$q = u (r^2 + s^2),$$ where $q,u,r,s$ are Hurwitz quaternions and $u$ is a unit (there are 24 of those). For any fixed norm, so far at least one out of six such quaternions are the sum of two squares, and multiplication on the left by a unit gives everything. The worst behavior is norm 21, only 136 out of 768 Hurwitz quaternions of norm 21 are the sum of two squares.

About the sizes of things, in finding the sums of two squares (before multiplying by any unit): so far it has sufficed to take $r,s$ with norms less than double the norm of $q,$ so the norms of their squares are less that 4 times the square of the norm of $q.$ The extremes for this seem to occur when the norm of $q$ is already the square of a prime $p \equiv 3 \pmod 4.$ So, two examples are $q = r^2 + s^2$ with $$q = \frac{ 5}{2 } - \frac{ 3 }{2 } i - \frac{ 1 }{2 } j - \frac{ 1 }{2 } k, \; \; r^2= \frac{ 19}{2 } + \frac{ 21 }{2 } i + \frac{ 7 }{2 } j + \frac{ 7 }{2 } k, \; \; s^2 = -7 - 12 i - 4 j - 4 k$$ with norms $9,225,225,$ and $225 / 81 \approx 2.777$

Next $q = r^2 + s^2$ with $$q = \frac{ 13}{2 } - \frac{ 5 }{2 } i - \frac{ 1 }{2 } j - \frac{ 1 }{2 } k, \;$$ $$r^2= -\frac{ 61}{2 } - \frac{ 165 }{2 } i - \frac{ 33 }{2 } j - \frac{ 33 }{2 } k, \; s^2 = 37 +80 i +16 j +16 k$$ with norms $49,8281,8281,$ and $8281 / 2401 \approx 3.449$

EDIT, Sunday: I ran norm 121 overnight out of curiousity, with bound $6 n^2,$ which may or may not have really been large enough to correctly count the two squares. An extreme was $q = r^2 + s^2$ with $$q = \frac{ 7}{2 } + \frac{ 11 }{2 } i + \frac{ 1 }{2 } j - \frac{ 17 }{2 } k, \;$$ $$r^2= \frac{ 407}{2 } + \frac{ 155 }{2 } i + \frac{ 341 }{2 } j + \frac{ 31 }{2 } k, \; \; \; s^2 = -200 -72 i -168 j -24 k$$ with norms $121,76729,73984,$ and $76729 / 14641 \approx 5.241$

EDIT, Sunday afternoon. Every time I raise the multiple of square bound, I get new sums of two squares, which makes the previous count incorrect. I am going to just post these as they print out: the norms are correct, each coefficient is doubled, so coefficients are either all odd or all even. Divide by two to get the actual coefficients.

 13 :    -1    1   -5   -5       729 :   -45   21   15   15       784 :    44  -20  -20  -20
4.63905
norm    two squares    not        total
13         252          84         336


If need be I can find out what the squares are squares of. Part of a big speed improvement was dropping that printout.

Alright, sssssatistics. As I said, before multiplying on the left by the 24 units, the sums of two squares are not usually all items of that norm. For example, in norm $1,$ the six Hurwitz quaternions $\pm i, \pm j, \pm k$ are not the sum of two squares. Not my fault.

  norm     two squares   not         total
1          18           6          24
2           6          18          24
3          68          28          96
4          24           0          24
5          84          60         144
6          24          72          96
7         144          48         192
8          18           6          24
9         162         150         312
10          42         102         144
11         180         108         288
12          88           8          96
13         228         108         336
14          48         144         192
15         432         144         576
16          24           0          24
17         180         252         432
18          84         228         312
19         392          88         480
20         120          24         144
21         136         632         768
22         120         168         288
23         432         144         576
24          96           0          96
25         390         354         744
26          90         246         336
27         724         236         960
28         184           8         192
29         276         444         720
30         192         384         576
31         600         168         768
32          24           0          24
33         564         588        1152
34         114         318         432
35         864         288        1152
36         240          72         312
37         564         348         912
38         168         312         480
39         848         496        1344
40         138           6         144
41         588         420        1008
42         192         576         768
43         792         264        1056
44         264          24         288
45         900         972        1872
46         216         360         576
47         936         216        1152
48          88           8          96
49         642         726        1368


....................................................

-
so as not to bump: my computer says that not one of the 64 signed permutations of $6 + i + j + k$ is the sum of two squares of Hurwitz quaternions. –  Will Jagy Dec 15 '13 at 22:58

This is not an answer, but gives some (more) evidences.

Let's say that an algebra $A$ satisfies property $(P)$ if for any element $a$ of $A$ there exists an element $x$ in $A^\times$ and elements $y,z$ in $A$ such that the following equality hold $$a=x(y^2+z^2) \ \ .$$

$\bullet$ Let $R$ be a principal ideal domain, and assume $2$ is invertible in $R$. Then $A:=\mathrm{M}_2(R)$ satisfies property $(P)$.

Indeed, we can always write $$M=\left(\begin{array}{cc} \alpha &\beta\\ 0&\gamma\end{array}\right)= \left(\begin{array}{cc} u &\beta\\ 0&1-u\end{array}\right)^2 + \left(\begin{array}{cc} 0&1\\ \alpha-u^2&0\end{array}\right)^2$$ with $u=\frac{\alpha-\gamma+1}{2}$.

$\bullet$ The algebra $\mathrm{M}_2(\mathbf Z)$ satisfies proprty $(P)$. Let $M$ be an upper triangular matrix as above.

a) The above equality shows that if $\alpha-\beta$ is odd, we have a solution.

b) If $M$ is an even matrix, $M=2M'$, then the result follows from the result for $M'$ and the remark $$(\star)\ \ \ (x-y)^2+(x+y)^2=2x^2+2y^2\ \ .$$

c) If $\alpha$ and $\gamma$ are even, but $\beta$ is odd, then by rows manipulations, we can obtain a lower triangular matrix from $M$, with the first second diagonal entry even and the second odd. Thus we are in the same situation as in a).

d) If $\alpha$ and $\gamma$ are odd then up to row manipulations we can assume $\beta$ is even, $\beta=2\beta'$, and we can also assume that $\alpha-\gamma$ is a multiple of $4$. We write

$$M=\left(\begin{array}{cc} \alpha &\beta\\ 0&\gamma\end{array}\right)= \left(\begin{array}{cc} u &\beta'\\ 0&2-u\end{array}\right)^2 + \left(\begin{array}{cc} 0&1\\ \alpha-u^2&0\end{array}\right)^2$$ with $u=\frac{\alpha-\gamma+4}{4}$.

$\bullet$ Note that it's not true that any matrix in $\mathrm{M}_2(\mathbf Z)$ is a sum of two squares. A counter-example is $M=\left(\begin{array}{cc} 1 &0\\ 0&3\end{array}\right)$. But any matrix in $\mathrm{M}_2(\mathbf Z)$ is a sum of three squares. This can be found in Morris Newman, Sums of squares of matrices, PJM 118, 1985 (thanks to Will Jagy for the reference).

$\bullet$ Let $\mathbf H$ denote the ring of Hurewitz integers. The above remarks show that the property is true for $\mathbf H\otimes\mathbf Z_p$ for odd primes $p$ (edit : since there is an isomorphism of algebras $\mathbf H\otimes\mathbf Z_p\simeq \mathrm{M}_2(\mathbf Z_p)$). It would be interesting to know what happens for $\mathbf H\otimes\mathbf Z_2$.

Edit : computations indicate at least that $A :=\mathbf H\otimes\mathbf Z/32$ has property $(P)$, but that even more is true : any quaternion $q\in A$ can be written as the product of the image in $A$ of a unit of $\mathbf H$ and a sum of two squares. The problem, for now, is that the map $x\mapsto x^2$ is far from being smooth, and no Hensel lemma can be brutally invoqued.

$\bullet$ New Edit : So it seems $A:=\mathbf H\otimes\mathbf Z_2$ satisfies a strong form of property $(P)$ as explained above : any quaternion $q\in A$ can be written as the product of the image in $A$ of a unit of $\mathbf H$ and a sum of two squares.

Here is a proof :

$\to$ By $(\star)$, we note that it suffices to prove the result for quaternions whose class is non-trivial in $A\otimes\mathbf Z/2$.

$\to$ Let $f:A\to A$ be the map $x\mapsto x^2$. We compute $\mathrm{det}(d_x(f))=4\mathrm{Tr}(x)^2N(x)$. Let's say that a unit of $A$ is nice if its trace is a unit. For $x$ such a nice unit, the image of d_x(f)) contains $2.\mathbf H_2$. Thus a quaternion that has the same class in $A\otimes\mathbf Z/8$ than the square of a nice unit is the square of a nice unit.

$\to$ It hapens that all quaternions in $A\otimes\mathbf Z/8$ that are not trivial in $A\otimes\mathbf Z/2$ are the product of

• the image in $A\otimes\mathbf Z/8$ of a unit of $\mathbf H$

by

• the sum of two images in $A\otimes\mathbf Z/8$ of squares of nice units (direct computation).

$\to$ The result follows.

(Remark : $2$ is not a prime in $\mathbf H$. It is ramified. Thus these methods might well be refined by working mod $(1-i)^s$. In fact experiments show that the liftability of squares of nice units is already available from $A\otimes\mathbf Z/4$ on.)

-
A worthwhile exercise, i think; there are 384 signed permutations of the quadruple $(1,3,5,7).$ My computer is convinced that not one of the 384 Hurwitz quaternions gotten from $$\frac{1}{2} + \frac{3}{2} i + \frac{5}{2} j + \frac{7}{2} k$$ is the sum of two squares. I'd like to see a proof of that. –  Will Jagy Dec 11 '13 at 0:05
@WillJagy Did you try to run your program mod 4 or 8 ? This might give obstructions explaining this phenomenon ... –  few_reps Dec 11 '13 at 1:03
few, I don't think mod 8 is enough here, although there are some simple obstructions about the real coefficient alone.. In comparison mod 8, it did represent all the arrangements of $$\frac{3}{2} + \frac{3}{2} i + \frac{1}{2} j + \frac{1}{2} k$$ with fixed real part (so 3 * 8 = 24 with +- signs), also got $$\frac{-1}{2} + \frac{3}{2} i + \frac{3}{2} j + \frac{1}{2} k$$ and $$\frac{-3}{2} + \frac{3}{2} i + \frac{1}{2} j + \frac{1}{2} k,$$ but NOT any of the 24 $$\frac{1}{2} + \frac{3}{2} i + \frac{3}{2} j + \frac{1}{2} k.$$ –  Will Jagy Dec 11 '13 at 2:15
@WillJagy : One point to note is that a quaternion $q$ is the sum of two squares iff all $aqa^{-1}$ are sums of two squares ($a$ one of the $24$ units) ... and iff its conjugate is the sum of two squares ... this explains the symetries observed in the imaginary part (since we can change places and signs in the imaginary part by these operations) and the special role of the real part. –  few_reps Dec 11 '13 at 17:57
When you put it that way, I guess this is just the worst percentage among my experiments; so, with distinguished real part, and doubling so as not to typeset fractions, we are looking for eight proofs of impossibility: (-7;5,3,1) (-5;7,3,1) (-3; 7,5,1) (-1; 7,5,3) (1;7,5,3) (3;7,5,1) (5;7,3,1) (7;5,3,1) –  Will Jagy Dec 11 '13 at 20:19