**Background**

Modern claims that Gauss anticipated the quaternions algebra are based primarily on an unpublished fragment of Gauss dated to 1819 and entitled "**rotations of space**". In this fragment Gauss describes the quaternion rule for multiplication of two quadrupoles of numbers (which he calls "scales"), remarks it is non-commutative (he does not introduce special notation like $i,j,k$), and gives many formulas that relate 3D spatial rotations to unit quaternions, including one complicated $3\times 3$ orthogonal matrix that acts on a cartesian system $XYZ$ as a rotation. This is mentioned just in order to give background on this fragment of Gauss.

**Gauss's congruence**

What interests me in this fragment is especially part 5 of it; this part appears to deal not with the geometric aspects of quaternions but rather with its structure as an algebra over the integers. In it Gauss gave several congruences involving the elements of two quaternions $q_1=a+bi+cj+dk, q_2 = \alpha +\beta i + \gamma j +\delta k$ and their product $q_3 = q_1\cdot q_2 = A+Bi+Cj+Dk$ modulo the norm of one quaternion.

More specifically, Gauss denotes the norms $m = a^2+b^2+c^2+d^2, \mu=\alpha^2+\beta^2+\gamma^2+\delta^2$, and then says, for example:

$$\frac {{C+Di}}{{A + Bi}} \equiv \frac {{c + di}}{{a + bi}} \pmod m$$ 

(actually he writes down six such congruences, but they are all similar in structure so there is no need to write down all of them). For prime $m$, Gauss's congruence is in fact correct, as I will show here.

**Proof of Gauss's congruence**

To prove Gauss congruence lets introduce the following notation: $$x = a+bi,y = c+ di, u = \alpha + \beta i, v = \gamma + \delta i, X = A + Bi, Y = C + Di$$

First of all, one has to understand that Gauss's notation is different from modern convention in two aspects:

* When Gauss designates a quaternion by a collection of four coefficients $(a,b,c,d)$, he means $a+ib+jc+kd$ (not $a+bi+cj+dk$).
* Secondly, Gauss defines quaternions multiplication in such way that the product of two fundamental quaternions gives the third one with positive sign **if** the multiplication operation is done **counterclockwise** (not clockwise like in modern convention); that is, $ij=-k$ and $jk = -i$. That he defines quaternions multiplication in this way is evident from the bilinear expressions he give for the four coefficients $(A,B,C,D)$ of the product.

Therefore each of the quaternions $q_1= a + ib + jc +kd $ and  $q_2 = \alpha + i\beta  +j\gamma  + k\delta $ can be written as:
$$q_1 = x + jy$$ 
$$q_2 = u + jv$$

and:

$$q_3 = q_1q_2 = X+jY = (x + jy)(u+jv) = (xu - \bar y v) + j(yu + \bar x v)$$

The complex conjugate symbols appear because of the non-commutitivity of quaternions algebra; that is, $jy = \bar yj$. Finally, to prove Gauss's congruence, let's make the following step (multiplying both sides of the congruence by $(A+iB)(a+ib)$):

$$(C+Di)(a + bi)-(A+Bi)(c+di) = Yx - Xy = (yu + \bar x v)x - (xu - \bar y v)y = (x\bar x + y\bar y)v + (xy - xy)u =\rVert x + jy \rVert ^2 v$$

Since $\rVert x + yj \rVert ^2 = m$ one gets that that the result equals the product of m and an integral complex number.

So far, there was only one problematic step - that is the multiplication of both sides of the congruence by $Xx = (A+iB)(a+ib)$ and the conclusion that if the resulting congruences is correct than the original congruence is also correct. It should be more appropriate to prove, indeed, that m divides $\frac{||x+jy||^2v}{(A+iB)(a+ib)} = m\frac{v}{(A+iB)(a+ib)} = m(\epsilon+i\pi)$ where $\epsilon,\pi$ are rational numbers. However, since we are dealing with modular arithmetic, for prime $m$ every rational number has an equivalent integer (for example, $\frac{1}{3} \equiv 5 \pmod 7$), so after multiplication of the integer equivalent of $\epsilon + i\pi$ with $m$ the resulting Gaussian integer is really congruent to $0$ modulo $m$ . However, Gauss does not say $m$ is a prime number, so I guess these congruences are just intended to illustrate a general structural principle of quaternions.

**Questions**

Gauss does not explain anything about those six congruences; he just lists them down. Yet it is still surprising that the congruences are in fact correct, even though only for prime $m$. I cannot figure out what was his aim in "mixing" congruences with quaternions, but even if he had an idea here, I think this formula is a very cumbersome way of presenting it. Since the correctness of Gauss's congruence was confirmed (for prime $m$), the remaining question is - what was his motivation?

As far as I understand mathematical intuition, writing down such a formula without "walking" through the usual technical road to it must be the result of some idea, especially in mathematical areas that are considered frontiers (and quaternions were indeed a a frontier of mathematics at the times of Gauss).