I know this not, everybody else seems to. This is from page 215 of Cassels, Rational Quadratic Forms, formula 4.1, or SPLAG, page 389 formula (36). quote:



> 
> If $f$ and $g$ are forms of
>  determinant $d$ in the same genus,
>  then they are rationally equivalent by
>  some transformation whose denominator
>  is prime to $2d.$ Hence we can find
>  corresponding lattices $L,M$ for which
>  $$ [ L : L \cap M ] = [ M : L \cap M]
> > = r, $$ say, for some number $r$ which is prime to $2d.$
> 
> 
> 


We are talking about Siegel's definition of forms being in the same genus if they are **rationally equivalent without essential denominator.**


So, here is an example in matrix slang. Given quadratic forms with symmetric matrices
$$ F \; = \; 
 \left( \begin{array}{cccc}
 2 & 1 & 0 & 1 \\\
 1 & 2 & 0 & 0 \\\
 0 & 0 & 2 & 1 \\\ 
 1 & 0 & 1 & 6 
\end{array} 
 \right)
 $$
and
$$ G \; = \; 
 \left( \begin{array}{cccc}
 2 & 1 & 1 & 0 \\\
 1 & 2 & 0 & 1 \\\
 1 & 0 & 2 & 0 \\\ 
 0 & 1 & 0 & 8 
\end{array} 
 \right)
 $$
Next, I take $r=3,$ because the discriminant is $29,$ and find
$$ P \; = \; 
 \left( \begin{array}{cccc}
 1 & 1 & 1 & 7 \\\
 1 & -2 & 1 & -5 \\\
 1 & 1 & -2 & 1 \\\ 
 1 & 1 & 1 & -2 
\end{array} 
 \right)
 $$
that satisfies
$$ P^T \; F \; P \; = \; 9 \; G = r^2 \; G. $$


Now, here is the trick. To get back from $G$ to $F,$ it appears that one needs to use $Q = \; \mbox{adj} \; P$ which has a much larger determinant, so things look asymmetric. Indeed,
$$ Q \; = \; \; \mbox{adj} \; P \; = \; 
 \left( \begin{array}{cccc}
 -18 & -27 & -27 & -9 \\\
 9 & 27 & 0 & -36 \\\
 -9 & 0 & 27 & -18 \\\ 
 -9 & 0 & 0 & 9 
\end{array} 
 \right)
 $$
However, a miracle! The GCD of these entries is 9, and we get the improved
$$ Q\_1 \; = \; 
 \left( \begin{array}{cccc}
 -2 & -3 & -3 & -1 \\\
 1 & 3 & 0 & -4 \\\
 -1 & 0 & 3 & -2 \\\ 
 -1 & 0 & 0 & 1 
\end{array} 
 \right).
 $$
The we really do get what we wanted,
$$ P Q\_1 = -9 I = \pm r^2 I $$
and
$$ Q\_1^T \; G \; Q\_1 \; = \; 9 \; F = \; r^2 F. $$


Alright, so here is the **question,** with the dimension $n$ thrown in: Suppose $F,G$ are symmetric positive definite matrices of integers with the same determinant $d.$ Suppose we have an integer $r$ with $\gcd (r, 2 d) = 1.$ Suppose that we have a matrix $P$ of integers, with $\det P = \pm r^n,$ such that $ P^T \; F \; P \; = \; r^2 \; G. $ Take $Q = \; \mbox{adj} \; P,$ so that $\det Q = \pm r^{n^2 - n}$ and $PQ = QP = (\det P) I = \pm r^n I.$ Is it always the case that
$$ \gcd Q = r^{n-2} ?$$


I think this is progress. Since 1994, it is only 18 years that I have been completely confused on this point and unaware that I was confused. 


EDIT:
The matrix $P$ is not necessarily rank $1 \pmod r.$ Here are the two forms by Schiemann of discriminant 1729, not equivalent but in the same genus and, wait for it, the same theta series.


$$ F \; = \; 
 \left( \begin{array}{cccc}
 4 & 1 & 0 & 1 \\\
 1 & 8 & 1 & 3 \\\
 0 & 1 & 8 & 4 \\\ 
 1 & 3 & 4 & 10 
\end{array} 
 \right)
 $$
and
$$ G \; = \; 
 \left( \begin{array}{cccc}
 4 & 2 & 1 & 1 \\\
 2 & 8 & -2 & 1 \\\
 1 & -2 & 10 & 5 \\\ 
 1 & 1 & 5 & 10 
\end{array} 
 \right)
 $$
Next, I take $r=5,$ and find
$$ P \; = \; 
 \left( \begin{array}{cccc}
 -1 & 6 & -4 & 0 \\\
 -2 & -3 & -3 & 0 \\\
 3 & 2 & -3 & 0 \\\
 -1 & -1 & 0 & -5 
\end{array} 
 \right)
 $$
that satisfies
$$ P^T \; F \; P \; = \; 25 \; G = r^2 \; G. $$
We still wind up, in the same manner, with a very pleasant
$$ Q\_1 \; = \; 
 \left( \begin{array}{cccc}
 -3 & -2 & 6 & 0 \\\
 3 & -3 & -1 & 0 \\\
 -1 & -4 & -3 & 0 \\\ 
 0 & 1 & -1 & -5 
\end{array} 
 \right).
 $$



Matrix version of number theoretic  integral lattice claim
Write $P$ in Smith normal form as $SDT$, where $S$ and $T$ have determinant $\pm 1$ and $D$ is diagonal with diagonal entries $d\_1 | d\_2 | d\_3 | \cdots | d\_n$. We may replace $(F, G, P)$ by $(S^{-T} F S^{-1}, T^{T} G T, D)$ and therefore assume $P$ is diagonal with entries $d\_i$ as stated. Note that this replacement preserves all the hypotheses and the desired conclusion.


 **Claim 1:**  We have $r^2 | d\_k d\_{n+1-k}$ for all $1 \leq k \leq n$.


**Proof:** Suppose, to the contrary, that $p$ is a prime dividing $r^2$ more times than it divides $d\_k d\_{n+1-k}$. The condition $D^T F D \equiv 0 \mod r^2$ means $d\_i d\_j F\_{ij} \equiv 0 \mod r^2$ for all $(i,j)$. So, for all $i \leq k$ and $j \leq n+1-k$, we have $F\_{ij} \equiv 0 \mod p$. So the first $k$ rows of $F$ span a $\leq k-1$ dimensional space modulo $p$, contradicting that $p$ does not divide $\det F$. $\square$


Claim 1 is used only to prove the stronger:


**Claim 2:**  For all $1 \leq k \leq n$, we have $d\_k d\_{n+1-k} = r^2$.


**Proof:** Since $D^T F D = r^2 G$ and $\det F= \det G$, we deduce that $\det D = r^n$. So $\prod\_{k=1}^n d\_k = r^n$ and $\prod (d\_k d\_{n+1-k}/ r^2) = 1$. By the previous claim, all of the factors in this product are positive integers, so they must all be $1$. $\square$


In particular, every $d\_k | r^2$. This means that every principal minor $\det D/d\_k$ must be divisible by $r^n/r^2 = r^{n-2}$, and the nonprincipal minors are zero, giving the desired conclusion. More conceptually, if we define $D'$ to be $D$ with the elements in the opposite order, then $D D' = r^2$. Conjugating back to the original basis, this $D'$ will turn into the matrix you called $Q\_1$.


