Angles in an integral lattice

Let $d\geq 1$ be a fixed integer, and $\mathbb{Z}^d$ be the lattice of all integers; consider the set $A_d \subset [-1,1]$ defined by $$\alpha \in A_d \ \iff \ \alpha=\frac{v \cdot w}{\|v\| \|w\|} \mbox{ for some } \ v,w \in \mathbb{Z}^d$$ Of course $A_d$ is a set of quadratic irrationals and $\overline{A_d}=[-1,1]$.

Question: is it possible to caracterize all values that belong to $A_d$?

In other words, can one caracterize all angles which occour between two integer vectors? For instance: are there two integer vectors in the plane which form an angle of $\pi/3$?

PS: this problem comes from the question of a collegue, who wants to cook different versions of a linear algebra test for undergraduate students in such a way that computations are different, but equally simple (I guess the question has already been raised and solved - but I am not an expert).

-
 For d < 4, I would expect strictly fewer numbers in the denominator because some integers need 4 squares to represent them. I do not know of other obstructions. Gerhard "Ask Me About System Design" Paseman, 2011.01.24 – Gerhard Paseman Jan 25 2011 at 7:53 Is the arithmetic geometry tag appropriate here? – Nick Salter Jan 25 2011 at 9:17

The proof that $\pi/3$ is not a lattice angle is due to Lucas, while the proof that an $n$-gon does not embed in $\mathbb Z^d$ is due to Schoenberg, and has a nice proof by Scherrer. There is a AMM article on the topic you ask about "Triangles with vertices on lattice points", which has some history and references, too. Also, note that except for the Euclidean approach, there is another geometric approach to lattice angles related to continued fractions. Oleg Karpenkov has some nice notes on this.

-

Let C, D be integers with C^2 < D, then C/sqrt(D) is realized in five dimensions. Hint: let w = (1,0,0,0,0) and v have first component C. There may be a way to take this down to 4 dimensions, but I am tired. Anyway, a number-theoretic characterization should not be far away for lower dimensions.

UPDATE 2011.02.07 In d <= 4 dimensions, a similar construction works, for all positive integers C and k (given k is the sum of at most (d-1) squares) for C/sqrt(k + C^2), and in dimension d = 4 it is possible to cover many of the remaining cases with w = (1,1,0,0) or (1,1,1,0). Perhaps Will Jagy can tell us which quadratic irrationals stay out of A_4 ?

-
 For dimension 4, I have partial success. if C is odd and D is 2 or 3 mod 4, I can get it using a vector (1,0,0,0). I can get other C using (1,1,0,0) or (1,1,1,0) but I don't have a uniform construction. In any case, I see this as a number theoretic characterization, where for d = 2 D can only be 0,1,2,4 or 5 mod 8, and for d=3 D cannot be 7 mod 8. Gerhard "Ask Me About System Design" Paseman, 2011.01.25 – Gerhard Paseman Jan 25 2011 at 19:13 I don't remember what drugs I was taking when I wrote the comment above. Will Jagy is well on his way to convincing me that C/sqrt(k +C^2) is not in A_4 if k needs 4 squares for its sum. If so, then the sufficient condition above for a number to be in A_d may also be necessary. Gerhard "Flu Medicines Have Side Effects" Paseman, 2011.02.25 – Gerhard Paseman Feb 25 2011 at 23:58

Louis J. Mordell showed in 1930 that the matrix equation [
\left( \begin{array}{rrrr} p & q & r & s\\ t & u & v & w \end{array} \right) \; \cdot \; \left( \begin{array}{rr} p & t \\ q & u \\ r & v \\ s & w
\end{array} \right) = \; \;\; \; \left( \begin{array}{cc} A & B \\ B & C
\end{array} \right)
, ] all quantities integers, while the right hand side is positive definite, is possible if and only if the determinant $A C - B^2$ is the sum of three squares, that is not of shape $4^k ( 8 n + 7).$

We are interested in the possible lattice angles in $\mathbf R^4,$ which we write with positive integers $F,G,$ (such that $F^2 < G$) as $$\cos \theta = \frac{\pm F}{\sqrt{G}}.$$ The main demand we make is that if $F$ is even, we require that $G$ is not divisible by 4. We ask whether it is possible to realize this angle on the lattice.

When $F$ is odd, this is possible if and only if $G \neq 0 \pmod 8.$

When $F \equiv 2 \pmod 4,$ (so $G \neq 0 \pmod 4$), this is possible if and only if $G \neq 3 \pmod 8.$

When $F \equiv 0 \pmod 4,$ (so $G \neq 0 \pmod 4$), this is possible if and only if $G \neq 7 \pmod 8.$

Whenever possible, the solution is given by the 2 by 2 matrix above, with $B = F$ and $A C = G.$ Then, as we have $G - F^2 \equiv 1,2,3,5,6 \pmod 8,$ once we select our favorite $A$ and $C,$ there are in fact integral vectors $P = (p,q,r,s)$ and $T = (t,u,v,w)$ such that $$P \cdot P = A, \; \; \; P \cdot T = B, \; \; \; T \cdot T = C.$$

Note that we can actually take $A = 1, \; B = F, \; C = G, \; \; P = (1,0,0,0), \; \; T = (F,u,v,w)$ by demanding $u^2 + v^2 + w^2 = G - F^2.$

Also note that some rational values are ruled out. While $\cos \theta = 1/2$ is easy, if we have odd $m$ and any $j,$ ($j$ can be odd or even) then $$\cos \theta = \frac{m}{4j} = \frac{m}{\sqrt{16 j^2}}$$ cannot be arranged with $\theta$ a lattice angle in $\mathbf R^4.$

L. J. Mordell, "A new Waring's problem with squares of linear forms," Quarterly Journal of Mathematics (1930), pages 276-288. Seems to be volume 1.

-

The lattice angles in $\mathbf R^3$ are the same as those in $\mathbf R^4.$ This seems to be what Michael Beeson is saying in the first page of his 1992 article (link in Gjergji's answer), I have not seen the rest of the article yet.

Using the symbols of Gerhard "Fluid Mechanics Have Side Effects" Paseman, we are attempting to find a lattice angle $\theta$ such that $$\cos \theta = \frac{ C}{\sqrt{C^2 + k}},$$ with integers $C,k$ and $k >0.$

In $\mathbf R^5,$ this is always possible.

In $\mathbf R^2,$ this is possible if and only if $k$ is a square, in which case $\theta$ is the angle between vectors $$P_2 = (1,0), \; \; T_2 = (C,\sqrt{k}).$$

In $\mathbf R^4,$ this is possible if and only if $k$ is the sum of three squares. Taking $$k = u^2 + v^2 + w^2,$$ $\theta$ is the angle between vectors $$P_4 = (1,0,0,0), \; \; T_4 = (C,u,v,w).$$

In $\mathbf R^3,$ this is also possible if and only if $k$ is the sum of three squares; this comes from simple tricks with integral quaternions. However, we can no longer take one vector as fixed, or bound its length ahead of time. Taking $k = u^2 + v^2 + w^2,$ and requiring that $u,v$ not both be $0,$ we find $\theta$ is the angle between vectors $$P_3 = (u,v,0), \; \; T_3 = (C u - v w, C v + u w , u^2 + v^2 ).$$

-
 Good summary. I think you need to clean your glasses. Gerhard "Think Anybody Can Do This?" Paseman, 2011.02.28 – Gerhard Paseman Feb 28 2011 at 22:10