格拉姆-施密特正交化过程

格拉姆-施密特过程通过依次从每个新向量中减去其在已构造向量上的投影,将子空间的任意基转化为标准正交基。

正交基: 两两正交的向量组。 标准正交基: 每个向量范数为 \(1\) 的正交基。

格拉姆-施密特过程与公式

格拉姆-施密特过程用于生成子空间的标准正交基。给定子空间 \( V \) 的基 \[ A = \{ \mathbf{v}_1, \mathbf{v}_2, \dots, \mathbf{v}_n \} \] 由下式定义的向量 \( \mathbf{y}_1, \mathbf{y}_2, \dots, \mathbf{y}_n \)

\[ \begin{aligned} \mathbf{y}_1 &= \mathbf{v}_1 \\ \mathbf{y}_2 &= \mathbf{v}_2 - \frac{\mathbf{v}_2 \cdot \mathbf{y}_1}{\mathbf{y}_1 \cdot \mathbf{y}_1}\mathbf{y}_1 \\ \mathbf{y}_3 &= \mathbf{v}_3 - \frac{\mathbf{v}_3 \cdot \mathbf{y}_1}{\mathbf{y}_1 \cdot \mathbf{y}_1}\mathbf{y}_1 - \frac{\mathbf{v}_3 \cdot \mathbf{y}_2}{\mathbf{y}_2 \cdot \mathbf{y}_2}\mathbf{y}_2 \\ &\vdots \\ \mathbf{y}_n &= \mathbf{v}_n - \sum_{i=1}^{n-1} \frac{\mathbf{v}_n \cdot \mathbf{y}_i}{\mathbf{y}_i \cdot \mathbf{y}_i}\mathbf{y}_i \end{aligned} \]

构成子空间 \( V \) 的正交基,即

\[ \operatorname{span}\{ \mathbf{v}_1, \dots, \mathbf{v}_n \} = \operatorname{span}\{ \mathbf{y}_1, \dots, \mathbf{y}_n \}. \]

然后通过将 \( Y \) 中每个向量除以其范数得到标准正交基 \( Y_O \):

\[ Y_O = \left\{ \frac{\mathbf{y}_1}{\|\mathbf{y}_1\|}, \frac{\mathbf{y}_2}{\|\mathbf{y}_2\|}, \dots, \frac{\mathbf{y}_n}{\|\mathbf{y}_n\|} \right\}. \]

关键思想。 每一步从 \( \mathbf{v}_k \) 中减去其在所有已构造正交向量 \( \mathbf{y}_1, \dots, \mathbf{y}_{k-1} \) 上的投影。结果与它们全部正交。

示例与解答

例 1 — 二维子空间的标准正交基

子空间 \( V \) 由 \( \operatorname{span}\{\mathbf{v}_1, \mathbf{v}_2\} \) 定义,其中

\[ \mathbf{v}_1 = \begin{bmatrix} 1 \\ 2 \\ 0 \end{bmatrix}, \qquad \mathbf{v}_2 = \begin{bmatrix} -2 \\ -4 \\ -4 \end{bmatrix}. \]

使用格拉姆-施密特过程求 \( V \) 的标准正交基 \( Y_O \)。

查看例 1 的解答

设 \( Y = \{ \mathbf{y}_1, \mathbf{y}_2 \} \) 为待构造的正交基。

步骤 1。 令 \( \mathbf{y}_1 = \mathbf{v}_1 \):

\[ \mathbf{y}_1 = \begin{bmatrix} 1 \\ 2 \\ 0 \end{bmatrix}. \]

步骤 2。 计算 \( \mathbf{y}_2 = \mathbf{v}_2 - \dfrac{\mathbf{v}_2 \cdot \mathbf{y}_1}{\mathbf{y}_1 \cdot \mathbf{y}_1}\mathbf{y}_1 \)(见上述公式)。

\[ \frac{\mathbf{v}_2 \cdot \mathbf{y}_1}{\mathbf{y}_1 \cdot \mathbf{y}_1} = \frac{(-2)(1) + (-4)(2) + (-4)(0)}{1^2 + 2^2 + 0^2} = \frac{-10}{5} = -2. \]

\[ \mathbf{y}_2 = \begin{bmatrix} -2 \\ -4 \\ -4 \end{bmatrix} - (-2)\begin{bmatrix} 1 \\ 2 \\ 0 \end{bmatrix} = \begin{bmatrix} 0 \\ 0 \\ -4 \end{bmatrix}. \]

因此 \( Y = \left\{ \begin{bmatrix} 1 \\ 2 \\ 0 \end{bmatrix}, \begin{bmatrix} 0 \\ 0 \\ -4 \end{bmatrix} \right\} \)。

步骤 3。 归一化每个向量:\( \|\mathbf{y}_1\| = \sqrt{5} \),\( \|\mathbf{y}_2\| = 4 \),所以

\[ Y_O = \left\{ \frac{1}{\sqrt{5}}\begin{bmatrix} 1 \\ 2 \\ 0 \end{bmatrix}, \frac{1}{4}\begin{bmatrix} 0 \\ 0 \\ -4 \end{bmatrix} \right\}. \]

验证。 \(\mathbf{y}_1 \cdot \mathbf{y}_2 = 1(0) + 2(0) + 0(-4) = 0\),所以两个向量正交。归一化后都是单位向量。因此 \(Y_O\) 是 \(V\) 的标准正交基。

例 2 — \( \mathbb{R}^5 \) 中四维子空间的标准正交基

子空间 \( V \) 由 \( \operatorname{span}\{\mathbf{v}_1, \mathbf{v}_2, \mathbf{v}_3, \mathbf{v}_4\} \) 定义,其中

\[ \mathbf{v}_1 = \begin{bmatrix} -1 \\ -1 \\ 2 \\ 2 \\ 3 \end{bmatrix}, \quad \mathbf{v}_2 = \begin{bmatrix} 1 \\ 1 \\ 1 \\ 1 \\ 0 \end{bmatrix}, \quad \mathbf{v}_3 = \begin{bmatrix} 0 \\ 0 \\ -1 \\ -1 \\ 0 \end{bmatrix}, \quad \mathbf{v}_4 = \begin{bmatrix} 0 \\ 0 \\ 0 \\ 1 \\ 1 \end{bmatrix}. \]

使用格拉姆-施密特过程求 \( V \) 的标准正交基 \( Y_O \)。

查看例 2 的解答

设 \( Y = \{ \mathbf{y}_1, \mathbf{y}_2, \mathbf{y}_3, \mathbf{y}_4 \} \) 为正交基。

步骤 1。 \( \mathbf{y}_1 = \mathbf{v}_1 = \begin{bmatrix} -1 \\ -1 \\ 2 \\ 2 \\ 3 \end{bmatrix} \)。

步骤 2。 由 \( \mathbf{v}_2 \) 计算 \( \mathbf{y}_2 \)(见上述公式):

\[ \frac{\mathbf{v}_2 \cdot \mathbf{y}_1}{\mathbf{y}_1 \cdot \mathbf{y}_1} = \frac{(1)(-1) + (1)(-1) + (1)(2) + (1)(2) + 0}{1 + 1 + 4 + 4 + 9} = \frac{2}{19}. \]

\[ \mathbf{y}_2 = \begin{bmatrix} 1 \\ 1 \\ 1 \\ 1 \\ 0 \end{bmatrix} - \frac{2}{19}\begin{bmatrix} -1 \\ -1 \\ 2 \\ 2 \\ 3 \end{bmatrix} = \begin{bmatrix} 21/19 \\ 21/19 \\ 15/19 \\ 15/19 \\ -6/19 \end{bmatrix}. \]

乘以非零标量不改变正交性,所以选择 \( \mathbf{y}_2' = \tfrac{19}{3}\mathbf{y}_2 = \begin{bmatrix} 7 \\ 7 \\ 5 \\ 5 \\ -2 \end{bmatrix} \)。

步骤 3。 由 \( \mathbf{v}_3 \) 计算 \( \mathbf{y}_3 \),使用 \( \mathbf{y}_1 \) 和 \( \mathbf{y}_2' \)(见上述公式):

\[ \frac{\mathbf{v}_3 \cdot \mathbf{y}_1}{\mathbf{y}_1 \cdot \mathbf{y}_1} = \frac{-4}{19}, \qquad \frac{\mathbf{v}_3 \cdot \mathbf{y}_2'}{\mathbf{y}_2' \cdot \mathbf{y}_2'} = \frac{-10}{152}. \]

\[ \mathbf{y}_3 = \begin{bmatrix} 0 \\ 0 \\ -1 \\ -1 \\ 0 \end{bmatrix} - \frac{-4}{19}\begin{bmatrix} -1 \\ -1 \\ 2 \\ 2 \\ 3 \end{bmatrix} - \frac{-10}{152}\begin{bmatrix} 7 \\ 7 \\ 5 \\ 5 \\ -2 \end{bmatrix} = \begin{bmatrix} 1/4 \\ 1/4 \\ -1/4 \\ -1/4 \\ 1/2 \end{bmatrix}. \]

选择 \( \mathbf{y}_3' = 4\mathbf{y}_3 = \begin{bmatrix} 1 \\ 1 \\ -1 \\ -1 \\ 2 \end{bmatrix} \)。

步骤 4。 由 \( \mathbf{v}_4 \) 计算 \( \mathbf{y}_4 \)(见上述公式):

\[ \frac{\mathbf{v}_4 \cdot \mathbf{y}_1}{\mathbf{y}_1 \cdot \mathbf{y}_1} = \frac{5}{19}, \qquad \frac{\mathbf{v}_4 \cdot \mathbf{y}_2'}{\mathbf{y}_2' \cdot \mathbf{y}_2'} = \frac{3}{152}, \qquad \frac{\mathbf{v}_4 \cdot \mathbf{y}_3'}{\mathbf{y}_3' \cdot \mathbf{y}_3'} = \frac{1}{8}. \]

\[ \mathbf{y}_4 = \begin{bmatrix} 0 \\ 0 \\ 0 \\ 1 \\ 1 \end{bmatrix} - \frac{5}{19}\begin{bmatrix} -1 \\ -1 \\ 2 \\ 2 \\ 3 \end{bmatrix} - \frac{3}{152}\begin{bmatrix} 7 \\ 7 \\ 5 \\ 5 \\ -2 \end{bmatrix} - \frac{1}{8}\begin{bmatrix} 1 \\ 1 \\ -1 \\ -1 \\ 2 \end{bmatrix} = \begin{bmatrix} 0 \\ 0 \\ -1/2 \\ 1/2 \\ 0 \end{bmatrix}. \]

选择 \( \mathbf{y}_4' = 2\mathbf{y}_4 = \begin{bmatrix} 0 \\ 0 \\ -1 \\ 1 \\ 0 \end{bmatrix} \)。

正交基:

\[ Y = \left\{ \begin{bmatrix} -1 \\ -1 \\ 2 \\ 2 \\ 3 \end{bmatrix}, \begin{bmatrix} 7 \\ 7 \\ 5 \\ 5 \\ -2 \end{bmatrix}, \begin{bmatrix} 1 \\ 1 \\ -1 \\ -1 \\ 2 \end{bmatrix}, \begin{bmatrix} 0 \\ 0 \\ -1 \\ 1 \\ 0 \end{bmatrix} \right\}. \]

标准正交基:

\[ Y_O = \left\{ \frac{1}{\sqrt{19}}\begin{bmatrix} -1 \\ -1 \\ 2 \\ 2 \\ 3 \end{bmatrix}, \frac{1}{2\sqrt{38}}\begin{bmatrix} 7 \\ 7 \\ 5 \\ 5 \\ -2 \end{bmatrix}, \frac{1}{2\sqrt{2}}\begin{bmatrix} 1 \\ 1 \\ -1 \\ -1 \\ 2 \end{bmatrix}, \frac{1}{\sqrt{2}}\begin{bmatrix} 0 \\ 0 \\ -1 \\ 1 \\ 0 \end{bmatrix} \right\}. \]

为什么 \(Y\) 张成与 \(V\) 相同的子空间。 向量 \(\mathbf{y}_1, \mathbf{y}_2', \mathbf{y}_3', \mathbf{y}_4'\) 是 \(\mathbf{v}_1, \mathbf{v}_2, \mathbf{v}_3, \mathbf{v}_4\) 的线性组合: \[ \begin{aligned} \mathbf{y}_1 &= \mathbf{v}_1, \\ \mathbf{y}_2' &= -\tfrac{2}{3}\mathbf{v}_1 + \tfrac{19}{3}\mathbf{v}_2, \\ \mathbf{y}_3' &= \tfrac{2}{3}\mathbf{v}_1 + \tfrac{5}{3}\mathbf{v}_2 + 4\mathbf{v}_3, \\ \mathbf{y}_4' &= -\tfrac{2}{3}\mathbf{v}_1 - \tfrac{2}{3}\mathbf{v}_2 - \mathbf{v}_3 + 2\mathbf{v}_4. \end{aligned} \] 因此 \( \operatorname{span}\{V\} = \operatorname{span}\{Y\} \)。

更多参考与链接

  1. 向量空间 – 问题与解答
  2. 标准正交基
  3. Linear Algebra and its Applications – 5th Edition – David C. Lay, Steven R. Lay, Judi J. McDonald
  4. Elementary Linear Algebra – 7th Edition – Howard Anton and Chris Rorres
  5. Introduction to Linear Algebra – Fifth Edition (2016) – Gilbert Strang
  6. Linear Algebra Done Right – Third Edition (2015) – Sheldon Axler
  7. Linear Algebra with Applications (2012) – Gareth Williams