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?
 A: As you've said, $X$ is the affine variety given by the three determinants.
Let's write this out.
Suppose $$M = \newcommand\bmat{\begin{pmatrix}}\newcommand\emat{\end{pmatrix}}\bmat a & b & c \\ d & e & f \emat$$
Then our space is $$X=\newcommand\Spec{\operatorname{Spec}}\Spec k[a,b,c,d,e,f] / (ae-bd, af-cd, bf-ce).$$
Notice that this is the affine cone of the projective variety
$$\Bbb{P}X=\operatorname{Proj} k[a,b,c,d,e,f]/(ae-bd,af-cd,bf-ce),$$
so its dimension will be one more than the dimension of the projective variety.
Localizing at a coordinate, say $a$ for example, we observe $\frac{e}{a}=\frac{bd}{a^2}$, $\frac{f}{a}=\frac{cd}{a^2}$, and then $$\frac{bf}{a^2} = \frac{bcd}{a^3}=\frac{ce}{a^2}.$$
Thus $$D_+(a) = \Spec k\left[\frac{b}{a},\frac{c}{a},\frac{d}{a}\right] = \Bbb{A}^3.$$
Thus we can cover $\Bbb{P}X$ by $\Bbb{A}^3$s, so $\Bbb{P}X$ is 3 dimensional.
Moreover, the pairwise intersections just correspond to inverting more of the coordinates, so the pairwise intersections of these open sets will be one of $\Bbb{A}^3\setminus V(x)$ or $\Bbb{A}^3\setminus V(xy)$, which are certainly nonempty.
Thus $\Bbb{P}X$ will be irreducible, see Lemma 27.3.3 at Stacks.
Since $\Bbb{P}X$ is irreducible and of dimension 3, $X$ is also irreducible and of dimension 4.
Edit
Let's see if I can't translate this to a more concrete form, involving only commutative algebra.
We want to show that $P=(ae-bd,af-cd,bf-ce)$ is prime. Noting that the ideal is homogeneous, it suffices to show that if $FG\in P$ with $F$, $G$, homogeneous, then one of $F$ or $G$ is in $P$. Dehomogenize by setting $a=1$. Then we get $F_aG_a \in P_a = (e-bd,f-cd,bf-ce)$ in the ring $k[b,c,d,e,f]$.
Observe that $k[b,c,d,e,f]/(e-bd,f-cd,bf-ce) = k[b,c,d]$, so $P_a$ is prime.
Therefore one of $F_a$ or $G_a$ is in $P_a$. WLOG $F_a\in P_a$, so
$$F_a(b,c,d,e,f) = H(b,c,d,e,f)(e-bd) + J(b,c,d,e,f)(f-cd) + K(b,c,d,e,f)(bf-ce).$$
Rehomogenizing, we obtain
$$a^{\deg F_a}F_a\left(\frac{b}{a},\frac{c}{a},\frac{d}{a},\frac{e}{a},\frac{f}{a}\right) = a^{\deg F_a}\left(H\left(\frac{b}{a},\frac{c}{a},\frac{d}{a},\frac{e}{a},\frac{f}{a}\right)\left(\frac{e}{a}-\frac{bd}{a^2}\right) + J\left(\frac{b}{a},\frac{c}{a},\frac{d}{a},\frac{e}{a},\frac{f}{a}\right)\left(\frac{f}{a}-\frac{cd}{a^2}\right) + K\left(\frac{b}{a},\frac{c}{a},\frac{d}{a},\frac{e}{a},\frac{f}{a}\right)\left(\frac{bf}{a^2}-\frac{ce}{a^2}\right)\right) \in P$$
Since $$F=a^ka^{\deg F_a}F_a\left(\frac{b}{a},\frac{c}{a},\frac{d}{a},\frac{e}{a},\frac{f}{a}\right),$$ we see $F\in P$. Thus $P$ is prime.
The property that dehomogenizing and rehomogenizing just kills factors of $a$ can be found here.
You'll notice that this argument should prove that the ideals $(ae-bd, af-cd)$ and $(ae-bd)$ are prime as well, the first being prime contrary to Youngsu's comment on the original question, but I'm fairly sure it's correct. Hopefully someone will point it out to me if I'm missing something obvious, but it should be mostly correct, since its roughly a translation of my earlier argument.
Assuming then that we know $P$ is prime, we need to compute the dimension of $k[a,b,c,d,e,f]/P$. Since this is a variety, its dimension is the same as the transcendence degree of the fraction field. Localizing before finding the fraction field gives the same fraction field, so we localize at $a$ first. Thus the dimension of $X$ is the transcendence degree of the fraction field of $k[a,b,c,d,a^{-1}]$ ($e$ and $f$ were killed by localizing at $a$), and the fraction field of this ring is $k(a,b,c,d)$. Thus the transcendence degree is 4, so $\dim X = 4$, as desired.
Second edit
There is an error in my proof that $P$ is prime.
Consider the ideal $(ae-bd,af-cd)$. Observe that $b(af-cd) - c(ae-bd) = abf-ace = a(bf-ce)$ lies in this ideal. Neither $a$ nor $bf-ce$ is in the ideal.
The problem is that when we dehomogenize, we get $bf-ce$ is in $P_a$, but its homogenization, also $bf-ce$ is not in $P$.
The error in my proof was that to properly rehomogenize the expression proving $F_a$ was in $P_a$, we may need to multiply by a higher power of $a$ than $\deg F_a$.
Thus we instead must conclude that $a^kF \in P$ for some $k$ rather than $F\in P$. Choose another variable to dehomogenize at, say $b$. Then $a^kF_b \in P_b$, and $P_b$ is prime, but $a\not \in P_b = (ae-d,f-ce)$. Thus $F_b\in P_b$, so $b^jF\in P$ as well. The choice of variable was irrelevant here. Thus for any of the variables $x$, we get $x^{n_x}F \in P$ for some nonnegative integer $n_x$.
A: 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).
