Find the algebraic dimension of space of matrices From A. Gathmann's Algebraic Geometry (2014):

Exercise 2.31. Let $X$ be the set of all $2 \times 3$ matrices over a field $K$ that have rank at most $1$, considered as a subset of $\mathbb A^6 = \mathrm{Mat}(2\times 3,K)$.
Show that $X$ is an affine variery. Is it irreducible? What is its dimension?

My take on this is the following:

Call $M_1$, $M_2$ and $M_3$ the three $2 \times 2$ minors of any $2 \times 3$ matrix. Then $$X = V(\det M_1, \det M_2, \det M_3).$$ Trivially, this shows $X$ is an affine variety.
Moreover, the ideal generated by the three determinants (call it $I$) looks prime (my guess is that $\det M_i$ and $\det M_j$ are coprime when $i \neq j$), thus the above expression is actually an irreducible decomposition of $X$ (which shows, in turn, that $X$ is not reducible).
Finally, I guess $(\det M_i, \det M_j)$ to be the only prime ideals under $I$, so that the (Krull) dimension of the latter is $3$. Hence I guess the dimension of $X$ is $3$ as well.

As you see, there a lot of guesses: are they correct? Do they need more discussion?

Here is a way to prove irreducibility of
$$X=\{A\in\mathrm{Mat}_{n\times m}(K)\mid \mathrm{rank}A\leq r\}.$$
It can be seen as the image of the map $$\phi:\mathrm{Mat}_{n\times r}(K)\times \mathrm{Mat}_{r\times m}(K)\ni (M,N)\mapsto MN\in X.$$
$\phi$ is a polynomial map and hence Zariski continuous.  Further, $$\mathrm{Mat}_{n\times r}(K)\times \mathrm{Mat}_{r\times m}(K)\cong K^{nr+rm}$$ is irreducible, thus so is $X$ (because continuous images of irreducible spaces are irreducible).
