**Remark 1:** On p.384 of volume 3 of Gauss's *Werke*, which is a part of an unpublished treatise on the arithmetic geometric mean, Gauss makes the following remark:

On the theory of the division of numbers into four squares: The theorem that the product of two sums of four squares is itself a sum of four squares, is most simply represented as follows: let $l,m,\lambda,\mu,\lambda',\mu'$ be six complex numbers such that $\lambda,\lambda'$ and $\mu,\mu'$ are conjugate. Let $N$ denote the norm, than $$(Nl+Nm)(N\lambda + N\mu)=N(l\lambda+m\mu)+N(l\mu'-m\lambda')$$ and also $$(N(n+in')+N(n''+in'''))(N(1-i)+N(1+i))=N((n+n'+n''-n''')+i(-n+n'+n''+n'''))+N((n+n'-n''+n''')-i(n-n'+n''+n'''))$$ From this it is easy to derive the following two propositions, in which different representation of a number by a sum of four squares refer to the different value systems of the four roots, taking into account both the signs and the sequence of the roots.1.If the fourfold of a number of the form $4k+1$ can be represented by four odd squares, then it can be represented half as often by one odd and three even squares, and vice versa, if a number can be represented in this way, that it can be represented twice as often in the first way.2.If the fourfold of a number of the form $4k+3$ can be represented by four odd squares, then it can be represented half as often by one even and three odd squares, and vice versa, if a number can be represented in this way, than its quadruple can be represented twice as often in the first way.

Gauss than says that a certain identity of theta functions can be derived by these two theorems, namely the assertion (written here in modern notation):

$$\vartheta_{00}(0;\tau)^4 = \vartheta_{01}(0;\tau)^4 + \vartheta_{10}(0;\tau)^4$$

(Gauss denotes the three theta functions by $p(y),q(y),r(y)$).

**Notes on remark 1:**

- The first identity in this passage is intimately connected with quaternions - actually it is a kind of pre Cayley-Dickson construction, since Gauss essentially says here that the quaternions multiplication rules arise from the rules of complex arithmetic and can be constructed by them. To see this more clearly, lets make the following steps:

$$Nl+Nm=N(l+mj)=N(l-mj)$$ $$N\lambda+N\mu = N(\lambda+\mu j)=N(\lambda+j\mu)$$

Since the quaternions algebra is a composition algebra, the norm is multiplicative, so: $$N(l-mj)\cdot N(\lambda+j\mu) = N((l-mj)\cdot(\lambda+j\mu)) = N((l\lambda -(mj)(j\mu))+l(j\mu)-(mj)\lambda) = N((l\lambda+m\mu))+l(\bar{\mu}j)-m(\bar{\lambda}j)) = N((l\lambda+m\mu))+(l\bar{\mu}-m\bar{\lambda})j) = N(l\lambda+m\mu)+N(l\bar{\mu}-m\bar{\lambda})$$

Here the associativity of quaternions is used, as well as the fact that (for example) $j\mu = \bar{\mu}j$. For more on Gauss's anticipation of the quaternions algebra, look at the (partially answered) post Motivating unpublished statements of Gauss about congruences and quaternions.

- The second identity follows directly from the first by substituting $\lambda = 1-i$ and $\mu = 1+i$. Since $N(1-i)+N(1+i)=4$, this identity enables one to generate new representations of an integer $4s$ as sum of four squares by simply changing the signs and order of the different numbers in the representation of $s$ as sum of four squares. For example, if $s = 13 = 2^2+2^2+2^2+1^2$ than this identity implies $52=4s = 5^2+3^2+3^2+3^2$.

**Remark 2**: On p. 1-2 of volume 8 of Gauss's *Werke* there is an additional note on the representation of numbers as sums of squares. According to Dickson's "history of the theory of numbers":

Gauss noted that every decomposition of a multiple of a prime $p$ into $a^2+b^2+c^2+d^2$ corresponds to a solution of $x^2+y^2+z^2\equiv 0 \pmod{p}$ proportional to $a^2+b^2,ac+bd,ad-bc$ or to the sets derived by interchanging $b$ and $c$ or $b$ and $d$. For $p\equiv 3 \pmod{4}$, the solutions of $1+x^2+y^2\equiv 0 \pmod{p}$ coincide with those of $1+(x+iy)^{p+1}\equiv 0 \pmod{p}$. From one value of $x+iy$ we get all by using: $$(x+iy)\frac{(u+i)}{(u - i)}$$ (where $u = 0,1,\cdots, p-1$). For $p\equiv 1 \pmod{4}, p = a^2+b^2$; then $b\frac{(u+i)}{a(u-i)}$ give all values of $x+iy$ if we exclude the values $a/b$ and $b/a$ of $u$.

**Notes on remark 2:**

The result of Gauss on the correspondence between the representation of a multiple of a prime number $p$ as sum of four squares and the solution to the congruence $x^2+y^2+z^2\equiv 0 \pmod{p}$ is straitforward to prove: $$x^2+y^2+z^2 = (a^2+b^2)^2+(ac+bd)^2+(ad-bc)^2=(a^2+b^2)^2+(a^2+b^2)(c^2+d^2)= (a^2+b^2)(a^2+b^2+c^2+d^2)\equiv 0 \pmod{p}$$. Therefore, what remains to be settled is the other results mentioned in remark 2.

The result on the correspondence between the solutions $(x,y)$ of the congruence $1+x^2+y^2\equiv 0 \pmod{p}$ and the solution of a certain imaginary congruence of degree $p+1$ was checked by me by taking specific examples: for example, if $p=7$, than $x = 3, y = 2$ is a solution, and $1+(3+2i)^8 = -238-28560i = 7\cdot(-34-4080i)$ is a Gaussian integer multiple of $7$.

The papers "

*On the Computation of Representations of Primes as Sums of Four Squares*" and "*The circle equation over finite fields*" mention results equivalent to Gauss's results in this remark. In particular, Gauss's method of generating new solutions to the congruence $1+x^2+y^2\equiv 0 \pmod{p}$ by $x+iy = (x_0+iy_0)(\frac{u+i}{u-i})$ is refered to as "the method of diophantus" in section 2.2 of the first paper i mentioned. Since both papers appear not to be very advanced, i believe that explaning the results in remark 2 is an easy task in the standards of mathoverflow.

**Questions**

- The two propositions which Gauss mentions in remark 1 are unclear to me, and I mean that the propositions themself are unclear, not their derivation. It is simply not formulated clearly. Therefore, I'd like to get an explanation of the two propositions which Gauss mentions, as well as an explanation of its proof.
- I'd like to understand how the theta function identity in remark 1 follows from the two propositions.
- What is the expalanation of the results in remark 2? they are complicated and i don't have a clue of understanding its proof.