向量与向量空间
本章涵盖向量的基本运算、线性相关性、向量空间的概念以及基和维数等核心知识点。
向量
向量是一个有序的数组,通常用列向量表示。$n$ 维向量是 $n$ 个数组成的序列。
向量可以表示为列向量 $\mathbf{v}$、行向量 $\mathbf{v}^T$,或在平面中用有向线段表示。
$\mathbf{v} = \begin{bmatrix} 2 \\ 3 \\ 1 \end{bmatrix}$ 是一个三维向量。
向量的加法
两个相同维数的向量 $\mathbf{u}$ 和 $\mathbf{v}$ 的和定义为对应分量的和:
交换律:$\mathbf{u} + \mathbf{v} = \mathbf{v} + \mathbf{u}$
结合律:$(\mathbf{u} + \mathbf{v}) + \mathbf{w} = \mathbf{u} + (\mathbf{v} + \mathbf{w})$
单位元:$\mathbf{v} + \mathbf{0} = \mathbf{v}$
$\begin{bmatrix} 1 \\ 2 \end{bmatrix} + \begin{bmatrix} 3 \\ 1 \end{bmatrix} = \begin{bmatrix} 4 \\ 3 \end{bmatrix}$
向量的标量乘法
向量 $\mathbf{v}$ 与标量 $c$ 的乘积是将向量的每个分量都乘以该标量:
分配律:$c(\mathbf{u} + \mathbf{v}) = c\mathbf{u} + c\mathbf{v}$
结合律:$(cd)\mathbf{v} = c(d\mathbf{v})$
单位元:$1 \cdot \mathbf{v} = \mathbf{v}$
$2\begin{bmatrix} 1 \\ 2 \\ 3 \end{bmatrix} = \begin{bmatrix} 2 \\ 4 \\ 6 \end{bmatrix}$
向量的点积
两个 $n$ 维向量 $\mathbf{u}$ 和 $\mathbf{v}$ 的点积(内积)定义为:
$\mathbf{u} \cdot \mathbf{v} = \left \| \mathbf{u} \right \| \left \| \mathbf{v} \right \| \cos\theta$,其中 $\theta$ 是两向量的夹角。
• $\mathbf{u} \cdot \mathbf{v} = 0$ ⟺ 两向量正交
• $\left \| \mathbf{v} \right \| = \sqrt{\mathbf{v} \cdot \mathbf{v}}$ 是向量的长度
$\begin{bmatrix} 1 \\ 2 \end{bmatrix} \cdot \begin{bmatrix} 3 \\ 4 \end{bmatrix} = 1 \times 3 + 2 \times 4 = 11$
向量的叉积
叉积仅定义在三维向量中,$\mathbf{u} \times \mathbf{v}$ 是与 $\mathbf{u}$ 和 $\mathbf{v}$ 都正交的向量:
$\left \| \mathbf{u} \times \mathbf{v} \right \| = \left \| \mathbf{u} \right \| \left \| \mathbf{v} \right \| \sin\theta$ 等于以 $\mathbf{u}$ 和 $\mathbf{v}$ 为邻边的平行四边形面积。
$\begin{bmatrix} 1 \\ 0 \\ 0 \end{bmatrix} \times \begin{bmatrix} 0 \\ 1 \\ 0 \end{bmatrix} = \begin{bmatrix} 0 \\ 0 \\ 1 \end{bmatrix}$
矩阵与向量的乘法
$m \times n$ 矩阵 $A$ 与 $n$ 维列向量 $\mathbf{v}$ 的乘积是 $m$ 维列向量:
$A\mathbf{v} = v_1\mathbf{a}_1 + v_2\mathbf{a}_2 + \cdots + v_n\mathbf{a}_n$,其中 $\mathbf{a}_i$ 是 $A$ 的第 $i$ 列。
$\begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} \begin{bmatrix} 2 \\ 1 \end{bmatrix} = \begin{bmatrix} 1 \times 2 + 2 \times 1 \\ 3 \times 2 + 4 \times 1 \end{bmatrix} = \begin{bmatrix} 4 \\ 10 \end{bmatrix}$
线性组合
向量 $\mathbf{v}$ 是向量组 $\{\mathbf{v}_1, \mathbf{v}_2, \ldots, \mathbf{v}_k\}$ 的线性组合,如果存在标量 $c_1, c_2, \ldots, c_k$ 使得:
判断 $\mathbf{v} = \begin{bmatrix} 5 \\ 7 \end{bmatrix}$ 是否是 $\mathbf{v}_1 = \begin{bmatrix} 1 \\ 2 \end{bmatrix}$ 和 $\mathbf{v}_2 = \begin{bmatrix} 2 \\ 1 \end{bmatrix}$ 的线性组合。
解:求 $c_1, c_2$ 使得 $c_1\begin{bmatrix} 1 \\ 2 \end{bmatrix} + c_2\begin{bmatrix} 2 \\ 1 \end{bmatrix} = \begin{bmatrix} 5 \\ 7 \end{bmatrix}$
方程组:$c_1 + 2c_2 = 5$,$2c_1 + c_2 = 7$
解得 $c_1 = 3, c_2 = 1$。因此 $\mathbf{v}$ 是线性组合。
线性相关
向量组 $\{\mathbf{v}_1, \mathbf{v}_2, \ldots, \mathbf{v}_k\}$ 线性相关,如果存在不全为零的标量 $c_1, c_2, \ldots, c_k$ 使得:
向量组线性相关 ⟺ 至少有一个向量可以表示为其他向量的线性组合。
$\mathbf{v}_1 = \begin{bmatrix} 1 \\ 2 \end{bmatrix}$,$\mathbf{v}_2 = \begin{bmatrix} 2 \\ 4 \end{bmatrix}$,$\mathbf{v}_3 = \begin{bmatrix} 1 \\ 1 \end{bmatrix}$ 线性相关,因为 $\mathbf{v}_2 = 2\mathbf{v}_1$。
线性无关
向量组 $\{\mathbf{v}_1, \mathbf{v}_2, \ldots, \mathbf{v}_k\}$ 线性无关,如果仅当所有 $c_i = 0$ 时,才有:
将向量作为矩阵的列,若秩等于向量个数,则线性无关。
或者,若这些向量对应的齐次线性方程组仅有零解,则线性无关。
$\mathbf{v}_1 = \begin{bmatrix} 1 \\ 0 \end{bmatrix}$,$\mathbf{v}_2 = \begin{bmatrix} 0 \\ 1 \end{bmatrix}$ 线性无关,因为仅当 $c_1 = c_2 = 0$ 时才能使 $c_1\mathbf{v}_1 + c_2\mathbf{v}_2 = \mathbf{0}$。
向量方程
向量方程形式为 $x_1\mathbf{v}_1 + x_2\mathbf{v}_2 + \cdots + x_n\mathbf{v}_n = \mathbf{b}$,求解这个方程等价于求解相应的线性方程组。
解向量方程 $x_1\begin{bmatrix} 1 \\ 2 \end{bmatrix} + x_2\begin{bmatrix} 2 \\ 1 \end{bmatrix} = \begin{bmatrix} 5 \\ 7 \end{bmatrix}$
解:$\begin{bmatrix} 1 & 2 \\ 2 & 1 \end{bmatrix}\begin{bmatrix} x_1 \\ x_2 \end{bmatrix} = \begin{bmatrix} 5 \\ 7 \end{bmatrix}$,解得 $x_1 = 3, x_2 = 1$。
向量空间
集合 $V$ 是一个向量空间,如果它对向量加法和标量乘法封闭,且满足以下公理:
① 加法结合律、交换律
② 存在零向量 $\mathbf{0}$
③ 每个向量 $\mathbf{v}$ 都有加法逆元 $-\mathbf{v}$
④ 标量乘法的结合律和分配律
⑤ 存在单位元 1 使 $1\mathbf{v} = \mathbf{v}$
• $\mathbb{R}^n$:所有 $n$ 维实向量
• $\mathbb{R}^{m \times n}$:所有 $m \times n$ 实矩阵
• $P_n$:次数不超过 $n$ 的多项式集合
生成空间
向量组 $\{\mathbf{v}_1, \mathbf{v}_2, \ldots, \mathbf{v}_k\}$ 的生成空间或张成是这些向量所有线性组合的集合:
$\text{Span}\{\mathbf{v}_1, \ldots, \mathbf{v}_k\}$ 本身是一个向量空间。
$\text{Span} \left \{ \begin{bmatrix} 1 \\ 0 \end{bmatrix}, \begin{bmatrix} 0 \\ 1 \end{bmatrix} \right \} = \mathbb{R}^2$
子空间
向量空间 $V$ 的非空子集 $H$ 是 $V$ 的子空间,如果 $H$ 对向量加法和标量乘法封闭:
① 若 $\mathbf{u}, \mathbf{v} \in H$,则 $\mathbf{u} + \mathbf{v} \in H$
② 若 $\mathbf{v} \in H$,$c \in \mathbb{R}$,则 $c\mathbf{v} \in H$
$H$ 是子空间 ⟺ $H$ 包含零向量且对向量加法和标量乘法封闭。
$H = \{(x, y, 0) \mid x, y \in \mathbb{R}\}$ 是 $\mathbb{R}^3$ 的子空间($xy$ 平面)。
零子空间
零子空间是只包含零向量的子空间 $\{\mathbf{0}\}$。
零子空间是任何向量空间的最小子空间。
零空间
矩阵 $A$ 的零空间是齐次方程 $A\mathbf{x} = \mathbf{0}$ 所有解的集合,记作 $\text{Nul}(A)$:
零空间是 $\mathbb{R}^n$ 的子空间。维数等于自由变量的个数。
求矩阵 $A = \begin{bmatrix} 1 & 2 \\ 0 & 0 \end{bmatrix}$ 的零空间。
解:$A\mathbf{x} = \mathbf{0}$ ⟹ $x_1 + 2x_2 = 0$ ⟹ $x_1 = -2x_2$
$\text{Nul}(A) = \left \{ \begin{bmatrix} -2t \\ t \end{bmatrix} \mid t \in \mathbb{R} \right \} = \text{Span} \left \{ \begin{bmatrix} -2 \\ 1 \end{bmatrix} \right \}$
列空间
矩阵 $A$ 的列空间是 $A$ 的所有列向量张成的空间,记作 $\text{Col}(A)$:
其中 $\mathbf{a}_i$ 是 $A$ 的第 $i$ 列。
$\mathbf{b} \in \text{Col}(A)$ ⟺ 方程 $A\mathbf{x} = \mathbf{b}$ 有解。
列空间的维数等于矩阵的秩。
行空间
矩阵 $A$ 的行空间是 $A$ 的所有行向量张成的空间,记作 $\text{Row}(A)$。
行空间的维数等于列空间的维数(都等于矩阵的秩)。
向量空间的性质
对于 $m \times n$ 矩阵 $A$:
其中 $\text{nullity}(A) = \dim(\text{Nul}(A))$ 是零空间的维数。
① $\dim(\text{Col}(A)) + \dim(\text{Nul}(A)) = \text{列数}$
② $\text{rank}(A) = \text{rank}(A^T)$
③ $\text{rank}(A) = \dim(\text{Row}(A)) = \dim(\text{Col}(A))$
基
向量空间 $V$ 的基是 $V$ 的一个线性无关的生成集。即向量组 $\{\mathbf{v}_1, \ldots, \mathbf{v}_k\}$ 是 $V$ 的基,如果:
① 它们线性无关
② 它们张成 $V$
• 每个向量空间都有基
• 基中向量个数相同(等于向量空间的维数)
• $\mathbb{R}^n$ 的标准基:$\{\mathbf{e}_1, \ldots, \mathbf{e}_n\}$,其中 $\mathbf{e}_i$ 第 $i$ 个分量为 1,其余为 0
$\mathbb{R}^2$ 的一个基是 $\left \{ \begin{bmatrix} 1 \\ 0 \end{bmatrix}, \begin{bmatrix} 0 \\ 1 \end{bmatrix} \right \}$(标准基)。
$\left \{ \begin{bmatrix} 1 \\ 1 \end{bmatrix}, \begin{bmatrix} 1 \\ 2 \end{bmatrix} \right \}$ 也是 $\mathbb{R}^2$ 的一个基。
维数
向量空间 $V$ 的维数是其任意一个基中向量的个数,记作 $\dim(V)$。
• $\dim(\mathbb{R}^n) = n$
• $\dim(\mathbb{R}^{m \times n}) = mn$(所有 $m \times n$ 矩阵)
• $\dim(P_n) = n+1$(次数不超过 $n$ 的多项式)
• $\dim(\{\mathbf{0}\}) = 0$(零子空间)
若 $A$ 是 $5 \times 8$ 矩阵,$\text{rank}(A) = 3$,则 $\dim(\text{Nul}(A)) = 8 - 3 = 5$。
坐标与坐标向量
设 $\mathcal{B} = \{\mathbf{b}_1, \ldots, \mathbf{b}_n\}$ 是向量空间 $V$ 的基,向量 $\mathbf{v} \in V$ 可唯一表示为:
其中 $P_{\mathcal{B}} = \begin{bmatrix} \mathbf{b}_1 & \mathbf{b}_2 & \cdots & \mathbf{b}_n \end{bmatrix}$,向量 $[\mathbf{v}]_{\mathcal{B}} = \begin{bmatrix} c_1 \\ \vdots \\ c_n \end{bmatrix}$ 称为 $\mathbf{v}$ 在基 $\mathcal{B}$ 下的坐标向量。
在基 $\mathcal{B} = \left \{ \begin{bmatrix} 1 \\ 1 \end{bmatrix}, \begin{bmatrix} 1 \\ 2 \end{bmatrix} \right \}$ 下,求 $\mathbf{v} = \begin{bmatrix} 3 \\ 5 \end{bmatrix}$ 的坐标向量。
解:$\begin{bmatrix} 3 \\ 5 \end{bmatrix} = c_1\begin{bmatrix} 1 \\ 1 \end{bmatrix} + c_2\begin{bmatrix} 1 \\ 2 \end{bmatrix}$
解方程组得 $c_1 = 1, c_2 = 2$,所以 $[\mathbf{v}]_{\mathcal{B}} = \begin{bmatrix} 1 \\ 2 \end{bmatrix}$。
过渡矩阵
设 $\mathcal{B} = \{\mathbf{b}_1, \ldots, \mathbf{b}_n\}$ 和 $\mathcal{C} = \{\mathbf{c}_1, \ldots, \mathbf{c}_n\}$ 是向量空间的两个基,从基 $\mathcal{B}$ 到基 $\mathcal{C}$ 的过渡矩阵 $P$ 满足:
其中 $P_{\mathcal{B}} = \begin{bmatrix} \mathbf{b}_1 & \mathbf{b}_2 & \cdots & \mathbf{b}_n \end{bmatrix}$,$P_{\mathcal{C}} = \begin{bmatrix} \mathbf{c}_1 & \mathbf{c}_2 & \cdots & \mathbf{c}_n \end{bmatrix}$。
过渡矩阵 $P$ 是可逆矩阵,$P^{-1}$ 是从基 $\mathcal{C}$ 到基 $\mathcal{B}$ 的过渡矩阵。
已知 $\mathbb{R}^2$ 的两个基:$\mathcal{B} = \left\{\begin{bmatrix} 1 \\ 0 \end{bmatrix}, \begin{bmatrix} 0 \\ 1 \end{bmatrix}\right\}$(标准基)和 $\mathcal{C} = \left\{\begin{bmatrix} 1 \\ 1 \end{bmatrix}, \begin{bmatrix} 1 \\ 2 \end{bmatrix}\right\}$。求从基 $\mathcal{B}$ 到基 $\mathcal{C}$ 的过渡矩阵。
解:$P_{\mathcal{B}} = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}$,$P_{\mathcal{C}} = \begin{bmatrix} 1 & 1 \\ 1 & 2 \end{bmatrix}$
由 $P_{\mathcal{C}} = P_{\mathcal{B}} P$ 得 $P = P_{\mathcal{B}}^{-1} P_{\mathcal{C}} = \begin{bmatrix} 1 & 1 \\ 1 & 2 \end{bmatrix}$
因此,从基 $\mathcal{B}$ 到基 $\mathcal{C}$ 的过渡矩阵为 $P = \begin{bmatrix} 1 & 1 \\ 1 & 2 \end{bmatrix}$。
坐标变换矩阵
设 $\mathcal{B} = \{\mathbf{b}_1, \ldots, \mathbf{b}_n\}$ 和 $\mathcal{C} = \{\mathbf{c}_1, \ldots, \mathbf{c}_n\}$ 是向量空间的两个基,$[\mathbf{v}]_{\mathcal{B}}$ 和 $[\mathbf{v}]_{\mathcal{C}}$ 分别是向量 $\mathbf{v}$ 在基 $\mathcal{B}$ 和 $\mathcal{C}$ 下的坐标向量,从基 $\mathcal{B}$ 到基 $\mathcal{C}$ 的坐标变换矩阵 $P_{\mathcal{C} \leftarrow \mathcal{B}}$ 满足:
$P_{\mathcal{C} \leftarrow \mathcal{B}} = P_{\mathcal{C}}^{-1} P_{\mathcal{B}} = P^{-1}$,即从 $\mathcal{B}$ 到 $\mathcal{C}$ 的坐标变换矩阵是从 $\mathcal{C}$ 到 $\mathcal{B}$ 的过渡矩阵。
已知向量 $\mathbf{v} = \begin{bmatrix} 5 \\ 7 \end{bmatrix}$ 在基 $\mathcal{B} = \left\{\begin{bmatrix} 1 \\ 0 \end{bmatrix}, \begin{bmatrix} 0 \\ 1 \end{bmatrix}\right\}$ 下的坐标向量为 $[\mathbf{v}]_{\mathcal{B}} = \begin{bmatrix} 5 \\ 7 \end{bmatrix}$。求 $\mathbf{v}$ 在基 $\mathcal{C} = \left\{\begin{bmatrix} 1 \\ 1 \end{bmatrix}, \begin{bmatrix} 1 \\ 2 \end{bmatrix}\right\}$ 下的坐标向量。
解:首先求从 $\mathcal{B}$ 到 $\mathcal{C}$ 的坐标变换矩阵。
由 $\mathcal{B}$ 到 $\mathcal{C}$ 的过渡矩阵 $P = \begin{bmatrix} 1 & 1 \\ 1 & 2 \end{bmatrix}$,故 $P^{-1} = \frac{1}{2-1}\begin{bmatrix} 2 & -1 \\ -1 & 1 \end{bmatrix} = \begin{bmatrix} 2 & -1 \\ -1 & 1 \end{bmatrix}$
所以,由 $\mathcal{B}$ 到 $\mathcal{C}$ 的坐标变换矩阵 $P_{\mathcal{C} \leftarrow \mathcal{B}} = P^{-1} = \begin{bmatrix} 2 & -1 \\ -1 & 1 \end{bmatrix}$
因此 $[\mathbf{v}]_{\mathcal{C}} = \begin{bmatrix} 2 & -1 \\ -1 & 1 \end{bmatrix}\begin{bmatrix} 5 \\ 7 \end{bmatrix} = \begin{bmatrix} 10 - 7 \\ -5 + 7 \end{bmatrix} = \begin{bmatrix} 3 \\ 2 \end{bmatrix}$