Square Matrix is Row Equivalent to Triangular Matrix

Theorem
Let $$\mathbf{A} = \left[{a}\right]_{n}$$ be a square matrix of order $n$.

Then $$\mathbf{A}$$ can be converted to an upper or lower triangular matrix by elementary row operations of type 2: $$r_i \to r_i + ar_j$$ and type 3: $$r_i \leftrightarrow r_j$$.

Proof
Let $$\mathbf{A}$$ be a square matrix of order $n$.

Follow this procedure:

Suppose that column $$1$$ is a non-zero column.

If element $$a_{11} = 0$$, swap row $$1$$ with another row $$j$$ in which $$a_{j1} \ne 0$$, using the elementary row operation $$r_1 \leftrightarrow r_j$$.

So we get to a matrix in which element $$a_{11} \ne 0$$.

Now we use a series of elementary row operations:

$$\forall j \in \left[{2 \,. \, . \, n}\right]: r_j \to r_j - \frac {a_{1j}} {a_{11}}r_1$$

This will render all the elements of column $$1$$ to zero except for element $$a_{11}$$.

If, on the other hand, column $$1$$ is already a zero column, that column is already in the required format.

Having done that, we now move on to the minor of $$a_{11}$$, which will be an $$\left({n-1}\right) \times \left({n-1}\right)$$ square matrix and the same procedure can be followed.

This is done for all columns, each one starting one element down from the one before.

Eventually you run out of matrix, which will then be in upper triangular form.

To get the matrix into lower triangular form, just do the same thing but start with the last column and focus on element $$a_{nn}$$, working backwards and up.