Elementary Row Operations Commute with Matrix Multiplication

Theorem
Let $\left({R, +, \circ}\right)$ be a commutative ring.

Let $\mathbf A = \left[{a}\right]_{m n}$ be an $m \times n$ matrix over $R$, and let $\mathbf B = \left[{b}\right]_{n p}$ be an $n \times p$ matrix over $R$.

Let $\hat o_1, \ldots, \hat o_{\hat{n} }$ be a finite sequence of elementary row operations that can be performed on a matrix over $R$ with $m$ rows.

Let $\mathbf A'$ denote the $m \times n$-matrix that results from using $\hat o_1, \ldots, \hat o_{\hat{n} }$ on $\mathbf A$.

Let $\mathbf C = \mathbf A \mathbf B$ be the matrix product of $\mathbf A$ and $\mathbf B$, and let $\mathbf C'$ denote the $m \times p$-matrix that results from using $\hat o_1, \ldots, \hat o_{\hat{n} }$ on $\mathbf C$.

Then:


 * $\mathbf C' = \mathbf A' \mathbf B$

Proof
Proof by induction over $\hat{n} \in \N$, the number of elementary row operations.

Basis for the Induction
Suppose that $\hat{n} = 0$.

Then, the proof is trivial:


 * $\mathbf C' = \mathbf C = \mathbf A \mathbf B = \mathbf A' \mathbf B$

Induction Hypothesis
Let $\hat{n} \in \N$ be fixed.

Let $\mathbf A' = \left[{a'}\right]_{m n}$ denote the matrix that results from using $\hat o_1, \ldots, \hat o_{\hat{n} }$ on $\mathbf A$.

Let $\mathbf C' = \left[{c'}\right]_{m p}$ denote the matrix that results from using $\hat o_1, \ldots, \hat o_{\hat{n} }$ on $\mathbf C = \mathbf A \mathbf B$.

The induction hypothesis is that:


 * $ \mathbf C' = \mathbf A' \mathbf B$

By definition of matrix product, this is equivalent to:


 * $\displaystyle \forall i \in \left\{ {1, \ldots, m}\right\}, k \in \left\{ {1, \ldots, p}\right\} : \ c'_{i k } = \sum_{j \mathop = 1}^{n} a'_{i j} b_{j k} $

Induction Step
Let $\hat o_1, \ldots, \hat o_{\hat{n} }, \hat o_{\hat{n} + 1}$ be a finite sequence of elementary row operations that can be performed on a matrix over $R$ with $m$ rows.

Let $\mathbf A = \left[{a}\right]_{m n}$ denote the matrix that results from using $\hat o_1, \ldots, \hat o_{\hat{n} + 1}$ on $\mathbf A$.

Let $\mathbf C = \left[{c}\right]_{m p}$ denote the matrix that results from using $\hat o_1, \ldots, \hat o_{\hat{n} + 1}$ on $\mathbf C$.

We must show that $\mathbf C = \mathbf A \mathbf B$, which by definition of matrix product is equivalent to:


 * $\displaystyle \forall i \in \left\{ {1, \ldots, m}\right\}, k \in \left\{ {1, \ldots, p}\right\} : \ c_{i k } = \sum_{j \mathop = 1}^{n} a_{i j} b_{j k}$

Let $r_{i_0}$ denote the $i_0$'th row of a matrix.

It is clear that $\hat o_{\hat{n} + 1}$ converts $\mathbf A'$ to $\mathbf A$, and $\hat o_{\hat{n} + 1}$ converts $\mathbf C'$ to $\mathbf C$.

First, suppose that $\hat o_{\hat{n} + 1}$ is of the type $r_{i_0} \to \alpha r_{i_0}$, where $\alpha \in R$ and $i_0 \in \left\{ {1, \ldots, m}\right\}$.

If $i \ne i_0$, then:

If $i = i_0$, then:

Suppose that $\hat o_{\hat{n} + 1}$ is of the type $r_{i_0} \to r_{i_0} + \alpha r_{i_1}$, where $\alpha \in R$ and $i_0, i_1 \in \left\{ {1, \ldots, m}\right\}, i_0 \ne i_1$.

If $i \ne i_0$, then $\displaystyle c_{i k} = \sum_{j \mathop = 1}^{n} a_{i j} b_{j k}$ as in the equation $(\text i )$.

If $i = i_0$, then:

Suppose that $\hat o_{\hat{n} + 1}$ is of the type $r_{i_0} \leftrightarrow r_{i_1}$, where $i_0, i_1 \in \left\{ {1, \ldots, m}\right\}, i_0 \ne i_1$.

If $i \ne i_0$ and $i \ne i_1$, then $\displaystyle c_{i k} = \sum_{j \mathop = 1}^{n} a_{i j} b_{j k}$ as in the equation $(\text i )$.

If $i = i_0$, then:

If $i = i_1$, then:

Then the induction step is proved for all three types of elementary row operations.