Let $M=Mat_{n\times n}(\mathbb{C})$. We know that Grassmanian $Gr_m(\mathbb{C}^n)$ is smooth and we can just need to find the dimension of a neighborhood of a point . We can use the fact that it is a homogenous space to prove that it actually has the required dimension.
Now let $X_r$ be the subvariety of $M$ to be all matrices of rank lesser or equal to $r$.
At the beginning , I want to use the same techique to find the dimension of $X_r$ but later I realized $X_r$ may not be smooth. I can't define it as a homogenous space.
Does anyone can provide some hints for me?
You can see all this done by looking up (or Googling) "determinantal variety." For instance, it's done on the Wikipedia page, and there's a more comprehensive section in Harris's Algebraic Geometry: A First Course.