Chapter 2. Matrices
第 2 章矩阵
2.1 Definition and Notation
2.1 定义和符号
Matrices are the central objects of linear algebra, providing a compact way to represent and manipulate linear transformations, systems of equations, and structured data. A matrix is a rectangular array of numbers arranged in rows and columns.
矩阵是线性代数的核心对象,它提供了一种简洁的方式来表示和操作线性变换、方程组和结构化数据。矩阵是由按行和列排列的数字组成的矩形阵列。
Formal Definition
正式定义
An matrix is an array with rows and columns, written
矩阵是具有 行和 列的数组,写为
Each entry is a scalar, located in the i-th row and j-th column. The size (or dimension) of the matrix is denoted by .
每个条目 是一个标量,位于第 i 行和第 j 列。矩阵的大小(或维度)用 表示。
-
If , the matrix is square.
如果为 ,则矩阵为方阵。
-
If , the matrix is a row vector.
如果为 ,则该矩阵为行向量。
-
If , the matrix is a column vector.
如果为 ,则矩阵为列向量。
Thus, vectors are simply special cases of matrices. 因此,向量只是矩阵的特殊情况。
Examples
示例
Example 2.1.1. A 2×3 matrix:
例 2.1.1. 2×3 矩阵:
Here, , , and the matrix has 2 rows, 3 columns.
这里, , ,矩阵有 2 行,3 列。
Example 2.1.2. A 3×3 square matrix:
例 2.1.2. 3×3 方阵:
This will later serve as the representation of a linear transformation on .
这稍后将作为 的线性变换的表示。
Indexing and Notation
索引和符号
-
Matrices are denoted by uppercase bold letters: .
矩阵用大写粗体字母表示: 。
-
Entries are written as , with the row index first, column index second.
条目写为 ,其中行索引在前,列索引在后。
-
The set of all real matrices is denoted .
所有实数 矩阵的集合表示为 。
Thus, a matrix is a function , assigning a scalar to each row-column position.
因此,矩阵是一个函数 ,为每个行列位置分配一个标量。
Why this matters
为什么这很重要
Matrices generalize vectors and give us a language for describing linear operations systematically. They encode systems of equations, rotations, projections, and transformations of data. With matrices, algebra and geometry come together: a single compact object can represent both numerical data and functional rules.
矩阵推广了向量,并为我们提供了一种系统地描述线性运算的语言。它们对方程组、旋转、投影和数据变换进行编码。矩阵将代数和几何结合在一起:一个紧凑的对象既可以表示数值数据,又可以表示函数规则。
Exercises 2.1
练习 2.1
-
Write a matrix of your choice and identify its entries .
写一个你选定的 行方阵,并确定其各元素 。
-
Is every vector a matrix? Is every matrix a vector? Explain. 每个向量都是矩阵吗?每个矩阵都是向量吗?请解释。
-
Which of the following are square matrices: , , ?
下列哪些是正方形 矩阵: , , ?
-
Let 让
What kind of matrix is this?
这是什么类型的矩阵?
- Consider the matrix
考虑矩阵
Express explicitly.
明确表示。
2.2 Matrix Addition and Multiplication
2.2 矩阵加法和乘法
Once matrices are defined, the next step is to understand how they combine. Just as vectors gain meaning through addition and scalar multiplication, matrices become powerful through two operations: addition and multiplication.
定义好矩阵后,下一步就是理解它们是如何组合的。正如向量通过加法和标量乘法获得意义一样,矩阵也通过两种运算变得强大:加法和乘法。
Matrix Addition
矩阵加法
Two matrices of the same size are added by adding corresponding entries. If
两个大小相同的矩阵可以通过添加相应的元素来相加。如果
then 则
Example 2.2.1. Let
例 2.2.1. 设
Then 则
Matrix addition is commutative () and associative (). The zero matrix, with all entries 0, acts as the additive identity.
矩阵加法满足交换律 ( ) 和结合律 ( )。零矩阵(所有元素均为 0)充当加法恒等式。
Scalar Multiplication
标量乘法
For a scalar and a matrix , we define
对于标量 和矩阵 ,我们定义
This stretches or shrinks all entries of the matrix uniformly.
这会均匀地拉伸或收缩矩阵的所有条目。
Example 2.2.2. If
例 2.2.2. 如果
then
则
Matrix Multiplication
矩阵乘法
The defining operation of matrices is multiplication. If
矩阵的定义运算是乘法。如果
then their product is the matrix
那么它们的乘积就是 矩阵
Thus, the entry in the -th row and -th column of is the dot product of the -th row of with the -th column of .
因此, 第 行、第 列的条目是 第 行与 第 列的点积。
Example 2.2.3. Let
例 2.2.3. 设
Then
则
Notice that matrix multiplication is not commutative in general: . Sometimes may not even be defined if dimensions do not align.
请注意,矩阵乘法通常不满足交换律: 。如果维度不一致,有时甚至可能无法定义 。
Geometric Meaning
几何意义
Matrix multiplication corresponds to the composition of linear transformations. If transforms vectors in and transforms vectors in , then represents applying first, then . This makes matrices the algebraic language of transformations.
矩阵乘法对应于线性变换的复合。如果 变换 中的向量, 变换 中的向量,那么 表示先应用 ,然后再应用 。这使得矩阵成为变换的代数语言。
Notation
符号
-
Matrix sum: .
矩阵和: 。
-
Scalar multiple: .
标量倍数: 。
-
Product: , defined only when the number of columns of equals the number of rows of .
乘积: ,仅当 的列数等于 的行数时才定义。
Why this matters
为什么这很重要
Matrix multiplication is the core mechanism of linear algebra: it encodes how transformations combine, how systems of equations are solved, and how data flows in modern algorithms. Addition and scalar multiplication make matrices into a vector space, while multiplication gives them an algebraic structure rich enough to model geometry, computation, and networks.
矩阵乘法是线性代数的核心机制:它编码了变换的组合方式、方程组的求解方式以及现代算法中数据流动的方式。加法和标量乘法将矩阵转化为向量空间,而乘法则赋予矩阵丰富的代数结构,使其能够对几何、计算和网络进行建模。
Exercises 2.2
练习 2.2
-
Compute for
计算
-
Find 3A where
查找 3A
-
Multiply
乘
-
Verify with an explicit example that .
通过明确的例子来验证 。
-
Prove that matrix multiplication is distributive: .
证明矩阵乘法是分配的: 。
2.3 Transpose and Inverse
2.3 转置和逆
Two special operations on matrices-the transpose and the inverse-give rise to deep algebraic and geometric properties. The transpose rearranges a matrix by flipping it across its main diagonal, while the inverse, when it exists, acts as the undo operation for matrix multiplication.
矩阵的两种特殊运算——转置和逆——引出了深刻的代数和几何性质。转置通过沿矩阵主对角线翻转来重新排列矩阵,而逆(如果存在)则充当矩阵乘法的撤消操作。
The Transpose
转置
The transpose of an matrix is the matrix , obtained by swapping rows and columns.
矩阵 的转置是通过交换行和列获得的 矩阵 。
Formally,
正式地,
Example 2.3.1. If
例 2.3.1. 如果
then
然后
Properties of the Transpose.
转置的属性。
-
.
-
.
-
, for scalar .
,对于标量 。
-
.
The last rule is crucial: the order reverses.
最后一条规则至关重要:顺序反转。
The Inverse
逆
A square matrix is said to be invertible (or nonsingular) if there exists another matrix such that
如果存在另一个矩阵 满足以下条件,则称方阵 可逆(或非奇异)
where is the identity matrix. In this case, is called the inverse of .
其中 是 单位矩阵。在这种情况下, 被称为 的逆。
Not every matrix is invertible. A necessary condition is that , a fact that will be developed in Chapter 6.
并非所有矩阵都是可逆的。必要条件是 ,我们将在第 6 章中进一步阐述。
Example 2.3.2. Let
例 2.3.2. 设
Its determinant is . The inverse is
它的行列式是 。逆是
Verification:
确认:
Geometric Meaning
几何意义
-
The transpose corresponds to reflecting a linear transformation across the diagonal. For vectors, it switches between row and column forms.
转置对应于沿对角线反映线性变换。对于向量,它在行和列形式之间切换。
-
The inverse, when it exists, corresponds to reversing a linear transformation. For example, if scales and rotates vectors, rescales and rotates them back.
如果存在逆变换,则它对应于线性变换的逆变换。例如,如果 缩放并旋转了矢量,则 会将其重新缩放并旋转回去。
Notation
符号
-
Transpose: .
转置: 。
-
Inverse: , defined only for invertible square matrices.
逆: ,仅为可逆方阵定义。
-
Identity: , acts as the multiplicative identity.
身份: ,充当乘法恒等式。
Why this matters
为什么这很重要
The transpose allows us to define symmetric and orthogonal matrices, central to geometry and numerical methods. The inverse underlies the solution of linear systems, encoding the idea of undoing a transformation. Together, these operations set the stage for determinants, eigenvalues, and orthogonalization.
转置使我们能够定义对称矩阵和正交矩阵,这是几何和数值方法的核心。逆矩阵是线性系统解的基础,它蕴含着撤销变换的思想。这些运算共同为行列式、特征值和正交化奠定了基础。
Exercises 2.3
练习 2.3
-
Compute the transpose of
计算转置
-
Verify that for
验证
-
Determine whether
确定是否
is invertible. If so, find . 可逆。如果可逆,则求 。
- Find the inverse of 求逆
and explain its geometric action on vectors in the plane.
并解释其对平面向量的几何作用。
-
Prove that if is invertible, then so is , and .
证明如果 可逆,则 和 也可逆。
2.4 Special Matrices
2.4 特殊矩阵
Certain matrices occur so frequently in theory and applications that they are given special names. Recognizing their properties allows us to simplify computations and understand the structure of linear transformations more clearly.
某些矩阵在理论和应用中出现频率很高,因此被赋予了特殊的名称。了解它们的性质可以简化计算,并更清楚地理解线性变换的结构。
The Identity Matrix
单位矩阵
The identity matrix is the matrix with ones on the diagonal and zeros elsewhere:
单位矩阵 是 矩阵,对角线上为 1,其他位置为 0:
It acts as the multiplicative identity:
它充当乘法恒等式:
Geometrically, represents the transformation that leaves every vector unchanged.
从几何学上讲, 表示保持每个向量不变的变换。
Diagonal Matrices
对角矩阵
A diagonal matrix has all off-diagonal entries zero:
对角矩阵的所有非对角元素均为零:
Multiplication by a diagonal matrix scales each coordinate independently:
与对角矩阵相乘可独立缩放每个坐标:
Example 2.4.1. Let
例 2.4.1. 设
Then
则
Permutation Matrices
置换矩阵
A permutation matrix is obtained by permuting the rows of the identity matrix. Multiplying a vector by a permutation matrix reorders its coordinates.
置换矩阵是通过对单位矩阵的行进行置换而得到的。将向量乘以置换矩阵会重新排序其坐标。
Example 2.4.2. Let 例 2.4.2. 设
Then
则
Thus, swaps the first two coordinates.
因此, 交换前两个坐标。
Permutation matrices are always invertible; their inverses are simply their transposes.
置换矩阵总是可逆的;它们的逆只是它们的转置。
Symmetric and Skew-Symmetric Matrices
对称矩阵和斜对称矩阵
A matrix is symmetric if
如果矩阵是对称的
and skew-symmetric if Symmetric matrices appear in quadratic forms and optimization, while skew-symmetric matrices describe rotations and cross products in geometry.
如果对称矩阵出现在二次形式和优化中,则为斜对称,而斜对称矩阵描述几何中的旋转和叉积。
Orthogonal Matrices
正交矩阵
A square matrix is orthogonal if
方阵 是正交的,如果
Equivalently, the rows (and columns) of form an orthonormal set. Orthogonal matrices preserve lengths and angles; they represent rotations and reflections.
等价地, 的行(和列)构成一个正交集。正交矩阵保留长度和角度;它们表示旋转和反射。
Example 2.4.3. The rotation matrix in the plane:
例2.4.3. 平面内的旋转矩阵:
is orthogonal, since
是正交的,因为
把
先求转置
现在相乘(逐项计算):
-
第一行第一列:
-
第一行第二列:
-
第二行第一列:
(同上,等于 0)
-
第二行第二列:
因此
这正符合正交矩阵的定义,所以 是正交矩阵。
Why this matters
为什么这很重要
Special matrices serve as the building blocks of linear algebra. Identity matrices define the neutral element, diagonal matrices simplify computations, permutation matrices reorder data, symmetric and orthogonal matrices describe fundamental geometric structures. Much of modern applied mathematics reduces complex problems to operations involving these simple forms.
特殊矩阵是线性代数的基石。单位矩阵定义中性元素,对角矩阵简化计算,置换矩阵重新排序数据,对称矩阵和正交矩阵描述基本几何结构。许多现代应用数学将复杂问题简化为涉及这些简单形式的运算。
Exercises 2.4
练习 2.4
-
Show that the product of two diagonal matrices is diagonal, and compute an example.
证明两个对角矩阵的乘积是对角的,并计算一个例子。
-
Find the permutation matrix that cycles into .
找到将 循环到 的置换矩阵。
-
Prove that every permutation matrix is invertible and its inverse is its transpose.
证明每个置换矩阵都是可逆的,并且它的逆是它的转置。
-
Verify that
验证
is orthogonal. What geometric transformation does it represent?
是正交的。它代表什么几何变换?
- Determine whether 判断
are symmetric, skew-symmetric, or neither.
是对称的、斜对称的,或者都不是。