Suppose we are given a finite family of points $p\_1,...,p\_n\in \Bbb R^d$, so that any two points have a rational distance square, that is,


$$\|p\_i-p\_j\|^2\in\Bbb Q,\quad\text{for all $i,j\in\{1,...,n\}$}.$$


Is it know whether these points can be isometrically embedded into $\Bbb Q^{D}$ for some sufficiently large $D\ge d$? That is, are there $q\_1,...,q\_n\in\smash{\Bbb Q^D}$ so that


$$\|p\_i-p\_j\|=\|q\_i-q\_j\|,\quad\text{for all $i,j\in\{1,...,n\}$}?$$


If *yes*, what are reasonable lower/upper bounds for $D$?



Can every set of points with rational distance squares be isometrically embedded in $\Bbb Q^d$?
The following argument gives a bound of $D =4d$, based on a suggestion of LSpice in the comments.


Set $p\_1=0$. Using the distances and the fact that $p\_1=0$, we can find the dot products $p\_i \cdot p\_j$, which are all rational.


Assume we've embedded $p\_1,\dots,p\_k$ in $\mathbb Q^m$ and let's embed $p\_{k+1}$. The result will then follow by induction on $k$.


Among $p\_2,\dots, p\_k$ we can find $r$ of them that form a basis for the space $V\_k$ generated by $p\_2,\dots, p\_k$. Then every vector in $V\_k$ whose dot products with these $r$ vectors are rational is a rational linear combination of these vectors (invert the matrix) and thus lies in $\mathbb Q^m$. Hence the projection of $p\_{k+1}$ onto $V\_k$ lies in $\mathbb Q^m$.


If $p\_{k+1}$ lies in $V\_k$, we are done. Otherwise, $p\_{k+1}$ is equal to its projection onto $V\_k$ plus a vector orthogonal to $V\_k$. The length-squared of this orthogonal vector is rational. Choose a vector of that length-squared in $\mathbb Q^4$, and let $p\_{k+1}$ equal its projection plus this vector in $\mathbb Q^{m+4}$.


The total value of $D$ produced this way is $4d$ since $D$ goes up by $4$ every time $d$ goes up by $1$.




---


For a better value of $D=d+3$, we can use the following trick to reduce the dimension:


Let $W$ be the orthogonal complement in $\mathbb Q^{4d}$ of the vector space generated by $p\_1,\dots, p\_n$. If we find a vector in $W$ with length $1$, its orthogonal complement is isomorphic, as a vector space over $\mathbb Q$ with quadratic form, to $\mathbb Q^{4d-1}$. Iterating this, we can embed $p\_1,\dots, p\_n$ into $\mathbb Q^N$ for some $N$ in such a way that $p\_1=0$ and the orthogonal complement to the vector space generated by $p\_1,\dots, p\_n$ contains no vectors of length $1$.


By the Hasse-Minkowski theorem, the only way a positive definite quadratic form over the rationals can fail to represent $1$ is if there is a $p$-adic obstruction for some $p$, which can only happen if the dimension is at most $3$, so the dimension of the orthogonal complement is at most $3$ and $N \leq d+3$, as desired.


