Let $ \mathcal{D}_k$ be the set of $k \times k$ integer, positive definite matrices with even diagonal. For $A \in \mathcal{D}_k$ we define the level of $A$ as the smallest integer $n_A \in \mathbb{N}$ such that $n_A A^{-1} \in \mathcal{D}_k$. I was reading the chapter on theta functions on Iwaniec's "Topics in classical automorphic forms" and it seems like he uses the following property of $n_A$ (e.g. in Theorem 10.9):
If a prime $p$ divides det$(A)$, then $p$ divides $n_A$.
Although it seems like something elementary, I have not been able to prove it. I tried to use the formula $$A^{-1} = \frac{1}{\det (A)} \operatorname{adj} (A)$$ but didn't arrive anywhere. I have also worked some concrete examples, but all of them have $n_A = 2 \det (A)$, for example:
$$ A =\begin{pmatrix} 2 & 1 & 0\\ 1 & 2 & 1 \\ 0 & 1 & 2 \end{pmatrix}$$
so is not very helpful. Any help would be appreciated.
Clearly it is necessary to find $n_A$ to be such that $n_AA^{-1}$ is a matrix which only contains integers. Therefore consider the equation $$ A^{-1} = \frac{1}{\det A} adj(A).$$ Since $A$ is a matrix of integers then it follows that $adj(A)$ is also a matrix of integers. In particular the elements $ij$ of the matrix $A^{-1}$ are all of the form
$$ \frac{p_{ij}}{\det A}$$ for some integers $p_{ij}$. We want $n_A$ such that
$$ n_A \frac{p_{ij}}{\det A} \in \mathbb Z \iff n_A p_{ij} = r a$$ where $ a = \det A$ and $r \in \mathbb Z$. Suppose $p$ divides $a$ but $p$ does not divide $n_A$. Then
$$ n_A p_{ij} = r p^m q$$ where $q$ is not divisible by $p$. Since $n_A$ is not divisible by $p$ it follows that $p_{ij}$ must be divisible by $p^m$. It follows that all the entries of the matrix $adj(A)$ are multiples of $p^m$. We can now calculate the determinant of $adj(A)$ in two different ways
Comparing the two results yields
$$ p^{mk} \omega = p^{mk-m}q^{k-1} \iff \omega = p^{-m} q^{k-1}$$ Therefore $\omega$ is not an integer : a contradiction.
Unless I've overlooked something it looks like that fact that $p$ is prime does not play a role here. So the more general result is
In particular $n_A$ is always a multiple of $\det A$ since $\det A$ is itself an integer. Moreover since you want $n_A A^{-1}$ to have an even diagonal in most cases you only have two possibilities for $n_A :$
$$n_A = \begin{cases} \det A & \text{ if } adj(A) \text{ has an even diagonal} \\ 2 \det A & \text{ otherwise} \end{cases}$$