1 The quantum model and the mathematical problem

In [7], a model of discrete quantum computation is introduced that leads to a curious arithmetic problem related to the representation as a sum of squares. The motivation in that paper is to find a discrete set of states as small as possible that is closed by the Hadamard gate H (inducing entanglement) and by the phase shift gate \(\varphi =\pi /2\) (commonly called S) with two control qubits. It turns out that this discrete set is the lattice generated by the canonical basis with Gaussian integer coefficients. In mathematical terms, this is related to the nearly tautological fact that the smallest ring containing 1 (as an integer) and \(i=\sqrt{-1}\) is \({\mathbb {Z}}[i]\) because H introduces the addition and the subtraction and S the multiplication by i.

Given an orthogonal set of these discrete states, it is always possible to complete it to an orthogonal basis of the vector space; in particular, an observable can be constructed having them as eigenstates. The normalization ruins in some way the discreteness, and we would like to have all the basis vectors sharing the same norm to clear denominators after the normalization. In the context of quantum computation, the underlying vector space is \(\bigotimes _{k=1}^n {\mathbb {C}}^2\) with n the number of qubits, and then, the dimension is always a power of two. It is indeed doubled when we consider the lattice of the discrete set of states above over \({\mathbb {Z}}\) because \([{\mathbb {Z}}[i]:{\mathbb {Z}}]=2\). But we can pose the problem in any dimension from a mathematical point of view. Namely, we consider the following statement:

Problem 1

For a given dimension d, decide whether every set of orthogonal vectors in \({\mathbb {Z}}^d\) with the same norm can be extended with new integral vectors of the same norm to get an orthogonal basis of \({\mathbb {R}}^d\).

In [11], the problem is solved in the affirmative for \(d=4\) for sets of vectors having as norm the square root of a prime number, meaning that any of these sets can be extended to complete a basis. It is also proved that for any \(d>2\) with \(4\not \mid d\) there are sets such that the extension to an orthogonal basis is not possible. Note that the case \(d=2\) is trivial because (ab) and \((b,-a)\) are orthogonal of the same norm.

To give some insight about the complexity of the situation, we mention some examples for \(d=3\). The vector \(\vec {v}=(1,3,5)\in {\mathbb {Z}}^3\) has norm \(\sqrt{35}\) and there does not exist any other vector in \({\mathbb {Z}}^3\) orthogonal to \({v}\) with this norm. On the other hand, if the starting vector is \(\vec {v}=(2,3,6)\in {\mathbb {Z}}^3\), having norm 7, we can complete it to the orthogonal basis \(\big \{\vec {v}, (3,-\,6,2), (6,2,-\,3)\big \}\) of vectors of the same norm. An intermediate example is \(\vec {v}= (1, 4, 10)\) with \(\Vert \vec {v}\Vert =\sqrt{117}\), which can be extended to \(\big \{\vec {v}, (-\,8, 7, -\,2)\big \}\) preserving the norm, but it is not possible to extend this orthogonal set (or any other containing \(\vec {v}\)) to an orthogonal basis formed by vectors of norm \(\sqrt{117}\).

These and other examples in different dimensions suggest a finer formulation of the problem above separating different norms and allowing partial extensions. With this idea in mind, we introduce some notation. Let \({\mathcal {O}}_d(N,n)\) be the collection of sets \({\mathcal {S}}\subset {\mathbb {Z}}^d\) of orthogonal vectors of norm \(\sqrt{N}\) with \(\#{\mathcal {S}}=n\). We are interested in characterizing

$$\begin{aligned} {\mathcal {C}}_d(n_1,n_2) = \big \{ N\in {\mathbb {Z}}^+\,:\, \forall {\mathcal {S}}\in {\mathcal {O}}_d(N,n_1) \ \exists {\mathcal {S}}'\in {\mathcal {O}}_d(N,n_2) \text { with } {\mathcal {S}}'\supset {\mathcal {S}} \big \} \end{aligned}$$

for \(1\le n_1<n_2\le d\).

In the case \(d=4\), the aforementioned result of [11] can be rephrased with this notation saying that, for any \(1\le n_1<n_2\le 4\), \({\mathcal {C}}_d(n_1,n_2)\) contains the prime numbers. However, the main conjecture in that paper is that the prime numbers do not play any role in the problem for \(d=4\):

Conjecture 2

[11]. Problem 1 has an affirmative answer when \(d=4\). In other words, \({\mathcal {C}}_4(n_1,n_2)={\mathbb {Z}}^+\) for \(1\le n_1<n_2\le 4\).

One of our main results is the full proof of this conjecture. For instance, \(\vec {v}= (4, 5, 6, 7)\) and \(\vec {w}= (-\,7, -\,2, -\,3, 8)\) are vectors in \({\mathbb {Z}}^4\) with norm \(\sqrt{126}\) and we find that adding the vectors \((-\,5, -\,4, 9, -\,2)\) and \((-\,6, 9, 0, -\,3)\), having also norm \(\sqrt{126}\), we get an orthogonal basis.

The structure of the paper is as follows: In Sect. 2, we treat the case of sets \({\mathcal {S}}\subset {\mathcal {O}}_d(N,d-1)\). It is proved (Corollaries 6, 8) that in this situation the extension is always possible if d is even and only possible for integral norms if d is odd. After a digression to introduce some arithmetic results on quaternions in Sect. 3, we face the cases of dimension 3 and 4 in Sects. 4 and 5. The solution in the latter case is complete (Theorem 17), and we prove the main conjecture in [11]. For \(d=3\), we get a solution of the problem with the original statement (Theorem 16), but we fail to completely characterize the norms such that for any vector of that norm there exists a new orthogonal vector of the same norm. We show (Proposition 14) that these norms when squared are numbers representable as a sum of two squares, in particular they have vanishing asymptotic density. The numerical computations suggest that they form a much more sparse sequence. Finally, in Sect. 6 we prove some results for the higher-dimensional cases.

2 The case of codimension 1

It will be convenient to consider the following linear algebra result, which is related to the so-called matrix determinant lemma [6, Lemma 1.1], but we have not found it in the literature.

Proposition 3

Let A be the \((d-1)\times d\) matrix formed by the first \(d-1\) rows of an orthogonal matrix. Let \(\vec {c}\) be the first column of A and B the rest of the matrix. Then, \(\vert \det (B)\vert ^2= 1-\Vert \vec {c}\Vert ^2\).

Proof

Since \(AA^t=I\), with I the \((d-1)\)-identity matrix, we have \(\vec {c}{c}^t+BB^t=I\) and the following identities hold with \(\vec {0}\) the null vector in \({\mathbb {R}}^{d-1}\):

$$\begin{aligned} \begin{pmatrix} \vec {c}&{}B \\ 1&{}\vec {0}^t \end{pmatrix} \begin{pmatrix} \vec {c}^t&{}1 \\ B^t&{}{0} \end{pmatrix} = \begin{pmatrix} I&{}\vec {c} \\ \vec {c}^t&{}1 \end{pmatrix} = \begin{pmatrix} I&{}{0} \\ \vec {c}^t&{}1 \end{pmatrix} \begin{pmatrix} I&{}\vec {c} \\ \vec {0}^t&{}1-\Vert {c}\Vert ^2 \end{pmatrix}. \end{aligned}$$

Taking determinants \((-1)^{d-1}\det (B)\cdot (-1)^{d-1}\det (B^t)=1\cdot (1-\Vert \vec {c}\Vert ^2)\) and the result follows. \(\square \)

Corollary 4

Let M be a \((d-1)\times d\) integral matrix such that its rows form a set in \({\mathcal {O}}_d(N,d-1)\). Let \(\vec {c}_j\) be its j-th column and \(M_{(j)}\) the resulting square matrix when it is omitted. Then, \( \vert \det (M_{(j)})\vert ^2= N^{d-2}(N-\Vert \vec {c}_j\Vert ^2). \)

Proof

For \(j=1\), apply Proposition 3 to \(A=N^{-1/2} M\) to get the formula \((N^{-1/2})^{2(d-1)}\vert \det (M_{(1)})\vert ^2= 1-\Vert \vec {c}_1\Vert ^2/N\), which gives the result. For \(j\ne 1\), the same argument works permuting the columns. \(\square \)

Note that for d even this implies that \(N-\Vert \vec {c}_j\Vert ^2\) is always a square, which does not seem obvious at all. Also, for the first nontrivial odd case \(d=3\), we would have to prove that given \((a,b,c)\in {\mathbb {Z}}^3\) with \(a^2+b^2+c^2=N\), any solution of the Diophantine equation

$$\begin{aligned} {\left\{ \begin{array}{ll} x^2+y^2+z^2=N, \\ ax+by+cz=0 \end{array}\right. } \end{aligned}$$

verifies that \(N(N-a^2-x^2)\) is a square. Proving it without using the previous result is a challenge harder than it seems. The shortest proof, based only on direct algebraic manipulations, that we have found is:

$$\begin{aligned} N(N-a^2-x^2)&=(N-a^2)N-Nx^2\\&= (b^2+c^2)(x^2+y^2+z^2)-(a^2+b^2+c^2)x^2\\&= -a^2x^2+(b^2+c^2)(y^2+z^2). \end{aligned}$$

By the second equation in the Diophantine system, \(a^2x^2=(by+cz)^2\). Thus,

$$\begin{aligned} N(N-a^2-x^2)&=-(by+cz)^2+b^2y^2+c^2z^2+b^2z^2+c^2y^2\\&=b^2z^2+c^2y^2-2bycz=(bz-cy)^2. \end{aligned}$$

The next proposition is a generalization of a result discussed in [11, §2] for \(d=4\). Note that the proof given there for that particular dimension, by “polynomial checking”, requires cumbersome calculations, difficult to check without a computer-based algebraic manipulator, and it is unclear how to generalize the procedure.

Proposition 5

With the notation as in Corollary 4, for d even the row vector \(\vec {w}\) with coordinates \(w_j=(-1)^j N^{(2-d)/2}\det (M_{(j)})\) satisfies \(\vec {w}\in {\mathbb {Z}}^d\), is orthogonal to the rest of the rows of M and has the same norm \(\sqrt{N}\).

Proof

The dot product of \({w}\) and the i-th row of M is proportional to the sum \(\sum _{j=1}^d(-1)^{i+j} m_{ij} \det (M_{(j)})\) and it vanishes because it is the expansion along the first row of M completed to a square matrix repeating the i-th row as first row. Then, \(w_j\) is orthogonal to the rows of M.

Using Corollary 4,

$$\begin{aligned} \Vert {w}\Vert ^2 = N^{2-d} \sum _{j=1}^d N^{d-2}(N-\Vert {c}_j\Vert ^2) = dN - \sum _{j=1}^d \Vert {c}_j\Vert ^2 = dN-(d-1)N =N. \end{aligned}$$

Then, \({w}\) has the same norm as the rows of M.

Finally, note that Corollary 4 assures that \(N^{d-2}\) divides \(\vert \det (M_{(j)})\vert ^2\). If d is even, it implies \(N^{(d-2)/2}\mid \det (M_{(j)})\), hence \(w_j\in {\mathbb {Z}}\). \(\square \)

The previous proposition gives us directly the following

Corollary 6

If d is even, then \({\mathcal {C}}_d(d-1,d)={\mathbb {Z}}^+\).

The odd case can also be treated with similar tools.

Proposition 7

If d is odd and N is not a square, then \({\mathcal {S}}\in {\mathcal {O}}_d(N,d-1)\) cannot be extended to \({\mathcal {S}}'\in {\mathcal {O}}_d(N,d)\).

Proof

By definition, \({\mathcal {S}}\in {\mathcal {O}}_d(N,d-1)\) spans a subspace V of dimension \(d-1\) in \({\mathbb {R}}^d\). Its orthogonal complement \(V^\perp \) is spanned by \({w}\ne {0}\) in Proposition 5, and \({w}\) and \(-{w}\) are the only vectors with norm \(\sqrt{N}\) in V, because the proof of Proposition 5 only appeals to the parity of d in the final divisibility condition. Hence, it is enough to note that \({w}\not \in {\mathbb {Z}}^d\), which is obvious because \(\det (M_{(j)})\in {\mathbb {Z}}\) and \(N^{(2-d)/2}\not \in {\mathbb {Q}}\). \(\square \)

Corollary 8

If d is odd, then \({\mathcal {C}}_d(d-1,d)=\{n^2\,:\, n\in {\mathbb {Z}}^+\}\).

Proof

The only addition to Proposition 7 is that \(N^{(d-2)/2}\in {\mathbb {Z}}\) if N is a square and the proof of Proposition 5 applies. \(\square \)

3 Some considerations about quaternions

The cases \(d=3\) and \(d=4\) are treated using the Hamilton quaternions \({\mathcal {H}}\). The purpose of this section is to introduce some notation and state some results for later reference. Recall that \({\mathcal {H}}\) is composed by expressions of the form

$$\begin{aligned} {\textbf{q}} = a_0 +a_1{\textbf{i}} +a_2{\textbf{j}} +a_3{\textbf{k}} \qquad \text {with }a_j\in {\mathbb {R}} \end{aligned}$$

and \(({\mathcal {H}},+,\cdot )\) becomes an associative normed division algebra over \({\mathbb {R}}\) imposing \({\textbf{i}}^2={\textbf{j}}^2={\textbf{k}}^2={\textbf{i}}{\textbf{j}}{\textbf{k}}=-1\) and with the squared norm \(\Vert {\textbf{q}}\Vert ^2=\sum _{j=0}^3a_j^2={\textbf{q}}\overline{{\textbf{q}}}\) where \(\overline{{\textbf{q}}}\) is the conjugate quaternion \( a_0 -a_1{\textbf{i}} -a_2{\textbf{j}} -a_3{\textbf{k}}\). It is important to keep in mind \(\overline{{\textbf{q}}_1{\textbf{q}}_2}=\overline{{\textbf{q}}_2}\,\, \overline{{\textbf{q}}_1}\).

A well-known theorem due to Frobenius assures that \({\mathcal {H}}\) is the largest associative division algebra over \({\mathbb {R}}\) and Hurwitz proved that if we drop the associativity keeping the norm, the only possible extension is the algebra of Cayley numbers (also named octonions). These results impose a limit to extend our approach to higher dimensions. The book [10] is a nice introduction to these and other topics at an elementary level (see also [14] for the role of \({\mathcal {H}}\) as a Lie group). We refer the reader to it for the basic properties of the quaternions.

In our case, we are going to consider only quaternions with \(a_j\in {\mathbb {Z}}\) and \({\mathcal {H}}_{\mathbb {Z}}\) will denote this set. From the algebraic point of view, \({\mathcal {H}}_{\mathbb {Z}}\) is the lattice generated by \(\{1,{\textbf{i}},{\textbf{j}},{\textbf{k}}\}\) over \({\mathbb {Z}}\) and it misses \((1+{\textbf{i}}+{\textbf{j}}+{\textbf{k}})/2\) to constitute a maximal order (Hurwitz’s quaternions). It causes a parity issue in some contexts. It is known that replacing \({\mathcal {H}}_{\mathbb {Z}}\) by the maximal order we would have unique factorization in a highly nonobvious way [3, 4, §5]. We prefer to avoid here any reference to factorization because our results admit proofs without entering into this intricate topic, although our initial approach was partially based on it.

We consider the embedding of \({\mathbb {Z}}^3\) in \({\mathcal {H}}_{\mathbb {Z}}\) given by

The relation between vectors in dimension 3 and quaternions is not spurious, and in fact the motivation of Hamilton was to find a vector multiplication resembling the complex number product and its relation to rotations.

Lemma 9

We have \({\textbf{q}}_{\vec {a}}{\textbf{q}}_{\vec {b}} =-\vec {a}\cdot \vec {b}+{\textbf{q}}_{\vec {a}\times \vec {b}}\) where \(\vec {a}\cdot \vec {b}\) and \(\vec {a}\times \vec {b}\) are the usual dot and cross products.

Proof

It reduces to a calculation [10, §4.1]. \(\square \)

Lemma 10

If \(\vec {a}\in {\mathbb {Z}}^3\) and \({\textbf{q}}\in {\mathcal {H}}_{{\mathbb {Z}}}\), then \({\textbf{q}}{\textbf{q}}_{\vec {a}}\overline{{\textbf{q}}}={\textbf{q}}_{\vec {b}}\) for some \(\vec {b}\in {\mathbb {Z}}^3\) and \(\Vert \vec {b}\Vert =\Vert {\textbf{q}}\Vert ^2\Vert \vec {a}\Vert \).

In geometric terms, \(\vec {b}\) is obtained from \(\vec {a}\) after a rotation and a homothetic depending on \({\textbf{q}}\) [4, §3.1].

Proof

Clearly, \({\textbf{q}}{\textbf{q}}_{\vec {a}}\overline{{\textbf{q}}}\in {\mathcal {H}}_{{\mathbb {Z}}}\) and the conjugate of \({\textbf{q}}_{\vec {a}}\) is \(-{\textbf{q}}_{\vec {a}}\). Then, the conjugate of \({\textbf{q}}{\textbf{q}}_{\vec {a}}\overline{{\textbf{q}}}\) equals its negative, and hence, its first coordinate vanishes. Plainly \(\Vert {\textbf{q}}_{\vec {a}}\Vert =\Vert \vec {a}\Vert \) and \(\Vert \vec {b}\Vert =\Vert {\textbf{q}}\Vert ^2\Vert \vec {a}\Vert \) follows since the norm is multiplicative. \(\square \)

Lemma 11

Given \({\textbf{q}}\in {\mathcal {H}}_{{\mathbb {Z}}}\), define \(\vec {a},\vec {b},\vec {c}\in {\mathbb {Z}}^3\) by \({\textbf{q}}_{\vec {a}}={\textbf{q}}{\textbf{i}}\overline{{\textbf{q}}}\), \({\textbf{q}}_{\vec {b}}={\textbf{q}}{\textbf{j}}\overline{{\textbf{q}}}\), \({\textbf{q}}_{\vec {c}}={\textbf{q}}{\textbf{k}}\overline{{\textbf{q}}}\). Then \(\{\vec {a},\vec {b},{c}\}\) is an orthogonal set of vectors of the same norm.

Proof

First of all, note that Lemma 10 assures that \(\vec {a}\), \(\vec {b}\) and \(\vec {c}\) are well defined and they have the same norm.

By Lemma 9 and a direct calculation, \(-\vec {a}\cdot \vec {b}+{\textbf{q}}_{\vec {a}\times \vec {b}}={\textbf{q}}_{\vec {a}}{\textbf{q}}_{\vec {b}}=\Vert {\textbf{q}}\Vert ^2{\textbf{q}}{\textbf{k}}\overline{{\textbf{q}}}=\Vert {\textbf{q}}\Vert ^2{\textbf{q}}_{\vec {c}}\) then \(\vec {a}\cdot \vec {b}=0\). The same argument shows \(\vec {b}\cdot \vec {c}=\vec {c}\cdot \vec {a}=0\). \(\square \)

Following [3], we say that \({\textbf{q}}\in {\mathcal {H}}_{{\mathbb {Z}}}\) is primitive if \( {\textbf{q}}=m{\textbf{q}}'\) with \(m\in {\mathbb {Z}}^+\) and \({\textbf{q}}'\in {\mathcal {H}}_{{\mathbb {Z}}}\) implies \(m=1\). In other words, if the coefficients of \({\textbf{q}}\) have not a nontrivial common factor.

The next result is just a synthetic form of writing the parametrization of the Pythagorean quadruples.

Proposition 12

If \(\vec {a}\in {\mathbb {Z}}^3\), \(\Vert {a}\Vert \in {\mathbb {Z}}^+\) and \({\textbf{q}}_{\vec {a}}\) is primitive, there exists \({\textbf{q}}\in {\mathcal {H}}_{{\mathbb {Z}}}\) such that \({\textbf{q}}_{\vec {a}}\in \{{\textbf{q}}{\textbf{i}}\overline{{\textbf{q}}}, {\textbf{q}}{\textbf{j}}\overline{{\textbf{q}}}, {\textbf{q}}{\textbf{k}}\overline{{\textbf{q}}}\}\).

Proof

Expanding the products, we have the parametrizations of the Pythagorean quadruple \((a_1,a_2,a_3,\Vert \vec {a}\Vert )\). See the details in [5, 15]. \(\square \)

Passing to the maximal order, the following result could be rephrased saying that couples like \({\textbf{q}}\) and \({\textbf{q}}{\textbf{i}}\) are coprime to the right when \({\textbf{q}}{\textbf{i}}\overline{{\textbf{q}}}\) is primitive although they share the factor \({\textbf{q}}\) to the left. It will be crucial in our solution of the problem for \(d=4\).

Proposition 13

Let \({\textbf{u}}\in \{{\textbf{i}}, {\textbf{j}}, {\textbf{k}}\}\) and \({\textbf{q}}\in {\mathcal {H}}_{{\mathbb {Z}}}\). If \({\textbf{q}}{\textbf{u}}\overline{{\textbf{q}}}\) is primitive, then there exist \({\textbf{q}}_1,{\textbf{q}}_2\in {\mathcal {H}}_{{\mathbb {Z}}}\) such that \({\textbf{q}}_1{\textbf{q}}+{\textbf{q}}_2{\textbf{q}}{\textbf{u}}=2\).

Proof

Let \({\textbf{q}}=a+b{\textbf{i}} +c{\textbf{j}} +d{\textbf{k}}\). A calculation shows

$$\begin{aligned} {\textbf{q}}-{\textbf{i}}{\textbf{q}}{\textbf{i}} = 2(a+b{\textbf{i}}) \qquad \text {and}\qquad -{\textbf{j}}{\textbf{q}}+{\textbf{k}}{\textbf{q}}{\textbf{i}} = 2(c-d{\textbf{i}}). \end{aligned}$$

The Gaussian integers are embedded in \({\mathcal {H}}_{\mathbb {Z}}\) via \(i\mapsto {\textbf{i}}\) preserving the operations of the algebra \({\mathcal {H}}\) [10, §6.1]. Assuming that \(a+bi\) and \(c-di\) are coprime Gaussian integers, the Euclidean algorithm gives \(A,B,C,D\in {\mathbb {Z}}\) such that

$$\begin{aligned} (A+B{\textbf{i}})({\textbf{q}}-{\textbf{i}}{\textbf{q}}{\textbf{i}}) + (C-D{\textbf{i}})(-{\textbf{j}}{\textbf{q}}+{\textbf{k}}{\textbf{q}}{\textbf{i}}) = 2 \end{aligned}$$

and it would prove the result for \({\textbf{u}}={\textbf{i}}\) with \({\textbf{q}}_1= (A+B{\textbf{i}}) -(C-D{\textbf{i}}){\textbf{j}}\) and \({\textbf{q}}_2= (B-A{\textbf{i}}) +(C-D{\textbf{i}}){\textbf{k}}\).

Let us see that the existence of a Gaussian prime dividing \(a+bi\) and \(c-di\) leads to a contradiction. Let p be the rational prime over it, i.e., (p) is the prime ideal in \({\mathbb {Z}}\) determined by the integers divisible by the Gaussian prime. Then

$$\begin{aligned} p\mid (a+bi)(a-bi)=a^2+b^2, \quad p\mid (c-di)(c+di)=c^2+d^2, \quad p\mid (a+bi)(c+di). \end{aligned}$$

A calculation using Lemma 9 shows

$$\begin{aligned} -{\textbf{q}}{\textbf{i}}\overline{{\textbf{q}}}{\textbf{i}} = a^2+b^2-(c^2+d^2) +2(a+b{\textbf{i}})(c+d{\textbf{i}}){\textbf{j}}. \end{aligned}$$

Then, p divides the coefficients of \(-{\textbf{q}}{\textbf{i}}\overline{{\textbf{q}}}{\textbf{i}}\) and hence those of \({\textbf{q}}{\textbf{i}}\overline{{\textbf{q}}}\), contradicting that it is primitive. This concludes the proof for \({\textbf{u}}={\textbf{i}}\).

Finally, note that any circular permutation of \({\textbf{i}}\), \({\textbf{j}}\), \({\textbf{k}}\) induces a bijective map C on \({\mathcal {H}}\) preserving the algebra operations, \(C({\textbf{q}}_1+{\textbf{q}}_2)=C({\textbf{q}}_1)+C({\textbf{q}}_2)\), \(C({\textbf{q}}_1{\textbf{q}}_2)=C({\textbf{q}}_1)C({\textbf{q}}_2)\), because it preserves the relations defining the algebra. Then, the result for \({\textbf{u}}={\textbf{i}}\) implies it for \({\textbf{j}}\) and \({\textbf{k}}\). \(\square \)

4 The case \(d=3\)

We start showing that there is a restriction on the factorization of N if we want \({\mathcal {O}}_3(N,2)\) to be nonempty. Recall the notation \(p^\alpha \Vert N\) with \(p^\alpha \) a prime power meaning \(p^\alpha \mid N\) and \(p^{\alpha +1}\not \mid N\).

Proposition 14

If \(\{\vec {a},\vec {b}\}\in {\mathcal {O}}_3(N,2)\), then N is representable as a sum of two squares.

Proof

Recall [8] that a positive integer N is representable as a sum of two squares if and only if there does not exist a prime number \(q\equiv 3\pmod {4}\) such that \(q^{2k-1}\Vert N\) with \(k\in {\mathbb {Z}}^+\).

If \(q^{2k-1}\Vert N\), using Corollary 4 with \(d=3\) and \(j=1\), we must have \(q^{2k-1+2l-1}\Vert N(N-a_1^2-b_1^2)\) for some \(l\in {\mathbb {Z}}^+\). Let us call \(N= q^{2k-1}N'\) and \(N-a_1^2-b_1^2=q^{2l-1}M'\) with \(q\not \mid N',M'\). We have

$$\begin{aligned} q^{2(k-l)}N'-M' = \frac{a_1^2+b_1^2}{q^{2l-1}} \qquad \text {and}\qquad N'-q^{2(l-k)}M' = \frac{a_1^2+b_1^2}{q^{2k-1}}. \end{aligned}$$

If \(l\ne k\), we deduce \(q^{2\min (k,l)-1}\Vert a_1^2+b_1^2\), and this is a contradiction. If \(l=k\), the only way of avoiding this contradiction is \(q^{2k}\mid a_1^2+b_1^2\). A circular permutation of the coordinates of \(\vec {a}\) and \(\vec {b}\) preserves the norm and the orthogonality. Hence, we have \(q^{2k}\mid a_j^2+b_j^2\) for \(j=1,2,3\). Adding these divisibility conditions, we get \(q^{2k}\mid N+N\) that contradicts \(q^{2k-1}\Vert N\). \(\square \)

Corollary 15

If a prime of the form \(4n+3\) appears in the factorization of N with odd exponent, then \({\mathcal {O}}_3(N,n)\) is empty for \(n=2,3\).

Theorem 16

We have \({\mathcal {C}}_3(1,2)\supset {\mathcal {C}}_3(1,3)={\mathcal {C}}_3(2,3)=\{n^2\,:\,n\in {\mathbb {Z}}^+\}\).

Proof

The inclusion \({\mathcal {C}}_3(1,2)\supset {\mathcal {C}}_3(1,3)\) is trivial, and we know \({\mathcal {C}}_3(2,3)=\{n^2\,:\,n\in {\mathbb {Z}}^+\}\) by Corollary 8 and \({\mathcal {C}}_3(1,3)\subset \{n^2\,:\,n\in {\mathbb {Z}}^+\}\) by Proposition 7. Then, we have to prove that \({\mathcal {C}}_3(1,3)\) includes the squares. This means that any \(\vec {a}=(a_1,a_2,a_3)\in {\mathbb {Z}}^3\) with \(\Vert \vec {a}\Vert \in {\mathbb {Z}}^+\) can be completed with two other vectors in \({\mathbb {Z}}^3\) of the same norm to get an orthogonal basis.

It is plain that we can restrict ourselves to the case \(\gcd (a_1,a_2,a_3)=1\), equivalently, \({\textbf{q}}_{\vec {a}}\) is primitive. By Proposition 12\({\textbf{q}}_{\vec {a}}\in \{{\textbf{q}}{\textbf{i}}\overline{{\textbf{q}}}, {\textbf{q}}{\textbf{j}}\overline{{\textbf{q}}}, {\textbf{q}}{\textbf{k}}\overline{{\textbf{q}}}\}\) for some \({\textbf{q}}\in {\mathcal {H}}_{{\mathbb {Z}}}\). Finally, Lemma 11 shows that we can extend \(\vec {a}\) to an orthogonal set \(\{\vec {a},\vec {b},\vec {c}\}\subset {\mathbb {Z}}^3\) of vectors of the same norm. \(\square \)

Although \({\mathcal {C}}_3(1,2)\) seems to be close to the squares, some examples show that the inclusion in Theorem 16 is strict. For instance, \({\mathcal {O}}_3(18,1)\) is composed by the vectors (0, 3, 3), (1, 1, 4) and all the rearrangements and sign changes of their coordinates. We can complete the first vector with \((0,3,-3)\) and the second with \((3,-3,0)\). Then, \(18\in {\mathcal {C}}_3(1,2)\) and \(18\not \in {\mathcal {C}}_3(1,3)\) because it is not a square. A more complicated example without repeated absolute values of the coordinates in all vectors occurs for \(N=98\). The relevant representations corresponds to (0, 7, 7), (1, 4, 9) and (3, 5, 8), which can be completed with \((0,7,-7)\), \((5, -8,3)\) and \((9,1,-4)\), respectively. Consequently, \(98\in {\mathcal {C}}_3(1,2)\) and \(98\not \in {\mathcal {C}}_3(1,3)\).

We have not been able of characterizing the difference set \({\mathcal {C}}_3(1,2)\setminus {\mathcal {C}}_3(1,3)\). Running a computer program we have got that this set includes:

$$\begin{aligned} \{ 18, 45, 50, 72, 85, 90, 98, 117, 125, 130, 162, 180, 200, 242, 245, 250, 288, \dots \}. \end{aligned}$$

In fact, the listed numbers cover all the values with \(N<300\) excluding the trivial cases with essentially only a representation as a sum of three squares (there are only a finite number of them [1] being the largest 427).

5 The case \(d=4\)

We now solve in the affirmative the original problem for \(d=4\), which is a conjecture in [11].

Theorem 17

For any \(1\le n_1<n_2\le 4\), we have \({\mathcal {C}}_4(n_1,n_2)={\mathbb {Z}}^+\).

In other words, any set \({\mathcal {S}}\subset {\mathbb {Z}}^4-\{\vec {0}\}\) of orthogonal vectors of the same norm can be extended to an orthogonal basis \({\mathcal {B}}\supset {\mathcal {S}}\) of \({\mathbb {R}}^4\) keeping all the basis vectors in \({\mathbb {Z}}^4\) and with the same norm.

Proof

Given a (row) vector \(\vec {v}=(v_1,v_2,v_3,v_4)\in {\mathbb {Z}}^4\), consider the quaternion \({\textbf{v}}=v_1+v_2{\textbf{i}} +v_3{\textbf{j}}+v_4{\textbf{k}}\) and the vectors \(\vec {a}\), \(\vec {b}\) and \(\vec {c}\) in \({\mathbb {Z}}^4\) whose coordinates are given, respectively, by the coefficients of \({\textbf{i}}{\textbf{v}}\), \({\textbf{j}}{\textbf{v}}\) and \({\textbf{k}}{\textbf{v}}\). Clearly, the four vectors have the same norm and to settle the case \(n_1=1\) we have to show that they are orthogonal. Using \({\textbf{i}}^2={\textbf{j}}^2={\textbf{k}}^2=-1\), it is deduced that \(\vec {v}\cdot \vec {a}\) is the real part (the first coefficient) of \({\textbf{v}}\overline{{\textbf{i}}{\textbf{v}}}\) and it vanishes because this is \({\textbf{v}}\overline{{\textbf{v}}}(-{\textbf{i}})=-\Vert \vec {v}\Vert ^2{\textbf{i}}\). The same argument works to prove the orthogonality of any couple of the vectors.

The case \(n_1=3\) follows from Corollary 6 with \(d=4\).

It remains to consider \(n_1=2\), which is the harder case. We already know \({\mathcal {C}}_3(3,4)={\mathbb {Z}}^+\); then, we have to prove that \(\{\vec {v},\vec {w}\}\subset {\mathbb {Z}}^4\) with \(\vec {v}\cdot {w}=0\), \(\Vert \vec {v}\Vert =\Vert \vec {w}\Vert \) can be extended with a new orthogonal vector \(\vec {u}\in {\mathbb {Z}}^4\) of the same norm. Let \(\vec {a}\), \(\vec {b}\) and \(\vec {c}\) be defined as before. They generate in \({\mathbb {Q}}^4\) the orthogonal subspace to \(\vec {v}\) so there exist \(\ell _1,\ell _2,\ell _3\in {\mathbb {Z}}\) and \(Q\in {\mathbb {Z}}^+\) such that

$$\begin{aligned} \vec {w}= \frac{\ell _1}{Q}\vec {a} + \frac{\ell _2}{Q}\vec {b} + \frac{\ell _3}{Q}\vec {c} \qquad \text {with}\quad \ell _1^2+\ell _2^2+\ell _3^2 = Q^2. \end{aligned}$$

The last relation follows from \(\Vert {v}\Vert =\Vert {w}\Vert \). We can assume \(\gcd (\ell _1,\ell _2,\ell _3)=1\) freely because otherwise we could simplify the fractions \(\ell _j/Q\). Under this assumption necessarily Q is odd because \(\ell _j^2\equiv 0,1\pmod {4}\).

By Proposition 12 applied to \(\vec {\ell }=(\ell _1,\ell _2,\ell _3)\), there exists \({\textbf{q}}\in {\mathcal {H}}_{\mathbb {Z}}\) such that \({\textbf{q}}_{\vec {\ell }} = {\textbf{q}}{\textbf{u}}\overline{{\textbf{q}}}\) with \({\textbf{u}}\in \{{\textbf{i}},{\textbf{j}},{\textbf{k}}\}\) and by Lemma 11, we obtain \({k}=(k_1,k_2,k_3)\in {\mathbb {Z}}^3\) orthogonal to \({\ell }\) defined by \({\textbf{q}}_{\vec {k}} = {\textbf{q}}{\textbf{u}}'\overline{{\textbf{q}}}\), \({\textbf{u}}'\in \{{\textbf{i}},{\textbf{j}},{\textbf{k}}\}\), and \(\Vert \vec {\ell }\Vert =\Vert \vec {k}\Vert = \Vert {\textbf{q}}\Vert ^2=Q\). Now we are ready to define \(\vec {u}\). We take \(\vec {u}=(k_1{a}+k_2\vec {b}+k_3{c})/Q\), which is orthogonal to \({v}\) and \(\vec {w}\) and of the same norm. The only missing point is to show \(\vec {u}\in {\mathbb {Z}}^4\).

Note that \(Q\vec {w}\) is the vector having as coordinates the coefficients of

$$\begin{aligned} \ell _1{\textbf{i}}{\textbf{v}} + \ell _2{\textbf{j}}{\textbf{v}} + \ell _3{\textbf{k}}{\textbf{v}} = {\textbf{q}}_{\vec {\ell }}{\textbf{v}} = {\textbf{q}}{\textbf{u}}\overline{{\textbf{q}}}{\textbf{v}}. \end{aligned}$$

In particular, Q divides \({\textbf{q}}{\textbf{u}}\overline{{\textbf{q}}}{\textbf{v}}\). A similar chain of equalities shows that the coordinates of \(Q\vec {u}\) are the coefficients of \({\textbf{q}}{\textbf{u}}'\overline{{\textbf{q}}}{\textbf{v}}\). We are going to prove that Q divides \(\overline{{\textbf{q}}}{\textbf{v}}\), which implies \(\vec {u}\in {\mathbb {Z}}^4\). Multiplying to the right by \(\overline{{\textbf{q}}}{\textbf{v}}\) the equation in Proposition 13, we get

$$\begin{aligned} 2\overline{{\textbf{q}}}{\textbf{v}} = {\textbf{q}}_1{\textbf{q}}\overline{{\textbf{q}}}{\textbf{v}} + {\textbf{q}}_2{\textbf{q}}{\textbf{u}}\overline{{\textbf{q}}}{\textbf{v}} = Q \Big ( {\textbf{q}}_1{\textbf{v}} + {\textbf{q}}_2\frac{{\textbf{q}}{\textbf{u}}\overline{{\textbf{q}}}{\textbf{v}}}{Q} \Big ) \end{aligned}$$

and, as Q is odd, Q must divide the coefficients of \(\overline{{\textbf{q}}}{\textbf{v}}\). \(\square \)

6 Other dimensions

Once the problem is solved for \(d=4\), and we have proved that in general is impossible to complete an orthogonal basis for \(2\not \mid d\) (Proposition 7), the natural question is what happens in the rest of the dimensions. The conjecture in [11] is that the extension is always possible when the dimension is a multiple of four (see [11, Conj.2]). With our notation, this is the claim \({\mathcal {C}}_{d}(n_1,n_2)={\mathbb {Z}}^+\) for \(1\le n_1<n_2\le d\) when \(4\mid d\).

In the even case not covered by the conjecture, \(4\mid d-2\), the extension is not possible in general, as shown in the next result, which is in [11, §3]. Our proof is essentially the same avoiding the matrix notation.

Proposition 18

For \(d=4k+2\), \(k\in {\mathbb {Z}}^+\), the numbers not representable as a sum of two squares are not in \({\mathcal {C}}_d(d-2,d-1)\). In particular, they are not in \({\mathcal {C}}_d(d-2,d)\).

Proof

Let \(N\in {\mathcal {C}}_d(d-2,d-1)\). By Theorem 17, we have \(\{\vec {v}_1,\vec {v}_2,\vec {v}_3,\vec {v}_4\}\in {\mathcal {O}}_d(N,4)\) having all the coordinates zero except at most those in the first four places. In general, we can construct \(\{\vec {v}_{4j-3},\vec {v}_{4j-2},\vec {v}_{4j-1},\vec {v}_{4j}\}\in {\mathcal {O}}_d(N,4)\), \(1\le j\le k\), supported on the coordinates \(4j-3\), \(4j-2\), \(4j-1\) and 4j. Clearly \({\mathcal {S}}=\{\vec {v}_1,\vec {v}_2,\dots ,\vec {v}_{4k}\}\in {\mathcal {O}}_d(N,d-2)\) and they generate a subspace \(V\subset {\mathbb {R}}^d\) such that \(V^\perp \) is the 2-dimensional subspace formed by the vectors with the first \(d-2\) coordinates zero. Then, any \(\vec {v}\) such that \({\mathcal {S}}\cup \{\vec {v}\}\in {\mathcal {O}}_d(N,d)\) must have at most two nonzero coordinates and \(N=\Vert \vec {v}\Vert ^2\) is representable as a sum of two squares. \(\square \)

The case \(n_1=1\) of Theorem 17 was settled using the left multiplication by the pure quaternion units \({\textbf{i}}\), \({\textbf{j}}\) and \({\textbf{k}}\). In dimension 8, something similar can be done with the pure octonion units. For basic information about the Cayley numbers (octonions), we refer the reader to [2, 4, 10]. Here we only use that the elements of this nonassociative normed division algebra can be identified with vectors \({x}=(x_0,\dots ,x_7)\in {\mathbb {R}}^8\) via \(\sum _{j=0}^7 x_j{\textbf{u}}_j\) where \(\{{\textbf{u}}_j\}\) are units generating the algebra with \({\textbf{u}}_0=1\) and \({\textbf{u}}_j^2=-1\). The right multiplication by \({\textbf{u}}_j\) corresponds to the \(j+1\) row vector of the following antisymmetric matrix:

$$\begin{aligned} C(\vec {x})= \begin{pmatrix} x_0&{} -\,x_1&{} -\,x_2&{} -\,x_3&{} -\,x_4&{} -\,x_5&{} -\,x_6&{} -\,x_7 \\ x_1&{} x_0 &{} -x_4 &{} -\,x_7 &{} x_2 &{} -\,x_6 &{} x_5 &{} x_3 \\ x_2&{} x_4 &{} x_0 &{} -\,x_5 &{} -x_1 &{} x_3 &{} -\,x_7 &{} x_6 \\ x_3&{} x_7 &{} x_5 &{} x_0 &{} -\,x_6 &{} -\,x_2 &{} x_4 &{} -\,x_1 \\ x_4&{} -\,x_2 &{} x_1 &{} x_6 &{} x_0 &{} -\,x_7 &{} -\,x_3 &{} x_5 \\ x_5&{} x_6 &{} -x_3 &{} x_2 &{} x_7 &{} x_0 &{} -\,x_1 &{} -\,x_4 \\ x_6&{} -\,x_5 &{} x_7 &{} -x_4 &{} x_3 &{} x_1 &{} x_0 &{} -\,x_2 \\ x_7&{} -\,x_3 &{} -\,x_6 &{} x_1 &{} -\,x_5 &{} x_4 &{} x_2 &{} x_0 \end{pmatrix}. \end{aligned}$$

To be more concrete, the product \(C(\vec {x}){y}\), with \(\vec {y}\in {\mathbb {R}}^8\) a column vector gives the coordinates of the Cayley number product \(\big (\sum _{j=0}^7 x_j{\textbf{u}}_j\big )\big (\sum _{j=0}^7 y_j{\textbf{u}}_j\big )\).

The rows of \(C(\vec {x})\) are orthogonal (cf. [4, §8.4]), and we deduce at once:

Proposition 19

We have \({\mathcal {C}}_8(1,n_2)={\mathbb {Z}}^+\) for \(1<n_2\le 8\).

Dividing into 8-blocks and using \(C(\vec {x})\), or into 4-blocks and using the case \(n_1=1\) of Theorem 17, there is an immediate conclusion for higher dimensions.

Corollary 20

We have \({\mathcal {C}}_d(1,n_2)={\mathbb {Z}}^+\) for \(1<n_2\le 8\) if \(8\mid d\) and for \(1<n_2\le 4\) if \(4\mid d\).

Given \(\vec {v}\in {\mathbb {R}}^7\), let \(P(\vec {v})\) be the submatrix \(\big (c_{ij}(\vec {x})\big )_{i,j=2}^8\) with \(\vec {x}=(0,\vec {v})\). It corresponds to the “pure part” (the part not including \({\textbf{u}}_0\)) of the product of pure octonions (those with \(x_0=0\)). By analogy with Lemma 9, it defines a cross product in \({\mathbb {R}}^7\) with the usual properties [12, §7.4]. Namely, for (column) vectors \(\vec {v},\vec {w}\in {\mathbb {R}}^7\) we define

$$\begin{aligned} \vec {v}\times {w}=P(\vec {v})\vec {w} \end{aligned}$$

and we have

$$\begin{aligned} (\vec {v}\times {w})\cdot {v}=0, \quad (\vec {v}\times {w})\cdot {w}=0 \quad \text {and}\quad \Vert \vec {v}\times {w}\Vert ^2+({v}\cdot {w})^2= \Vert \vec {v}\Vert ^2\Vert \vec {w}\Vert ^2. \end{aligned}$$
(1)

In fact, it can be proved that a binary cross product can only be defined for \(d=3\) and \(d=7\), and it has a topological significance [13].

If we try to parallel our reasoning for \({\mathcal {C}}_3(2,3)\) to treat \({\mathcal {C}}_7(2,3)\), noting that Proposition 5 for \(d=3\) defines essentially the standard cross product in \({\mathbb {R}}^3\), we find a serious obstruction because we lack the divisibility condition deriving from Corollary 4. We can state anyway a very weak analogue of a part of Theorem 16. In the following result, \(k\mid \vec {v}\) means that every coordinate of \(\vec {v}\) is a multiple of k.

Proposition 21

Let \(K_1\), \(K_2\) be positive integers and \(\{\vec {v},\vec {w}\}\in {\mathcal {O}}_7(N,2)\) with \(N=K_1^2K_2^2\). If \(K_1\mid \vec {v}\), \(K_2\mid {w}\), then there exists a vector \(\vec {u}\in {\mathbb {Z}}^7\) such that \(\{\vec {v},\vec {w},\vec {u}\}\in {\mathcal {O}}_7(N,3)\).

Proof

From our hypothesis, \(\vec {v}_0={v}/K_1\) and \(\vec {w}_0={w}/K_2\) are integral orthogonal vectors with norms \(K_2\) and \(K_1\), respectively. Taking \(\vec {u}=\vec {v}_0\times {w}_0\), the properties (1) assure that \(\{\vec {v},\vec {w},\vec {u}\}\) is an orthogonal set and \(\Vert \vec {u}\Vert ^2=\Vert \vec {v}\Vert ^2=\Vert \vec {w}\Vert ^2=N\). Clearly \(P(\vec {v}_0)\) has integral entries, then \(\vec {u}\in {\mathbb {Z}}^7\). \(\square \)

For instance, the previous result with \(K_1=8\) and \(K_2=9\) when applied to the orthogonal vectors

$$\begin{aligned} \vec {v}= ( 8, 8, 24, 64, 8, 8, 16) \quad \text {and}\quad \vec {w}= ( -\,9, 9, 9, -\,18, 18, 63, 18), \end{aligned}$$

having \(\Vert \vec {v}\Vert ^2=\Vert \vec {w}\Vert ^2=8^2\cdot 9^2\), gives

$$\begin{aligned} \vec {u}= ( -\,1, -\,13, 53, -\,20, -\,30, -\,11, 28). \end{aligned}$$

Sometimes for two vectors \(\vec {v}\) and \(\vec {w}\) not fulfilling the divisibility conditions, by chance, we have that \(\vec {v}\times \vec {w}\) is divisible by \(\Vert \vec {v}\Vert =\sqrt{N}\), and then, we can take \(\vec {u}=\Vert \vec {v}\Vert ^{-1}\vec {v}\times \vec {w}\). There are many examples when N is the square of a relatively small number. For instance, the vectors

$$\begin{aligned} \vec {v}= ( 1, 1, 8, 17, 1, 1, 2) \quad \text {and}\quad \vec {w}= ( 3, -\,1, -\,3, -\,1, -\,1, 4, 18) \end{aligned}$$

verify \(\{{v},{w}\}\in {\mathcal {O}}_7(361,2)\) and

$$\begin{aligned} {u}=\frac{1}{19}{v}\times {w}= (9, 3, 3, -\,1, -\,16, 1, -\,2) \end{aligned}$$

allows to extend the set to \(\{\vec {v},\vec {w},\vec {u}\}\in {\mathcal {O}}_7(361,3)\).

As a matter of fact, apart of the binary cross products in \({\mathbb {R}}^3\) and \({\mathbb {R}}^7\) and the cross product of \(d-1\) vectors in \({\mathbb {R}}^d\) (reflected in Proposition 5) there exists also a ternary cross product in \({\mathbb {R}}^8\). This exhausts all the possibilities for cross products with the usual properties [12, §7.5]. See [17, Th.2.1] for the expression of this ternary cross product in terms of the Cayley numbers and its properties. With our notation, it corresponds to the formula

$$\begin{aligned} \vec {x}\times {y}\times \vec {z} = -\,C(\vec {x})C(\vec {y}^*){z} +(\vec {y}\cdot \vec {z})\vec {x} -(\vec {z}\cdot \vec {x}){y} +(\vec {x}\cdot \vec {y})\vec {z} \end{aligned}$$

where we consider \(\vec {z}\in {\mathbb {R}}^8\) as a column vector to perform the matrix multiplication. Here, \(\vec {y}^*\) means \((y_0,-y_1,-y_2,\dots , -y_7)\) and the dot indicates the standard inner product in \({\mathbb {R}}^8\). It is apparent that \(\vec {x}\times \vec {y}\times \vec {z}\) works finely as a map \({\mathbb {Z}}^8\times {\mathbb {Z}}^8\times {\mathbb {Z}}^8\longrightarrow {\mathbb {Z}}^8\). A variant of the previous proposition is:

Proposition 22

Given \(K_1,K_2,K_3\in {\mathbb {Z}}^+\), if \({\mathcal {S}}=\{\vec {v}_1,\vec {v}_2,\vec {v}_3\}\in {\mathcal {O}}_8(N,3)\) with \(N=K_1K_2K_3\) and \(K_j\mid \vec {v}_j\) for \(1\le j\le 3\), then \({\mathcal {S}}\) can be extended with another vector to a set in \({\mathcal {O}}_8(N,4)\).

Proof

Take \({v}_{j0}=\vec {v}_j/K_j\). The vector \({w}=\vec {v}_{10}\times \vec {v}_{20}\times \vec {v}_{30}\) is orthogonal to \(\vec {v}_1\), \(\vec {v}_2\) and \({v}_3\). As these vectors are orthogonal, we have \(\Vert \vec {w}\Vert ^2=\Vert \vec {v}_{10}\Vert ^2\Vert \vec {v}_{20}\Vert ^2\Vert \vec {v}_{30}\Vert ^2\) that is \(N/K_1^2\cdot N/K_2^2\cdot N/K_3^2=N\). \(\square \)

An example of the previous result with \(K_1=12\), \(K_2=15\), \(K_3=20\), which corresponds to \(N=3600\), is the orthogonal set \(\{ \vec {v}_1, {v}_2, {v}_3\}\) with

$$\begin{aligned} {\left\{ \begin{array}{ll} \vec {v}_1=(12, -24, -12, 12, -24, 24, -36, 12 ), \\ \vec {v}_2=(30, 15, -15, -15, -15, -30, 0, 30 ), \\ \vec {v}_3=(40, 20, 20, 20, 20, 20, 0, 0). \end{array}\right. } \end{aligned}$$

The vector \(\vec {w}\) in the proof above is \(( 2, 0, -33, -27, 26, 30, 9, 11)\). It has \(\Vert \vec {w}\Vert ^2=N\) and allows to extend the set with a new orthogonal vector.

There do not exist finite-dimensional division algebras over \({\mathbb {R}}\) beyond the Cayley numbers. A more versatile extension of the quaternions \({\mathcal {H}}\) are the Clifford algebras, widely employed in theoretical physics [16]. In the following lines, we explore how to traduce some instances of the orthogonality to the setting of some Clifford algebras in a constructive way, avoiding the reference to the general theory to minimize the prerequisites (see [12] for a basic approach to Clifford algebras, mainly through Euclidean examples and [9] for a more advanced introduction).

Let \({\mathbb {F}}_2\) be the field of two elements and V the subspace of codimension 1 of \({\mathbb {F}}_2^n\) defined by \(x_1+\dots +x_n=0\). For our purposes, it will be convenient to define the function

$$\begin{aligned} s:V\longmapsto {\mathbb {F}}_2, \qquad \text {where}\quad s(\vec {v})=\frac{1}{2} \#\{1\le j\le n\,:\; v_j=1\}\pmod {2}. \end{aligned}$$

Note that it is well defined because each vector in V has an even number of ones.

The even subalgebra \({\mathcal {E}}_n\) of the Clifford algebra \({\mathcal {C}}\ell _{0,n}({\mathbb {R}})\) can be defined as having a basis \({\mathcal {B}}=\{{\textbf{e}}_{\vec {a}}\,:\, \vec {a}\in V\}\) over \({\mathbb {R}}\) obeying the algebra operation [12, §2.13]

$$\begin{aligned} {\textbf{e}}_{\vec {a}}{\textbf{e}}_{\vec {b}} = S(\vec {a},\vec {b}){\textbf{e}}_{\vec {a}+\vec {b}} \qquad \text {with}\quad S(\vec {a},\vec {b}) = (-1)^{\sum _{j=1}^n\sum _{k=1}^ja_jb_k}. \end{aligned}$$
(2)

The element \({\textbf{e}}_{\vec {0}}\) is the unit and \(\dim _{{\mathbb {R}}}{\mathcal {E}}_n=2^{n-1}\).

Consider the natural bijective map \(\phi :{\mathcal {E}}_n\longmapsto {\mathbb {R}}^{2^{n-1}}\) assigning to each element of \({\mathcal {E}}_n\) its coordinates in the basis \({\mathcal {B}}\). The following result relates the multiplication by the basis elements to the orthogonality.

Proposition 23

Consider a set \(V_0\subset V\) of cardinality \(n_0\) such that \(s(\vec {u})+s(\vec {v})+\vec {u}\cdot \vec {v}\) is odd for any distinct \(\vec {u},\vec {v}\in V_0\). Then, given \({\textbf{e}}\in {\mathcal {E}}_n\) with integral coordinates and norm \(\sqrt{N}\), we have \(\big \{\phi ({\textbf{e}}{\textbf{e}}_{\vec {v}})\,:\, \vec {v}\in V_0\big \}\in {\mathcal {O}}_{2^{n-1}}(N,n_0)\).

In \({\mathcal {E}}_3\), we can identify \({\textbf{e}}_{(0,0,0)}=1\), \({\textbf{e}}_{(1,1,0)}={\textbf{i}}\), \({\textbf{e}}_{(1,0,1)}={\textbf{j}}\), \({\textbf{e}}_{(0,1,1)}={\textbf{k}}\) preserving the algebra operations (2). In this way, \({\mathcal {E}}_3\) becomes isomorphic to the algebra of quaternions \({\mathcal {H}}\). The orthogonality of the vectors defined by the coordinates of \(\{{\textbf{q}}, {\textbf{q}}{\textbf{i}}, {\textbf{q}}{\textbf{j}}, {\textbf{q}}{\textbf{k}}\}\), what was used in the proof of Theorem 17 (the ordering is not important by conjugation), is then covered by Proposition 23 choosing \(V_0=V\).

It is unclear whether it is possible to recover in this context the matrix \(C(\vec {x})\) associated with the multiplication by octonion units. Probably the underlying difficulty is that Clifford algebras are associative and the algebra of Cayley numbers is not.

Lemma 24

We have \(s(\vec {v})=\sum _{j=1}^n\sum _{k=1}^jv_jv_k\) for every \({v}\in V\).

Proof

Let us consider the coordinates of \(\vec {v}\) as integers in \(\{0,1\}\). We know \((v_1+\dots +v_n)^2\equiv 0\pmod {4}\) because \(\vec {v}\in V\). Expanding the square and using \(v_j^2= v_j\), we obtain

$$\begin{aligned} \sum _{j=1}^n v_j + 2 \sum _{j=1}^n\sum _{k=1}^{j-1}v_jv_k = -\sum _{j=1}^n v_j + 2 \sum _{j=1}^n\sum _{k=1}^jv_jv_k \equiv 0\pmod {4}. \end{aligned}$$

Dividing by 2, we get the result. \(\square \)

Proof of Proposition 23

Let \({\textbf{e}}=\sum _{\vec {a}\in V}\lambda _{\vec {a}}{\textbf{e}}_{\vec {a}}\) with \(\lambda _{\vec {a}}\in {\mathbb {Z}}\). Using (2), the \({\textbf{e}}_{\vec {c}}\) coordinates of \({\textbf{e}}{\textbf{e}}_{\vec {v}}\) and \({\textbf{e}}{\textbf{e}}_{\vec {u}}\) are \( S({c}-\vec {v},\vec {v})\lambda _{ \vec {c}-\vec {v}} \) and \( S({c}-\vec {u},\vec {u})\lambda _{ \vec {c}-\vec {u}} \), respectively. In the same way, noting \(+1=-1\) in \({\mathbb {F}}_2\), the \({\textbf{e}}_{\vec {c}+\vec {v}-\vec {u}}\) coordinates are \( S(\vec {c}-\vec {u},\vec {v})\lambda _{ \vec {c}-\vec {u}} \) and \( S(\vec {c}-\vec {v},\vec {u})\lambda _{ \vec {c}-\vec {v}} \). Then, the orthogonality of \(\phi ({\textbf{e}}{\textbf{e}}_{{v}})\) and \(\phi ({\textbf{e}}{\textbf{e}}_{\vec {u}})\) follows if

$$\begin{aligned} S({c}-\vec {v},\vec {v}) S(\vec {c}-\vec {u},\vec {u}) = - S({c}-\vec {u},\vec {v}) S(\vec {c}-\vec {v},\vec {u}) \end{aligned}$$

because in this case the contribution to the scalar product of the coordinates indexed with \({c}\) and \({c}+{v}-{u}\) cancel. Recalling the definition of S in (2) and noting that the exponent is a bilinear form, the previous equation translates into:

$$\begin{aligned} -\sum _{j=1}^n\sum _{k=1}^j \big ( v_jv_k +u_ju_k \big ) = -\sum _{j=1}^n\sum _{k=1}^j \big ( u_jv_k +v_ju_k \big ) +1 \qquad \text {in }{\mathbb {F}}_2. \end{aligned}$$

For \(\vec {u},\vec {v}\in V\), we have

$$\begin{aligned} 0 = \Big ( \sum _{j=1}^n u_j \Big ) \Big ( \sum _{k=1}^n v_k \Big ) = \sum _{j=1}^n\sum _{k=1}^j u_jv_k + \sum _{j=1}^n\sum _{k=1}^j u_kv_j - \vec {u}\cdot {v}. \end{aligned}$$

Then, the previous relation reads

$$\begin{aligned} -\sum _{j=1}^n\sum _{k=1}^j \big ( v_jv_k +u_ju_k \big ) + \vec {u}\cdot \vec {v} =1 \end{aligned}$$

and the result follows from Lemma 24. \(\square \)

For instance, for \(n=5\), which corresponds to \(d=2^{n-1}=16\), a valid set in Proposition 23 is

$$\begin{aligned} V_0= \big \{\vec {0}, (0,0,1,0,1), (0,0,1,1,0), (0,1,1,0,0), (1,0,1,0,0)\big \}. \end{aligned}$$

Working out the coordinates of \(\phi ({\textbf{e}}{\textbf{e}}_{\vec {v}})\) with \({\textbf{e}}\) an arbitrary element with \(\phi ({\textbf{e}})=(x_0,\dots , x_{15})\) we obtain the rows of a matrix \(A=(A_1\vert A_2)\) with

$$\begin{aligned} A_1= \begin{pmatrix} x_{0} &{} x_{1} &{} x_{2} &{} x_{3} &{} x_{4} &{} x_{5} &{} x_{6} &{} x_{7} \\ -x_{2} &{} -x_{3} &{} x_{0} &{} x_{1} &{} x_{6} &{} x_{7} &{} -x_{4} &{} -x_{5} \\ -x_{3} &{} x_{2} &{} -x_{1} &{} x_{0} &{} -x_{7} &{} x_{6} &{} -x_{5} &{} x_{4} \\ -x_{6} &{} -x_{7} &{} x_{4} &{} x_{5} &{} -x_{2} &{} -x_{3} &{} x_{0} &{} x_{1} \\ -x_{10} &{} -x_{11} &{} x_{8} &{} x_{9} &{} x_{14} &{} x_{15} &{} -x_{12} &{} -x_{13} \end{pmatrix} \end{aligned}$$

and

$$\begin{aligned} A_2= \begin{pmatrix} x_{8} &{} x_{9} &{} x_{10} &{} x_{11} &{} x_{12} &{} x_{13} &{} x_{14} &{} x_{15}\\ x_{10} &{} x_{11} &{} -x_{8} &{} -x_{9} &{} -x_{14} &{} -x_{15} &{} x_{12} &{} x_{13}\\ -x_{11} &{} x_{10} &{} -x_{9} &{} x_{8} &{} -x_{15} &{} x_{14} &{} -x_{13} &{} x_{12}\\ -x_{14} &{} -x_{15} &{} x_{12} &{} x_{13} &{} -x_{10} &{} -x_{11} &{} x_{8} &{} x_{9}\\ -x_{2} &{} -x_{3} &{} x_{0} &{} x_{1} &{} x_{6} &{} x_{7} &{} -x_{4} &{} -x_{5} \end{pmatrix}. \end{aligned}$$

According to Proposition 23, the rows of A are orthogonal of the same norm and hence \({\mathcal {C}}_{16}(1,5)={\mathbb {Z}}^+\). This a little discouraging because an exhaustive search shows that for \(d=16\) the cardinality of \(V_0\) is at most 5 and Corollary 20 gives a better result in this case.