Is it true that, to determine the rank of a matrix in trapezoidal form (row echelon form but pivots can be 0), you need to count the number of rows (or columns) with the same number of zeroes, except the null rows (columns)?
For example, take the matrix $$\begin{pmatrix}1&2&3&4&5\\0&1&2&3&4\\0&0&0&1&2\\0&0&0&3&4\\0&0&0&0&1\end{pmatrix}$$ which is in upper trapezoidal form. Row 1 has no zeroes, row 2 has 1 zero, rows 3 and 4 have each 3 zeroes and row 4 has 4 zeroes, thus the rank is 4.
Sometimes when doing Gaussian elimination it is more convenient to leave the pivot zero (probably because the elements below are already zero), so does this rule always work?
\begin{bmatrix} 1 & 2 & 3 & 4 & 5 \ 0 & 1 & 2 & 3 & 4 \ 0 & 0 & 0 & 1 & 2 \ 0 & 0 & 0 & 0 & -2 \ 0 & 0 & 0 & 0 & 0 \ \end{bmatrix}
Now all we have to do is count the rows. I hope this makes it more intuitive to understand why the rank is indeed 4 and not 5.
– ove Sep 29 '23 at 14:44