Some prime factorizations of Lipschitz quaternions.
Version of 15 November 2011.
Dave Barber's other pages.

§ 1. A quaternion is an ordered quadruple of numbers, interpreted and manipulated according to specific rules. For most applications throughout mathematics the four components are allowed to be any real numbers, but here we examine quaternions where each component is restricted to being an integer — these being the Lipschitz quaternions.

Not studied here are the more general Hurwitz quaternions, where each component can be either a whole integer, or half of an odd integer; with the restriction that wholes and halves cannot be mixed within the same quaternion. The Hurwitz quaternions have essentially unique prime factorizations, while the Lipschitz quaternions often do not. The main feature of this report is a list exhibiting many sets of contrasting Lipschitz prime factorizations.

Notation varies from one author to the next, but we write the four components of a quaternion as a comma-separated list between two square brackets; for example [ +1, −2, +3, 0 ] and [ 0, 0, 0, 0 ]. The four components of quaternion Q are Qh, Qi, Qj and Qk, yielding the notational identity Q ≡ [ Qh, Qi, Qj, Qk ].


§ 2. As with any ordered n-tuples, two quaternions are equal if and only if their respective components are equal. So if P = Q, then Ph = Qh et cetera.

Addition is in parallel:

P + Q = [ Ph + Qh, Pi + Qi, Pj + Qj, Pk + Qk ]

which could have been written:

(P + Q)h = Ph + Qh
(P + Q)i = Pi + Qi
(P + Q)j = Pj + Qj
(P + Q)k = Pk + Qk

Addition has the usual properties of associativity and commutativity. The additive identity is Z = [ 0, 0, 0, 0 ].

Subtraction is obvious:

PQ = [ PhQh, PiQi, PjQj, PkQk ]

Multiplication by a scalar is straightforward. The scalar should be a real integer.

P × n = n × P [ Ph × n, Pi × n, Pj × n, Pk × n ]

Define:

H = [ 1, 0, 0, 0 ]
I = [ 0, 1, 0, 0 ]
J = [ 0, 0, 1, 0 ]
K = [ 0, 0, 0, 1 ]

Using scalar multiplication, Q = Qh × H + Qi × I + Qj × J + Qk × K.

Division by a scalar is of limited avail for integer quaternions. Q ÷ n will equal [ Qh ÷ n, Qi ÷ n, Qj ÷ n, Qk ÷ n ] only when each of the four component quotients turns out to be an integer. Most of the time this does not happen, leaving scalar division undefined in those cases.


§ 3. Multiplication of two quaternions is responsible for their distinctive character:

(P × Q)h = Ph × QhPi × QiPj × QjPk × Qk
(P × Q)i = Ph × Qi + Pi × Qh + Pj × QkPk × Qj
(P × Q)j = Ph × QjPi × Qk + Pj × Qh + Pk × Qi
(P × Q)k = Ph × Qk + Pi × QjPj × Qi + Pk × Qh

Although associative, multiplication is NOT in general commutative, as illustrated by I × J = +KJ × I = −K. Still, multiplication distributes over addition.

Because it serves as the multiplicative identity, H is identified with the real number unity. More broadly, [ Qh, 0, 0, 0 ] equals the real number Qh. Multiplication is assuredly commutative if either factor happens to be a real number — this is simply the multiplication by a scalar mentioned above.

Quaternions of the form [ Qh, Qi, 0, 0 ] (among many other possibilities) are isomorphic to the complex numbers. By analogy thereto, Qh is termed the real part of Q, while Qi, Qj and Qk are the imaginary parts. A celebrated result is that I2 = J2 = K2 = I × J × K = −1, and the fact that −1 has at least three distinct square roots reveals that quaternions are nontrivial in how they extend the complex numbers.

The conjugate of [ Qh, Qi, Qj, Qk ] negates the imaginary parts:

Q* = [ +Qh, −Qi, −Qj, −Qk ]

Conjugation provides a special kind of commutativity: (P × Q)* = Q* × P*. Conveniently, Q* × Q = Q × Q* = (Qh)2 + (Qi)2 + (Qj)2 + (Qk)2, which is a real number. Note the difference between (Qh)2 and (Q2)h.

We define the norm of Q as | Q | = Q* × Q, whose square root is the well-known Euclidean norm. Although the Euclidean norm is extrememly useful in much of mathematics, it is not helpful in the study of integer quaternions because it is usually an irrational number. Importantly, the norm is preserved by multiplication: | P × Q | = | P | × | Q |. Because of this, a quaternion whose norm is prime is prime itself. For instance, [ +3, −2, −2, 0 ] is prime because its norm, 17, is a prime real number.

Also preserved in multiplication is cycling of the imaginary components; this amounts to a rotative change of basis of the imaginary parts. Specifically, when:

[ Ph, Pi, Pj, Pk ] × [ Qh, Qi, Qj, Qk ] = [ Rh, Ri, Rj, Rk ]

then:

[ Ph, Pk, Pi, Pj ] × [ Qh, Qk, Qi, Qj ] = [ Rh, Rk, Ri, Rj ]


§ 4. If P × Q = H, we say that each of P and Q is a multiplicative inverse of the other. This might be written P = Q−1 or Q = P−1. When the components of a quaternion are allowed to be any real numbers, only Z fails to have an inverse, but with integer quaternions the offerings are much more limited; only eight Lipschitz quaternions have inverses. Here they are, arranged in mutually invertive (also conjugate) pairs:

[ +1,    0,    0,    0   ] × [ +1,    0,    0,    0   ] = H
[ -1,    0,    0,    0   ] × [ -1,    0,    0,    0   ] = H
[  0,   +1,    0,    0   ] × [  0,   -1,    0,    0   ] = H
[  0,    0,   +1,    0   ] × [  0,    0,   -1,    0   ] = H
[  0,    0,    0,   +1   ] × [  0,    0,    0,   -1   ] = H

In this table are all the integer quaternions of norm 1; we call these units. Two quaternions Q and Q′ are similar if there exist two units U and V such that Q′ = U × Q × V. Similarities of factorizations can also be defined; when Q = R × S:

Along the same lines, employing a unit W, T is half-similar to T × W and W × T. Of course, T × W can be rendered as H × T × W to obtain a formal full similarity.

All these similarities are equivalence relations, and are key in shortening the search for factorizations.


§ 5. The components of a quaternion can be manipulated to some extent through similarities. Let Q = [ a, b, c, d ]. One can change the signs of exactly two or four components, without changing their sequence, by multiplying Q fore and aft by suitable units:

[  0, +1,  0,  0 ] × Q × [  0, +1,  0,  0 ] = [ -a, -b, +c, +d ]
[  0,  0, +1,  0 ] × Q × [  0,  0, +1,  0 ] = [ -a, +b, -c, +d ]
[  0,  0,  0, +1 ] × Q × [  0,  0,  0, +1 ] = [ -a, +b, +c, -d ]
[  0,  0,  0, +1 ] × Q × [  0,  0,  0, -1 ] = [ +a, -b, -c, +d ]
[  0,  0, +1,  0 ] × Q × [  0,  0, -1,  0 ] = [ +a, -b, +c, -d ]
[  0, +1,  0,  0 ] × Q × [  0, -1,  0,  0 ] = [ +a, +b, -c, -d ]
[ +1,  0,  0,  0 ] × Q × [ -1,  0,  0,  0 ] = [ -a, -b, -c, -d ]

Units also give the permutations which are pairwise swaps:

[ 0,  0,  0, +1 ] × Q × [ 0,  0, -1,  0 ] = [ b, a, d, c ]
[ 0, +1,  0,  0 ] × Q × [ 0,  0,  0, -1 ] = [ c, d, a, b ]
[ 0,  0, +1,  0 ] × Q × [ 0, -1,  0,  0 ] = [ d, c, b, a ]

Although the similarity relations can change only an even number of signs, there are other transformations that will change an odd number. If P × Q = R, then:

[ −Qh, +Qi, +Qj, +Qk ] × [ −Ph, +Pi, +Pj, +Pk ] = [ +Rh, −Ri, −Rj, −Rk ]
[ +Qh, −Qi, +Qj, +Qk ] × [ +Ph, −Pi, +Pj, +Pk ] = [ +Rh, −Ri, +Rj, +Rk ]
[ +Qh, +Qi, −Qj, +Qk ] × [ +Ph, +Pi, −Pj, +Pk ] = [ +Rh, +Ri, −Rj, +Rk ]
[ +Qh, +Qi, +Qj, −Qk ] × [ +Ph, +Pi, +Pj, −Pk ] = [ +Rh, +Ri, +Rj, −Rk ]

The first of those amounts to (P × Q)* = Q* × P*.

Another approach gives the following extractive formulas may be helpful for some kinds of investigation:

[ Qh, 0, 0, 0 ] = (H × Q × HI × Q × IJ × Q × JK × Q × K) ÷ 4
[ 0, Qi, 0, 0 ] = (H × Q × HI × Q × I + J × Q × J + K × Q × K) ÷ 4
[ 0, 0, Qj, 0 ] = (H × Q × H + I × Q × IJ × Q × J + K × Q × K) ÷ 4
[ 0, 0, 0, Qk ] = (H × Q × H + I × Q × I + J × Q × JK × Q × K) ÷ 4

where the divisions are guaranteed to be exact.


§ 6. Division of one quaternion by another is of limited usefulness, particularly in the integer version. The usual implementation of the operation is to multiply the dividend by the inverse of the divisor, so that P ÷ Q might equal P × Q−1 (right division). On the other hand, Q−1 × P (left division), which is usually a different value, is just as valid. Moreover, when Q = R × S, a mixture of left and right divisions is possible: R−1 × P × S−1 or S−1 × P × R−1. All four of these will produce answers with the correct norm.

If Q is not a unit, then an expression like P × Q−1 is not even meaningful for the integer quaternions unless we take special action. Thus we define

The scheme can be extended: The gist is to multiply everything that can be multiplied, and then divide; this offers the greatest chance that common factors of numerator and denominator will be in the right place to cancel each other and yield a valid answer. Still, the contained scalar divisions will not usually work, and the consequent rarity of factorizations is what makes the search for them interesting.

Although P × P−1 trivially exists, interposing a unit may ruin it. For instance, if P = [ +2, +3, +5, +7 ] then P × I × P−1 = [ 0, −61, +58, +22 ] ÷ 87 which is not an integer quaternion.

Should a divisor be zero, as in Q ÷ Z, the operation inevitably fails.


§ 7. The shape of a quaternion is an ordered quadruple, formed by taking the absolute values of the components of a quaternion, and arranging them in decreasing order. It is written as a comma-separated list within shallow angle brackets. For instance, the shape of [ +5, −2, +7, −7 ] is ⟨ 7, 7, 5, 2 ⟩. Repeated numbers are significant, so a shape is not a set.

Two quaternions of the same shape are comorphic, written PQ.

The flexibility is the quantity of distinct quaternions that can be formed from a shape. It depends on how many permutations the components can be arranged into, and how many of them are nonzero. The flexibility varies widely, as shown in table 7.1:

Table 7.1
shapeexampleflexibility number of classes
full similarityhalf similarity
No zeroes no equal components ⟨ 7, 5, 3, 2 ⟩384 = 16 × 24 1248
one pair of equal components ⟨ 7, 5, 5, 2 ⟩192 = 16 × 12 624
two pairs of equal components⟨ 7, 7, 5, 5 ⟩ 96 = 16 × 6 612
three equal components ⟨ 7, 5, 5, 5 ⟩ 64 = 16 × 4 2 8
four equal components ⟨ 7, 7, 7, 7 ⟩ 16 = 16 × 1 2 2
One zero no equal components ⟨ 7, 5, 3, 0 ⟩192 = 8 × 24 624
one pair of equal components ⟨ 7, 5, 5, 0 ⟩ 96 = 8 × 12 312
three equal components ⟨ 5, 5, 5, 0 ⟩ 32 = 8 × 4 1 4
Two zeroes one pair of equal components ⟨ 7, 2, 0, 0 ⟩ 48 = 4 × 12 3 6
two pairs of equal components⟨ 7, 7, 0, 0 ⟩ 24 = 4 × 6 3 3
Three zeroes three equal components ⟨ 7, 0, 0, 0 ⟩ 8 = 2 × 4 1 1
Four zeroes four equal components ⟨ 0, 0, 0, 0 ⟩ 1 = 1 × 1 1 1

This table also gives the number of similarity classes into which the quaternions of a particular shape can be partitioned. The Lipschitz quaternions (fully) similar to [ a, b, c, d ] form no more than twelve classes, with representatives in table 7.2:

Table 7.2
Row 1: [ a, ±d,  b,  c ] [ a, ±d,  c,  b ] 
Row 2: [ a,  c, ±d,  b ] [ a,  b, ±d,  c ] 
Row 3: [ a,  b,  c, ±d ] [ a,  c,  b, ±d ]

Under half-similarity, there are at most 48 classes (table 7.3). Whether by W × T or T × W, the same similarity classes are produced.

Table 7.3
[ +a, ±b, ±c, ±d ] [ +a, ±d, ±b, ±c ] [ +a, ±c, ±d, ±b ]
[ +a, ±b, ±d, ±c ] [ +a, ±c, ±b, ±d ] [ +a, ±d, ±c, ±b ]

Some of these representatives will combine if there are repeated numbers in the shape, or if any of the numbers are zero.


§ 8. The norm of shape ⟨ a, b, c, d ⟩ equals the norm of quaternion [ a, b, c, d ]; useful is the simple fact that comorphic quaternions have equal norms. By way of example, here are the shapes possible with some norms that are small integers:

Table 8.1
NormShapesNormShapes
0⟨ 0, 0, 0, 0 ⟩ 11⟨ 3, 1, 1, 0 ⟩
1⟨ 1, 0, 0, 0 ⟩ 12⟨ 2, 2, 2, 0 ⟩ ⟨ 3, 1, 1, 1 ⟩
2⟨ 1, 1, 0, 0 ⟩ 13⟨ 2, 2, 2, 1 ⟩ ⟨ 3, 2, 0, 0 ⟩
3⟨ 1, 1, 1, 0 ⟩ 14⟨ 3, 2, 1, 0 ⟩
4⟨ 1, 1, 1, 1 ⟩ ⟨ 2, 0, 0, 0 ⟩ 15⟨ 3, 2, 1, 1 ⟩
5⟨ 2, 1, 0, 0 ⟩ 16⟨ 2, 2, 2, 2 ⟩ ⟨ 4, 0, 0, 0 ⟩
6⟨ 2, 1, 1, 0 ⟩ 17⟨ 3, 2, 2, 0 ⟩ ⟨ 4, 1, 0, 0 ⟩
7⟨ 2, 1, 1, 1 ⟩ 18⟨ 3, 2, 2, 1 ⟩ ⟨ 3, 3, 0, 0 ⟩ ⟨ 4, 1, 1, 0 ⟩
8⟨ 2, 2, 0, 0 ⟩ 19⟨ 3, 3, 1, 0 ⟩ ⟨ 4, 1, 1, 1 ⟩
9⟨ 2, 2, 1, 0 ⟩ ⟨ 3, 0, 0, 0 ⟩ 20⟨ 3, 3, 1, 1 ⟩ ⟨ 4, 2, 0, 0 ⟩
10⟨ 2, 2, 1, 1 ⟩ ⟨ 3, 1, 0, 0 ⟩ 21⟨ 3, 2, 2, 2 ⟩ ⟨ 4, 2, 1, 0 ⟩

A famous theorem assures that there will be at least one shape for every norm.

Consider Q = R × S and Q′ = R′ × S′. These two factorizations are by definition comorphic if either of the following conditions is true:

Parentheses are helpful in clarifying that this is a comorphism between equalities, and not a three-member equality the middle member of which is a comorphism:

(Q = R × S) ≈ (Q′ = R′ × S′)

Two quaternions can be comorphic without being similar, as [ 3, 5, 7, 9 ] and [ 3, 5, 9, 7 ], as no multiplication by units will exchange exactly two elements. On the other hand, similarity does imply comorphism.


§ 9. In the search for "interesting" prime factorizations, we look at those Lipschitz quaternions whose norm is the product of two (real) prime numbers. An example is [ −2, +1, −1, +3 ], whose norm is 15 = 3 × 5; where to seek factors are therefore the shapes ⟨ 1, 1, 1, 0 ⟩ and ⟨ 2, 1, 0, 0 ⟩.

To be more thorough, we could divide every quaternion of shape ⟨ 3, 2, 1, 1 ⟩ by every quaternion of shape ⟨ 2, 1, 0, 0 ⟩ and see what integer quotients emerge; but this would yield huge numbers of almost-the-same results, in the worst case entailing 384 × 384 = 147,456 attempts at division, far too many for practical purposes. Instead, we use similarities and comorphisms to get at the heart of the matter without losing generality.

Consider quaternions Q, R and S of shapes X, Y and Z respectively. As before, U, V and W are units. If we know the behavior of

Q × S−1 = R hence Q = R × S
or
S−1 × Q = R hence Q = S × R

we can readily infer the behavior of

U × Q × V = (U × R) × (S × V)
or
U × Q × V = (U × S) × (R × V)

Specifically, if there is a factorization not using the units, there will surely be a comorphic factorization using them. Thus we need consider, as candidates for Q, only dissimilar members of shape X. This reduces, in the worst case, the number of instances from 384 to 12, which are listed in table 7.2. Even better, the rotative transformations at the end of section three, when applied, mean that row 1 of table 7.2 will suffice without loss of generality. This means that the maximum number of candidates for Q falls to four.

By the same token, we can surmise the behavior of

Q = (R × W) × (W−1 × S)
or
Q = (S × W−1) × (W × R)

While Y might have as many as 384 members, half-similarity means that we need consider no more than 48 candidates (table 7.3) for S.


In our computer program that performed a search, satisfactorily fast performance was achieved by using 4 values for the dividend Q and 48 for the divisor S. Further simplifications are likely possible, particularly since every example found by the search could be realized with a quotient whose components were all nonnegative.

The algorithm from this point on was no more than a brute-force search. The program simply tried these equations:

Q × S−1 = R
S−1 × Q = R

successively using 4 quaternions from the shape of Q, and 48 from that of S. Whenever a solution R was found, the search proceeded to another shape for the divisor; and when those were exhausted, another shape for the dividend. The goal was to find all noncomorphic factorizations associated with each combination of shapes. A lengthy table (963 kilobytes) was produced, with an excerpt below:

 N 39 = 13 x 3

   [  5   3   2   1 ]
 = [  2  -1   2   2 ] x [  1   1  -1   0 ]
 = [  1  -1  -1   0 ] x [  0   3   2   0 ]

 N 65 = 13 x 5

   [  6   4   3   2 ]
 = [  3   2   0   0 ] x [  2   0   1   0 ]
 = [  2   0   0  -1 ] x [  2   1   2   2 ]

 N 143 = 13 x 11

   [  9   6   5   1 ]
 = [  2   2   2  -1 ] x [  3  -1   0   1 ]
 = [  3   0   1   1 ] x [  3   2   0   0 ]

   [  9   7   3   2 ]
 = [  2   2   1   2 ] x [  3   0  -1  -1 ]
 = [  3  -1   0   1 ] x [  2   3   0   0 ]

 N 221 = 17 x 13

   [ 10   9   6   2 ] S 
 = [  2   3   0   2 ] x [  3   0   0  -2 ]
 = [  2   2   2   1 ] x [  4   0  -1   0 ]

 N 1369 = 37 x 37

   [ 37   0   0   0 ] S 
 = [  4  -4  -2  -1 ] x [  4   4   2   1 ]
 = [  5  -2  -2  -2 ] x [  5   2   2   2 ]
 = [  6  -1   0   0 ] x [  6   1   0   0 ]

To reduce the number of characters in the large table, commas between quaternion components have been omitted. Also to save space are used the abbreviations 'N' for norm, and 'S' for strong. Two factorizations are strong if neither factor of one factorization is comorphic with either factor of the other. In the excerpt above, the two factorizations of [ 10, 9, 6, 2 ] illustrate this. The alternative is weak, as with the two factorizations of [ 6, 4, 3, 2 ], where [ 2, 0, 0, −1 ] and [ 2, 0, 1, 0 ] are comorphic. Because [ 3, 2, 0, 0 ] and [ 2, 1, 2, 2 ] are not comorphic, the factorizations still qualify for listing.