Matrix invariant over rationals Consider an $n\times n$ matrix $A$ with $n$ even and all the diagonal entries of $A$ are even integers and the rest all odd integers. Show that $A$ is invertible over $\mathbb{Q}^m $   
My approach is that as $n$ is even hence we can never make the $\det A =0$ as no two rows (columns) can be made equal  or neither can a row or column be shown as a combination of other rows or columns.   
Can it be done this way help! though it can be done by reducing the entries mod $2$ but does the first approach works?
 A: Hint: for $n>1$ use the Leibniz formula
$$\det(A) = \sum_{\sigma\in S_n}\prod_{i=1}^n{\rm sgn}(\sigma)a_{\sigma(i),i}$$
and parity. Namely, count the number of products with some factor in the main diagonal (these products will be even) and the number of products with zero factors in the main diagonal (these products will be odd).
A: If we want to check whether $\det(A) \neq 0$ we can notice that it is equivalent that $\det(A^TA)=\det(A^T)\det(A )=(\det(A ))^2 \neq 0$.  
In this case when diagonal entries of $A$ are even and others are odd the matrix $C=A^TA$ for even dimension has a very specific form i.e in $C$ all diagonal entries are now odd and all others are even.  (easy to prove it if we notice that all entries of $C$ are of the form $a_i^Ta_j$ where $a_i,a_j$ are the columns of $A$). 
Now from the form of determinant listed in Martin-Blas' answer we can see that the  only  product of entries in the sum expression for determinant which is odd is that made of diagonal entries, all others are even so the determinant must be odd.   
Therefore the determinant is not equal to $0$.
Your proposed aprroach (checking when the columns(rows)   are linear combination of other columns(rows)), it seems, also leads to the checking the determinant as it could be summarized that there is a non-zero vector $v$ such that $Av =0$  (for linear dependency in $A$ the vector $v$ must lie in the nullspace of $A$) what is fulfilled when $\det(A)=0$.
A: I will prove that $\det A$ must be an odd integer, which proves that $\det A\neq0$.
Let $A'$ be the $n\times n$ matrix with $0$'s in the main diagonal and $1$'s otherwise. Then each entry of $A-A'$ is even and it is easy to deduce from this and from the definition of determinant that $\det A$ and $\det A'$ have the same parity. So, all I need to do is to prove that $\det A'$ is odd.
Let $V=\mathbb{Q}(1,1,\ldots,1)$ and let $W=\bigl\{(x_1,\ldots,x_n)\in\mathbb{Q}^n\,|\,x_1+\cdots+x_n=0\bigr\}$. It is clear that $\mathbb{Q}^n=V\oplus W$. Besides,


*

*$A.(1,1,\ldots,1)=n-1$;

*if $x_1+\cdots+x_n=0$, then $A.(x_1,\ldots,x_n)=(-x_1,\ldots,-x_n)=-(x_1,\ldots,x_n)$.


Therefore, $\det A'=(n-1)(-1)^{n-1}$, which is indeed an odd integer.
