In my homework task, I need to prove that if my matrix have rank $k$ modulo $\ell$, then it also have rank $k$ modulo $p$. Please give me advice, how to prove it. --edit-- The precise task is: On the diagonal of square matrix of order $n$ are $0$s, other places are $1$ or $2012$. Prove that the rank of this matrix is $n$ or $n-1$. Consider modulo function. Login To add answer/comment