Echelon Form
To solve a system of linear equations $Ax = b$, we often use row elimination on matrix $A$ to bring the system into a form that can be solved using the substitution method. For example, suppose:
$$ \begin{align*} &\begin{bmatrix} 1 & 2 \\ 1 & 3 \end{bmatrix} \begin{bmatrix} x_1 \\ x_2 \end{bmatrix} = \begin{bmatrix} 3 \\ 4 \end{bmatrix} \\ \Leftrightarrow & \begin{cases} x_1 + 2x_2 &&= 3 \\ x_1 + 3x_2 &&= 4 \end{cases} \end{align*} $$
Solving this system directly would be difficult, so we’ll transform $A$ a bit into the following form:
$$ \begin{align*} \begin{bmatrix} 1 & 2 \\ 1 & 3 \end{bmatrix} \rightarrow \begin{bmatrix} 1 & 2 \\ 0 & 1 \end{bmatrix} = U \end{align*} $$
By subtracting row 1 from row 2, the system becomes:
$$ \begin{align*} &\begin{bmatrix} 1 & 2 \\ 0 & 1 \end{bmatrix} \begin{bmatrix} x_1 \\ x_2 \end{bmatrix} = \begin{bmatrix} 3 \\ 4 \end{bmatrix}\\ \Leftrightarrow & \begin{cases} x_1 + &2x_2 &&= 3\\ &x_2 &&= 1 \end{cases} \end{align*} $$
We easily deduce $x_2 = 1$ and $x_1 = 1$. The matrix form $U$ is called the echelon form matrix. A matrix is in Echelon form if it satisfies 2 conditions:
Either there are no zero rows (rows where all elements are non-zero) or the zero rows of the matrix are below the non-zero rows.
The leading element of each row is to the right of the leading element of the previous row.
The leading element is the first non-zero element in a row of the matrix. Examining matrix $U$, we see it satisfies both conditions above. Thus, $U$ is an echelon matrix.
Another example: let $A = \begin{bmatrix} 1 & 2 & 2 & 2 \\ 2 & 4 & 6 & 8 \\ 3 & 6 & 8 & 10 \end{bmatrix}$. $A$ is a non-square matrix and is linearly dependent (since column 2 of $A$ is a linear combination of column 1). First, we perform row elimination on row 2:
$$ \begin{bmatrix} 1 & 2 & 2 & 2 \\ 2 & 4 & 6 & 8 \\ 3 & 6 & 8 & 10 \end{bmatrix} \rightarrow \begin{bmatrix} 1 & 2 & 2 & 2 \\ 0 & 0 & 2 & 4 \\ 0 & 0 & 2 & 4 \end{bmatrix} $$
Continuing to eliminate the last row, we have:
$$ \begin{bmatrix} 1 & 2 & 2 & 2 \\ 0 & 0 & 2 & 4 \\ 0 & 0 & 2 & 4 \end{bmatrix} \rightarrow \begin{bmatrix} 1 & 2 & 2 & 2 \\ 0 & 0 & 2 & 4 \\ 0 & 0 & 0 & 0 \end{bmatrix} = U $$
Rank of a Matrix
In brief, the rank of a matrix is the number of leading elements it contains. As seen in both examples above, since $U$ has 2 leading elements, we have $rank(U) = 2$.