선형대수학
Matrices
Definition and operations of matrices
In this post, we define matrices and the operations between them.
Basic Definitions of Matrices
Simply put, an \(m\times n\) matrix is \(mn\) scalars written in an \(m\times n\) rectangular shape. That is, for a matrix \(A\), if we denote the entry corresponding to the \(i\)th row and \(j\)th column of \(A\) by \(A_{ij}\), the matrix can be represented as follows.
\[A=\begin{pmatrix}A_{11}&A_{12}&\cdots&A_{1n}\\A_{21}&A_{22}&\cdots&A_{2n}\\ \vdots&\vdots&\ddots&\vdots\\A_{m1}&A_{m2}&\cdots&A_{mn}\end{pmatrix}\]In the matrix \(A\) above, the \(m\) vectors
\[(A_{11},A_{12},\cdots, A_{1n}),\ldots,(A_{m1},A_{m2},\cdots,A_{mn})\]are called the rows of \(A\), and the \(n\) vectors
\[(A_{11},A_{21},\cdots,A_{m1}),\ldots, (A_{1n}, A_{2n},\cdots, A_{mn})\]are called the columns of \(A\). Here the row vectors are all elements of the \(n\)-dimensional space \(\mathbb{K}^n\), and the column vectors are elements of the \(m\)-dimensional space \(\mathbb{K}^m\).
It is often convenient to group certain blocks of a matrix and write it in block form. For example, the following matrix
\[\begin{pmatrix}0&0&1\\ 0&0&3\\ 2&4&0\end{pmatrix}\]can be written conveniently as in the figure below:
Similarly, in the \(m\times n\) matrix \(A\) above, using each of the column vectors \(A_1\), \(A_2\), \(\ldots\), \(A_n\), we can also write
\[A=(A_1\vert A_2\vert \cdots\vert A_n)\]With each entry being an element of \(\mathbb{K}\), the set of all \(m\times n\) matrices is denoted by \(\Mat_{m\times n}(\mathbb{K})\). In particular, \(\Mat_{m\times m}(\mathbb{K})\) is abbreviated as \(\Mat_m(\mathbb{K})\).
Operations on Matrices
Addition and multiplication are defined between matrices, but addition and multiplication are not well-defined for arbitrary elements. For example, addition is defined only for matrices of the same shape as the entrywise sum. That is, \(\Mat_{m\times n}(\mathbb{K})\) has a well-defined addition. In addition, if we define scalar multiplication for each matrix by the formula
\[\alpha\begin{pmatrix}A_{11}&A_{12}&\cdots&A_{1n}\\A_{21}&A_{22}&\cdots&A_{2n}\\ \vdots&\vdots&\ddots&\vdots\\A_{m1}&A_{m2}&\cdots&A_{mn}\end{pmatrix}=\begin{pmatrix}\alpha A_{11}&\alpha A_{12}&\cdots&\alpha A_{1n}\\\alpha A_{21}&\alpha A_{22}&\cdots&\alpha A_{2n}\\ \vdots&\vdots&\ddots&\vdots\\\alpha A_{m1}&\alpha A_{m2}&\cdots&\alpha A_{mn}\end{pmatrix}\]then one can easily verify that \(\Mat_{m\times n}(\mathbb{K})\) has a \(\mathbb{K}\)-vector space structure. This vector space is \(mn\)-dimensional. Of course, taking the following matrices
\[\begin{pmatrix}1&0&\cdots&0\\0&0&\cdots&0\\\vdots&\vdots&\ddots&\vdots\\0&0&\cdots&0\end{pmatrix},\quad\begin{pmatrix}0&1&\cdots&0\\0&0&\cdots&0\\\vdots&\vdots&\ddots&\vdots\\0&0&\cdots&0\end{pmatrix},\quad\cdots,\quad\begin{pmatrix}0&0&\cdots&0\\0&0&\cdots&0\\\vdots&\vdots&\ddots&\vdots\\0&0&\cdots&1\end{pmatrix}\]as a basis would be simplest. Matrix multiplication is slightly more complicated than this, so we must first define the product of a matrix and a vector.
Definition 1 Let \(A\in\Mat_{m\times n}(\mathbb{K})\) and \(x\in\mathbb{K}^n\). Then, for the matrix \(A\) and the vector \(x\), the product \(Ax\) is defined by the formula
\[Ax=\sum_{j=1}^nx_j A_j\]Here \(x_j\) is \(x\)’s \(j\)th component, and \(A_j\) is \(A\)’s \(j\)th column vector.
By the above definition, \(Ax\) is, for any vector \(x\), always a linear combination of the column vectors \(A_j\). Therefore, the set obtained by collecting, for all \(x\in\mathbb{K}^n\), the vectors \(Ax\) will be \(\span\left\{A_1, A_2,\ldots,A_n\right\}\), which is called the column space of \(A\) and denoted briefly by \(\col A\). Of course, similarly to this, the row space of \(A\) can also be defined, but it is rarely used.
The above formula can be written out in more detail. For the column vector \(A_j\), let its \(i\)th component be denoted by \(A_{ij}\). Then the first component of the vector \(Ax\) is the sum of the first components of the vectors \(x_jA_j\), so it can be written as
\[x_1A_{11}+x_2A_{12}+\cdots+x_nA_{1n}\]and, more generally, for \(Ax\), the \(i\)th component appears as
\[x_1A_{i1}+x_2A_{i2}+\cdots+x_nA_{in}\]Thus, explicitly, we obtain the formula
\[\begin{pmatrix}A_{11}&A_{12}&\cdots&A_{1n}\\A_{21}&A_{22}&\cdots&A_{2n}\\\vdots&\vdots&\ddots&\vdots\\A_{m1}&A_{m2}&\cdots&A_{mn}\end{pmatrix}\begin{pmatrix}x_1\\x_2\\\vdots\\x_n\end{pmatrix}=\begin{pmatrix}\sum_{i=1}^nA_{1i}x_i\\\sum_{i=1}^nA_{2i}x_i\\\vdots\\\sum_{i=1}^nA_{mi}x_i\end{pmatrix}\]Matrix Multiplication
Having defined the product of a matrix and a vector, we can now define the product of two matrices.
Definition 2 For two matrices \(A\in \Mat_{m\times n}(\mathbb{K})\) and \(B\in\Mat_{p\times q}(\mathbb{K})\), a necessary and sufficient condition for the matrix product \(BA\) to be defined is that \(q=m\). In this case, the matrix product \(BA\) is given by the formula
\[BA=(BA_1\vert BA_2\vert \cdots\vert BA_n)\](\(A_i\) is \(A\)’s \(i\)th column, and \(BA_i\) is the product of the column vector \(A_i\) and the matrix \(B\)1)
That is, expressing \(A_j\)’s \(i\)th component as \(A_{ij}\), we can write
\[BA_j=\sum_{k=1}^m A_{kj}B_k\]Here, the column vector \(BA_j\)’s \(i\)th component (that is, the matrix \(BA\)’s \((i,j)\)th entry \((BA)_{ij}\)) is given by
\[(BA)_{ij}=\sum_{k=1}^m B_{ik}A_{kj}\]Matrix multiplication does not satisfy the commutative law. That is, \(AB=BA\) does not hold in general. Even if \(BA\) is defined, there is no guarantee that \(AB\) is defined, and even if both are defined, \(AB\) and \(BA\) may have different shapes; moreover, even if \(m=n=p=q\) holds so that \(AB\), \(BA\in\Mat_{m\times m}(\mathbb{K})\), these values may still differ.
On the other hand, matrix multiplication satisfies the associative law. If \(A,B,C\) are matrices such that \(AB\) and \(BC\) are both defined, then the matrix products \(A(BC)\) and \((AB)C\) are also well-defined, and in this case
\[A(BC)=(AB)C\]holds.
Definition 3 The matrix \(I=(e_1\mid e_2\mid\cdots\mid e_n)\) is called the \(n\times n\) identity matrix.
That is,
\[I=\begin{pmatrix}1&0&\cdots&0\\0&1&\cdots&0\\\vdots&\vdots&\ddots&\vdots\\ 0&0&\cdots&1\end{pmatrix}\]Similarly, a matrix whose entries except the diagonal entries are all \(0\) is called a diagonal matrix.
True to its name, if \(I\) is the \(n\times n\) identity matrix, then for any \(m\times n\) matrix \(A\), we have \(AI=A\), and for any \(n\times m\) matrix \(B\), we have \(IB=B\).
Definition 4 Let \(A\in\Mat_n(\mathbb{K})\) be a matrix. We say that \(A\) is invertible if there exists some \(B\in\Mat_n(\mathbb{K})\) such that \(AB=BA=I\). A matrix that is not invertible is called a singular matrix.
An arbitrary element of \(\Mat_n(\mathbb{K})\) need not be invertible. For example, the zero matrix \(O\) is not invertible. Therefore, \(\Mat_n(\mathbb{K})\) does not form a group under multiplication. Instead, collecting only the square matrices of order \(n\) that have an inverse yields the structure of a group.
Definition 5 The group whose underlying set is the collection of \(n\times n\) invertible matrices and whose operation is matrix multiplication is written \(\GL(n;\mathbb{K})\) and is called the general linear group.
As mentioned above, matrix multiplication satisfies the associative law. That is, the operation of \(\GL(n;\mathbb{K})\) is associative. Moreover, the identity element of \(\GL(n;\mathbb{K})\) is the identity matrix \(I\), and the inverse of \(A\in\GL(n;\mathbb{K})\) is the matrix \(B\) appearing in the definition of Definition 4. From the uniqueness in §Abelian Groups and Fields, ⁋Proposition 2, we know that the inverse of \(A\) is unique. It is called the inverse matrix of \(A\) and is denoted by \(A^{-1}\). From the observation
\[\begin{aligned}(B^{-1}A^{-1})AB&=B^{-1}IB=B^{-1}B=I\\ (AB)(B^{-1}A^{-1})&=A(BB^{-1})A^{-1}=AA^{-1}=I\end{aligned}\]we see that the product \(AB\) of two invertible matrices is also invertible, and its inverse is \(B^{-1}A^{-1}\).
Let us consider why the inverse of \(A\) is defined only for \(n\times n\) invertible matrices. If an inverse of an \(m\times n\) matrix \(A\) existed, then since both \(AB\) and \(BA\) must exist, the inverse of \(A\) would necessarily be an \(n\times m\) matrix, and it would have to satisfy
\[AB=I_m,\qquad BA=I_n\]If \(m\neq n\), such a matrix \(B\) does not exist. This follows immediately from the §Fundamental Theorem of Linear Algebra, but it can also be proved using only the language of matrices.
Definition 6 Let \(A\in\Mat_n(\mathbb{K})\). Then the trace of \(A\), denoted \(\tr(A)\), is defined as the sum of the diagonal entries of \(A\), that is, \(\tr(A)=\sum_{i=1}^n A_{ii}\).
The map \(\tr\) defined in this way is a linear map from \(\Mat_n(\mathbb{K})\) to \(\mathbb{K}\). That is, for any \(A,B\in\Mat_n(\mathbb{K})\) and \(\alpha\in\mathbb{K}\),
\[\tr(A+B)=\tr(A)+\tr(B),\qquad \tr(\alpha A)=\alpha\tr(A)\]hold.
Now suppose two matrices \(A\in\Mat_{m\times n}(\mathbb{K})\) and \(B\in\Mat_{n\times m}(\mathbb{K})\) are given. Then one can verify that
\[\tr(AB)=\sum_{i=1}^m(AB)_{ii}=\sum_{i=1}^m\sum_{j=1}^nA_{ij}B_{ji}=\sum_{j=1}^n\sum_{i=1}^m B_{ji}A_{ij}=\sum_{j=1}^n(BA)_{jj}=\tr(BA)\]Therefore, when \(\mathbb{K}\) is \(\mathbb{R}\) or \(\mathbb{C}\), if \(AB=I_m\) and \(BA=I_n\), then from the above formula
\[m=\tr(I_m)=\tr(AB)=\tr(BA)=\tr(I_n)=n\]must hold, so if \(m\neq n\), no matrix \(B\) satisfying this exists.
Definition 7 For a given matrix \(A\in\Mat_{m\times n}(\mathbb{K})\), the transpose \(A^t\) of \(A\) is the \(n\times m\) matrix defined by the formula
\[(A^t)_{ij}=A_{ji}\]Proposition 8 For two matrices \(A\in\Mat_{m\times n}(\mathbb{K}),B\in\Mat_{n\times k}(\mathbb{K})\), the formula
\[(AB)^t=B^tA^t\]holds.
Indeed, for any \(i\) and \(j\),
\[((AB)^t)_{ij}=(AB)_{ji}=\sum_{l=1}^n A_{jl}B_{li}=\sum_{l=1}^n (B^t)_{il}(A^t)_{lj}=(B^tA^t)_{ij}\]holds, so all entries of the two matrices coincide.
References
[Goc] M.S. Gockenbach, Finite-dimensional linear algebra, Discrete Mathematics and its applications, Taylor&Francis, 2011.
[Lee] 이인석, 선형대수와 군, 서울대학교 출판문화원, 2005.
-
By the above definition, the \(j\)th column of the matrix \(BA\) equals the product of the matrix \(B\) and the column vector \(A_j\); therefore, there is no risk of confusion whether one regards \(BA_j\) as the \(j\)th column of \(BA\) or as the product of \(B\) and \(A_j\). ↩
Share on
Comments
- Public repository: a deleted comment stays in the Git history.
- The password and the email are encrypted and kept in Cloudflare KV alone.
No comments yet.