Assume $M(n,m)$ denote the vector space of $n\times m$ matrices. Consider this as an affine space. Now consider the subset of matrices with rank exactly $r$. Is this subset an irreducible subvariety? If it is, can we find its dimension?
The only thing I can recall about rank is that we can use minors of a matrix to determine the rank. In this way I guess I can prove the set is locally closed (in the Zarisky topology). So this should be a subvariety. About irreducibility, I guess I should express this subset as the image of some map, but I am not sure. Can I decompose a matrix with rank r by two other matrices?
Of course, the hardest part is the dimension. Totally no idea.