Congruence condition regarding the determinant of a positive definite symmetric matrix I am trying to follow the proof of the transformation behaviour of theta functions associated to positive definite integer-valued quadratic forms in Iwaniec's Topics in Classical Automorphic Forms. One detail that I am a bit stuck on is how to arrive at expression (10.46) in the proof of Theorem 10.9. 
To summarise the situation: We are given a positive definite symmetric integer matrix $A\in M_r(\mathbb{Z})$ of even rank $r\equiv 0\pmod{2}$ with even diagonal entries $\operatorname{Diag}A \equiv 0\pmod{2}$ and odd determinant $|A|\equiv 1\pmod{2}$. I am trying to show the equivalence $$|A|\equiv (-1)^{r/2}\pmod{4}.$$
The claim is clear for $r=2$ since for a matrix $A=\begin{pmatrix} a & b \\ b & c \end{pmatrix}$ satisfying the above conditions $$|A|=ac-b^2\equiv -b^2\equiv -1 \pmod{4}.$$
However I am not sure how to proceed so any help or hints would be greatly appreciated.
 A: The author seems to suggest that there is some neat trick (probably some parity argument), but I'll prove the statement by mathematical induction on $r$. In the inductive step, as $A$ has an even diagonal but an odd determinant, some of its off-diagonal entries must be odd. By permuting the rows and columns of $A$ if necessary, we may assume that
$$
A
=\left(\begin{array}{c|c}X&Y^T\\ \hline Y&Z\end{array}\right)
=\left(\begin{array}{cc|c}a&b&u^T\\ b&c&v^T\\ \hline u&v&Z\end{array}\right)
$$
where $b$ is odd and $Z$ an $(r-2)\times(r-2)$ symmetric integer matrix. Thus
$$
x:=\det(X)=ac-b^2\equiv-b^2\equiv-1\pmod 4,\tag{1}
$$
meaning that $x=\det(X)$ is odd and $X$ is nonsingular. (This also proves the base case where $r=2$.) Therefore, using Schur complement, we obtain
\begin{align}
x^{r-3}\det(A)
&=x^{r-3}\det(X)\det(Z-YX^{-1}Y^T)\\
&=x^{r-2}\det(Z-YX^{-1}Y^T)\\
&=\det\left(xZ-Y\operatorname{adj}(X)Y^T\right)\\
&=\det\left(xZ-\pmatrix{u&v}\pmatrix{c&-b\\ -b&a}\pmatrix{u^T\\ v^T}\right)\\
&=\det\underbrace{\left(xZ-cuu^T-avv^T+b(uv^T+vu^T)\right)}_S.\tag{2}
\end{align}
Since $a,c$ and the diagonal entries of $Z$ are all even, $S$ has an even diagonal. Also, $\det(S)=x^{r-3}\det(A)$ is odd because both $x$ and $\det(A)$ are odd. Therefore, by induction assumption, $\det(S)\equiv(-1)^{(r-2)/2}\pmod4$. Consequently,
$$
(-1)^{r-3}\det(A)\equiv x^{r-3}\det(A)=\det(S)\equiv (-1)^{(r-2)/2}\pmod4,
$$
i.e. $\det(A)\equiv (-1)^{r-3}(-1)^{(r-2)/2}=(-1)^{r/2}\pmod4$.
