suppose that $G$ is connected and $A_L$ is adjacency matrix of line graph of $G$,show that the rank of $A_L$ over field $\mathbb{Z}_2$ is :
$$rank_{\mathbb{Z}_2}(A_L)=\left\{\begin{matrix} n-1 & n \: is \: odd \\ n-2& n \: is \: even \end{matrix}\right.$$
using the formula $A_L =X^T X-2I$,because we are in $\mathbb{Z}_2$ we can omit $2I$ ,so we must work with $X^T X$,which $X$ is incident matrix of $G$,now I don't know how should I continue,maybe this way is not right.
any idea,hint or theorem which I should consider will be great ,thanks!