2.1 Matrix operations (矩阵运算)

本文为《Linear algebra and its applications》的读书笔记

If AA is an m×nm \times n matrix, each column of AA is a list of mm real numbers, which identifies a vector in Rm\mathbb R^m.
A=[  a1   a2   ...   an  ]A=[\ \ \boldsymbol a_1\ \ \ \boldsymbol a_2\ \ \ ...\ \ \ \boldsymbol a_n\ \ ]
2.1 Matrix operations (矩阵运算)
The diagonal entries (对角线元素) in an m×nm \times n matrix A=[aij]A = [a_{ij}] are a11a_{11}, a22a_{22}, a33a_{33}… and they form the main diagonal (主对角线) of AA. A diagonal matrix (对角矩阵) is a square n×nn \times n matrix whose nondiagonal entries are zero. An m×nm \times n matrix whose entries are all zero is a zero matrix (零矩阵) and is written as 00. The size of a zero matrix is usually clear from the context.

Sums and Scalar Multiples

The arithmetic for vectors described earlier has a natural extension to matrices.

The sum A+BA + B is the m×nm \times n matrix whose columns are the sums of the corresponding columns in AA and BB. The sum A+BA + B is defined only when AA and BB are the same size.

If rr is a scalar and AA is a matrix, then the scalar multiple rArA is the matrix whose columns are rr times the corresponding columns in AA.

Matrix Multiplication

When a matrix BB multiplies a vector x\boldsymbol x, it transforms x\boldsymbol x into the vector BxB\boldsymbol x. If this vector is then multiplied in turn by a matrix AA, the resulting vector is A(Bx)A(B\boldsymbol x). See Figure 2.
2.1 Matrix operations (矩阵运算)
Thus A(Bx)A(B\boldsymbol x) is produced from x\boldsymbol x by a compositioncomposition of mappings. Our goal is to represent this composite mapping as multiplication by a single matrix, denoted by ABAB, so that
A(Bx)=(AB)xA(B\boldsymbol x)=(AB)\boldsymbol x
2.1 Matrix operations (矩阵运算)
If AA is m×nm \times n, BB is n×pn \times p, and x\boldsymbol x is in Rp\mathbb R^p. Then
Bx=x1b1+...+xpbpB\boldsymbol x=x_1\boldsymbol b_1+...+x_p\boldsymbol b_pBy the linearity of multiplication by AA,
A(Bx)=A(x1b1)+...+A(xpbp)=x1Ab1+...+xpAbpA(B\boldsymbol x)=A(x_1\boldsymbol b_1)+...+A(x_p\boldsymbol b_p)=x_1A\boldsymbol b_1+...+x_pA\boldsymbol b_pThe vector A(Bx)A(B\boldsymbol x) is a linear combination of the vectors Ab1A\boldsymbol b_1,…,AbpA\boldsymbol b_p, using the entries in x\boldsymbol x as weights. In matrix notation, this linear combination is written as
A(Bx)=[  Ab1   Ab2   ...   Abp  ]xA(B\boldsymbol x)=[\ \ A\boldsymbol b_1\ \ \ A\boldsymbol b_2\ \ \ ...\ \ \ A\boldsymbol b_p\ \ ]\boldsymbol xThus multiplication by [  Ab1   Ab2   ...   Abp  ][\ \ A\boldsymbol b_1\ \ \ A\boldsymbol b_2\ \ \ ...\ \ \ A\boldsymbol b_p\ \ ] transforms x\boldsymbol x into A(Bx)A(B\boldsymbol x). We have found
the matrix we sought!
2.1 Matrix operations (矩阵运算)
Multiplication of matrices corresponds to composition of linear transformations.

The definition of ABAB lends itself well to parallel processing on a computer. The columns of BB are assigned individually or in groups to different processors, which independently and hence simultaneously compute the corresponding columns of ABAB.

EXAMPLE 3
Compute ABAB, where A=[2315]A =\begin{bmatrix}2&3\\1&-5\end{bmatrix} and B=[436123]B =\begin{bmatrix}4&3&6\\1&-2&3\end{bmatrix}.
SOLUTION
2.1 Matrix operations (矩阵运算)

Each column of ABAB is a linear combination of the columns of AA using weights from the corresponding column of BB. (ABAB 的每一列都是AA 的各列的线性组合,以BB 的对应列的元素为权)

Obviously, the number of columns of AA must match the number of rows in BB in order for a linear combination such as Ab1A\boldsymbol b_1 to be defined. Also, the definition of ABAB shows that ABAB has the same number of rows as AA and the same number of columnsas BB.

The definition of ABAB is important for theoretical work and applications, but the following rule provides a more efficient method for calculating the individual entries in ABAB when working small problems by hand.
2.1 Matrix operations (矩阵运算)
Let rowi(A)row_i(A) denote the ii th row of a matrix AA. Then
rowi(AB)=rowi(A)Brow_i(AB)=row_i(A)\cdot B

View vectors in Rn\mathbb R^n as n×1n \times 1 matrices. For u\boldsymbol u and v\boldsymbol v in Rn\mathbb R^n, the matrix product uTv\boldsymbol u^T \boldsymbol v is a 1×11 \times 1 matrix, called the scalar product (数量积), or inner product (内积), of u\boldsymbol u and v\boldsymbol v. It is usually written as a single real number without brackets. The matrix product uvT\boldsymbol u\boldsymbol v^T is an n×nn \times n matrix, called the outer product (外积) of u\boldsymbol u and v\boldsymbol v.

inner products (uTv\boldsymbol u^T \boldsymbol v and vTu\boldsymbol v^T \boldsymbol u) have the transpose symbol in the middle. Outer products (uvT\boldsymbol u\boldsymbol v^T and vuT\boldsymbol v\boldsymbol u^T) have the transpose symbol on the outside.

内积 uTv=vTu\boldsymbol u^T \boldsymbol v=\boldsymbol v^T \boldsymbol u
外积 uvT\boldsymbol u\boldsymbol v^TvuT\boldsymbol v\boldsymbol u^T 互为对称矩阵

EXAMPLE 4
Suppose the last column of ABAB is entirely zero but BB itself has no column of zeros. What can you say about the columns of AA?
SOLUTION
Let bp\boldsymbol b_p be the last column of BB. By hypothesis, the last column of ABAB is zero. Thus, AbpA\boldsymbol b_p = 0. However, bp\boldsymbol b_p is not the zero vector. Thus, the equation Abp=0A\boldsymbol b_p = \boldsymbol 0 is a linear dependence relation among the columns of AA, and so the columns of AA are linearly dependent.

Properties of Matrix Multiplication

Recall that ImI_m represents the m×mm \times m identity matrix and Imx=xI_m\boldsymbol x=\boldsymbol x for all x\boldsymbol x in Rm\mathbb R^m.
2.1 Matrix operations (矩阵运算)
PROOF (只证明性质(a),其他性质的证明类似)
Property (a)
Property (a) follows from the fact that matrix multiplication corresponds to composition of linear transformations (which are functions), and it is known that the composition of functions is associative(结合律).

在离散数学中,函数的复合运算 fgf\circ g 被定义为关系乘积 gfg*f,可以证明关系乘积是满足结合律的,因此函数的复合运算也满足结合律

Here is another proof of (a) that rests on the “column definition” of the product of two matrices. Let
C=[  c1   c2   ...   cp  ]C=[\ \ \boldsymbol c_1\ \ \ \boldsymbol c_2\ \ \ ...\ \ \ \boldsymbol c_p\ \ ]BC=[  Bc1   Bc2   ...   Bcp  ]BC=[\ \ B\boldsymbol c_1\ \ \ B\boldsymbol c_2\ \ \ ...\ \ \ B\boldsymbol c_p\ \ ]A(BC)=[  A(Bc1)   A(Bc2)   ...   A(Bcp)  ]A(BC)=[\ \ A(B\boldsymbol c_1)\ \ \ A(B\boldsymbol c_2)\ \ \ ...\ \ \ A(B\boldsymbol c_p)\ \ ]Recall that the definition of ABAB makes A(Bx)=(AB)xA(B\boldsymbol x)= (AB)\boldsymbol x for all x\boldsymbol x, so
A(BC)=[(AB)c1   ...   (AB)cp]=(AB)CA(BC)= [(AB)\boldsymbol c_1\ \ \ ...\ \ \ (AB)\boldsymbol c_p]=(AB)C

If AB=BAAB = BA, we say that AA and BB commute with one another.(可交换的)

WARNINGS:

  1. In general, ABBAAB \neq BA.
  2. The cancellation laws(消去律) do not hold for matrix multiplication. That is, if AB=ACAB = AC, then it is not true in general that B=CB = C.
  3. If a product ABAB is the zero matrix, you cannot conclude in general that either A=0A = 0 or B=0B = 0.

Tip: When BB is square and CC has fewer columns than AA has rows, it is more efficient to compute A(BC)A(BC) than (AB)C(AB)C .

CheckpointCheckpoint: Show that if y\boldsymbol y is a linear combination of the columns of ABAB, then y\boldsymbol y is a linear combination of the columns of AA.

Answer to CheckpointAnswer\ to\ Checkpoint: If y\boldsymbol y is a linear combination of the columns of ABAB, then there is a vector x\boldsymbol x such that y\boldsymbol y = (AB)x(AB)\boldsymbol x. By definition of matrix multiplication, y=A(Bx)\boldsymbol y = A(B\boldsymbol x). This expresses y as a linear combination of the columns of AA using the entries in the vector BxB\boldsymbol x as weights.

Powers of a Matrix

If AA is an n×nn \times n matrix and if kk is a positive integer, then
2.1 Matrix operations (矩阵运算)
If k=0k = 0; then A0xA^0\boldsymbol x should be x\boldsymbol x itself. Thus A0A^0 is interpreted as the identity matrix.

The Transpose of a Matrix

2.1 Matrix operations (矩阵运算)
PROOF
Property (d)
The (i,j)(i, j)-entry of (AB)T(AB)^T is the (j,i)(j, i)-entry of ABAB, which is
aj1b1i+...+ajnbnia_{j1}b_{1i}+...+a_{jn}b_{ni}The entries in row ii of BTB^T are b1i,...,bnib_{1i}, . . . , b_{ni}, because they come from column ii of BB. Likewise, the entries in column jj of ATA^T are aj1,,ajna_{j1}, …, a_{jn}, because they come from row jj of AA. Thus the (i,j)(i, j)-entry in BTATB^TA^T is aj1b1i+...+ajnbnia_{j1}b_{1i}+...+a_{jn}b_{ni} , as above.

The generalization of Theorem 3(d) to products of more than two factors can be stated in words as follows:
2.1 Matrix operations (矩阵运算)