Appendices¶
A1. \(\,\) Elementary Operations and Elementary Matrices¶
We shall prove here some assertions formulated in previous sections of this Chapter.
A.) To perform a (row) elementary operation \(\,O\,\) on the product \(\,\boldsymbol{A}\boldsymbol{B}\ \) of two matrices, it is enough to apply \(\,O\,\) to the first factor only: \(\ O(\boldsymbol{A}\boldsymbol{B}) = (O\boldsymbol{A})\,\boldsymbol{B}.\ \) This can be expressed as
Lemma. \(\,\)
If \(\,\boldsymbol{A}\in M_{m\times p}(K),\ \boldsymbol{B}\in M_{p\times n}(K),\ \) then \(\,\) for \(\ i,j=1,\ldots,m:\)
\(\ O_1(i,j)\,(\boldsymbol{A}\boldsymbol{B})\ \ =\ \ [\,O_1(i,j)\,\boldsymbol{A}\,]\ \boldsymbol{B}\,,\)
\(\ O_2(i,a)\,(\boldsymbol{A}\boldsymbol{B})\ \ =\ \ [\,O_2(i,a)\,\boldsymbol{A}\,]\ \boldsymbol{B}\,,\qquad (a\ne 0)\)
\(\ O_3(i,j,a)\,(\boldsymbol{A}\boldsymbol{B})\ \ =\ \ [\,O_3(i,j,a)\,\boldsymbol{A}\,]\ \boldsymbol{B}\,.\)
Proof.
We shall make use of the Row Rule of Matrix Multiplication:
Thus the relations \(\,\) 1., \(\,\) 2., \(\,\) and \(\,\) 3. \(\,\) in the Lemma are derived as follows:
B.) Application of a (row) elementary operation to a rectangulara matrix \(\,\boldsymbol{A}\ \) is equivalent to left-multiplying \(\,\boldsymbol{A}\ \) by the corresponding elementary matrix. This has been stated as
Theorem 2. \(\,\)
Let \(\,\boldsymbol{A}\in M_{m\times n}(K).\ \) Then \(\,\) for \(\ i,j=1,\ldots,m:\)
\(\ O_1(i,j)\,\boldsymbol{A}\ = \ \boldsymbol{E}_1(i,j)\,\boldsymbol{A}\,,\)
\(\ O_2(i,a)\,\boldsymbol{A}\ = \ \boldsymbol{E}_2(i,a)\,\boldsymbol{A}\,,\qquad (a\ne 0)\)
\(\ O_3(i,j,a)\,\boldsymbol{A}\ = \ \boldsymbol{E}_3(i,j,a)\,\boldsymbol{A}\,,\)
where \(\ \ \boldsymbol{E}_1(i,j),\ \boldsymbol{E}_2(i,a),\ \boldsymbol{E}_3(i,j,a)\in M_m(K).\)
Proof. \(\ \) Taking into account that \(\,\boldsymbol{A} = \boldsymbol{I}_m\boldsymbol{A}\ \) and using the Lemma as well as the definition of elementary matrices, we get
\(\ O_1(i,j)\,\boldsymbol{A}\ = \ O_1(i,j)\,(\boldsymbol{I}_m\boldsymbol{A})\ = \ [\,O_1(i,j)\,\boldsymbol{I}_m\,]\,\boldsymbol{A}\ = \ \boldsymbol{E}_1(i,j)\,\boldsymbol{A}\,,\)
\(\ O_2(i,a)\,\boldsymbol{A}\ = \ O_2(i,a)\,(\boldsymbol{I}_m\boldsymbol{A})\ = \ [\,O_2(i,a)\,\boldsymbol{I}_m\,]\,\boldsymbol{A}\ = \ \boldsymbol{E}_2(i,a)\,\boldsymbol{A}\,,\)
\(\ O_3(i,j,a)\,\boldsymbol{A}\ = \ O_3(i,j,a)\,(\boldsymbol{I}_m\boldsymbol{A})\ = \ [\,O_3(i,j,a)\,\boldsymbol{I}_m\,]\,\boldsymbol{A}\ = \ \boldsymbol{E}_3(i,j,a)\,\boldsymbol{A}\,.\quad\bullet\)
In passing we note that composing elementary operations \(\,O_k,\ O_l\ \) results in multiplying their matrices \(\,\boldsymbol{E}_k = O_k\,\boldsymbol{I}_m,\ \boldsymbol{E}_l = O_l\,\boldsymbol{I}_m\,.\ \)
Indeed, due to the associativity of matrix multiplication, we get
C.) Elementary matrices are invertible, the inverse of an elementary matrix being also an elementary matrix. This has been enunciated in more detail as
Proposition 2. \(\,\)
Let \(\ \boldsymbol{E}_1(i,j),\ \boldsymbol{E}_2(i,a),\ \boldsymbol{E}_3(i,j,a)\in M_m(K),\ \, i,j=1,\ldots,m;\ \,i \neq j\,.\ \) Then
\(\ [\boldsymbol{E}_1(i,j)]^{-1}\,=\ \boldsymbol{E}_1(i,j),\)
\(\ [\boldsymbol{E}_2(i,a)]^{-1}\,= \ \boldsymbol{E}_2(i,a^{-1}),\qquad (a\ne 0)\)
\(\ [\boldsymbol{E}_3(i,j,a)]^{-1}\,=\ \boldsymbol{E}_3(i,j,-a).\)
Proof.
1.) \(\:\)A twofold transposition of any \(i\)-th and \(j\)-th rows is the identity operation:
The left-hand side may be transformed as follows:
Thus \(\ \ \boldsymbol{E}_1(i,j) \cdot \boldsymbol{E}_1(i,j)\ = \ \boldsymbol{I}_m\,,\ \) wherefrom \(\ [\,\boldsymbol{E}_1(i,j)\,]^{-1} =\ \boldsymbol{E}_1(i,j)\,.\)
2.) \(\:\) Composing \(\,O_2(i,a)\ \,\) with \(\ \ O_2(i,a^{-1})\,\) results in the identity operation:
Thus \(\ \ \boldsymbol{E}_2(i,a^{-1}) \cdot \boldsymbol{E}_2(i,a)\ = \ \boldsymbol{I}_m\,,\ \) wherefrom \(\ [\,\boldsymbol{E}_2(i,a)\,]^{-1} =\ \boldsymbol{E}_2(i,a^{-1})\,.\)
3.) \(\ \) Composition of \(\,O_3(i,j,a)\ \,\) with \(\ \ O_3(i,j,-a)\,\) yields the identity operation:
Thus \(\ \ \boldsymbol{E}_3(i,j,-a) \cdot \boldsymbol{E}_3(i,j,a)\ = \ \boldsymbol{I}_m\,\ \) wherefrom \(\ \,[\,\boldsymbol{E}_3(i,j,a)\,]^{-1} =\ \boldsymbol{E}_3(i,j,-a)\,. \quad\bullet\)
A2. \(\,\) Extended (reduced row) Echelon Form of a Matrix¶
The method extended_echelon_form()
appends the identity matrix
\(\,\boldsymbol{I}_m\in M_m(K)\ \) to the right of a given
rectangular matrix \(\,\boldsymbol{A}\in M_{m\times n}(K).\ \)
The obtained matrix with \(\,m\,\) rows and \(\,n+m\,\)
columns is afterwards converted into the row echelon form. When the base
ring of the matrix is a field, this is the reduced row echelon (rre) form.
Otherwise, if \(\,\boldsymbol{A}\ \) is built over a ring that is
not a field, the returned echelon matrix will be non-reduced,
i.e. its leading entries may be non-unital (unlike rref()
, \(\,\)
extended_echelon_form()
does not automatically move
to the rational field). 4
The final \(\,m\,\) columns of the matrix returned by
extended_echelon_form()
provide a square matrix
\(\,\boldsymbol{D}\ \) that transforms \(\,\boldsymbol{A}\ \)
to the echelon form when it multiplies \(\,\boldsymbol{A}\,\)
from the left. Obviously, for a non-singular square matrix
\(\,\boldsymbol{A}\,\) we get \(\,\boldsymbol{D}=
\boldsymbol{A}^{-1}.\ \) \(\\\)
Example. Given the matrix \(\ \ \boldsymbol{A}\ =\ \left[\begin{array}{rrrrr} 1 & 0 & 2 & -1 & 2 \\ -1 & 1 & -2 & 3 & -3 \\ 2 & 0 & 4 & -2 & 4 \end{array}\right]\,\in\,M_{3\times 5}(Q)\,,\) \(\\\)
we shall find its rre form and the matrix \(\,\boldsymbol{D}\,\) such that the product \(\,\boldsymbol{D}\boldsymbol{A}\,\) is the rre form of \(\,\boldsymbol{A}\,.\) \(\\\)
1.) \(\,\) Basic approach. The rre form of \(\,\boldsymbol{A}\ \) may be achieved by two elementary operations:
\(\,\) to the second row add the first row,
\(\,\) from the third row subtract the doubled first row.
The row operations being represented by elementary matrices, we get
The matrix \(\,\boldsymbol{D}\,\) in demand is given by
2.) \(\,\) Application of the method
\(\,\) extended_echelon_form()
.
sage: A = matrix(QQ,[[ 1, 0, 2,-1, 2],
[-1, 1,-2, 3,-3],
[ 2, 0, 4,-2, 4]])
# Create a 2-block Ae_D composed of matrices Ae and D
# (here Ae := A in the reduced row echelon form);
# display the result divided into the Ae and D parts:
sage: Ae_D = A.extended_echelon_form(subdivide=True)
sage: Ae_D
[ 1 0 2 -1 2| 0 0 1/2]
[ 0 1 0 2 -1| 0 1 1/2]
[------------------------+--------------]
[ 0 0 0 0 0| 1 0 -1/2]
Thus we come up with another value of \(\,\boldsymbol{D}\,:\)
Both matrices, \(\,\boldsymbol{D}_1\ \) and \(\,\boldsymbol{D}_2\,,\ \) transform the matrix \(\,\boldsymbol{A}\ \) to the same (unique) rre form by multiplying it from the left:
sage: A = matrix(QQ,[[ 1, 0, 2,-1, 2],
[-1, 1,-2, 3,-3],
[ 2, 0, 4,-2, 4]])
sage: D1 = matrix(QQ,[[ 1, 0, 0],
[ 1, 1, 0],
[-2, 0, 1]])
sage: D2 = matrix(QQ,[[0, 0, 1],
[0, 2, 1],
[2, 0,-1]])/2
sage: D1*A == D2*A
True