We fully determine the communication complexity of approximating matrix rank, over any finite field $\mathbb{F}$. We study the most general version of this problem, where $0\leq r < R\leq n$ are given integers, Alice and Bob's inputs are matrices $A,B\in\mathbb{F}^{n\times n}$, respectively, and they need to distinguish between the cases $\mathrm{rk}(A+B)=r$ and $\mathrm{rk}(A+B)=R$. We show that this problem has randomized communication complexity $\Omega(1+r^{2}\log|\mathbb{F}|)$. This is optimal in a strong sense because $O(1+r^{2}\log|\mathbb{F}|)$ communication is sufficient to determine, for arbitrary $A,B$, whether $\mathrm{rk}(A+B)\leq r$. Prior to our work, lower bounds were known only for consecutive integers $r$ and $R$, with no implication for the approximation of matrix rank. Our lower bound holds even for quantum protocols and even for error probability $\frac{1}{2}-\frac{1}{4}|\mathbb{F}|^{-r/3}$, which too is virtually optimal because the problem has a two-bit classical protocol with error $\frac{1}{2}-\Theta(|\mathbb{F}|^{-r})$.
As an application, we obtain an $\Omega(\frac{1}{k}\cdot n^{2}\log|\mathbb{F}|)$ space lower bound for any streaming algorithm with $k$ passes that approximates the rank of an input matrix $M\in\mathbb{F}^{n\times n}$ within any constant factor less than $\sqrt{2}$. Our result is an exponential improvement in $k$ over previous work.
We also settle the randomized and quantum communication complexity of several other linear-algebraic problems, for all settings of parameters. This includes the determinant problem (given matrices $A$ and $B$, distinguish between the cases $\mathrm{det}(A+B)=a$ and $\mathrm{det}(A+B)=b$, for fixed field elements $a\ne b)$ and the subspace sum and subspace intersection problems (given subspaces $S$ and $T$ of known dimensions $m$ and $\ell$, respectively, approximate the dimensions of $S+T$ and $S\cap T$).