第 25 章

对称矩阵与正定性:谱定理和三个等价判据

对称矩阵的特征值必为实数、特征向量可正交,因此 A = QΛQᵀ;正定矩阵进一步要求特征值、主元、全部顺序主子式都为正。

Symmetric Matrices and Positive Definiteness: The Spectral Theorem and Three Tests

A symmetric matrix has real eigenvalues and can be orthogonally diagonalized, so A = QΛQᵀ; positive definiteness further requires positive eigenvalues, pivots, and every leading minor.

首发于 2019.09.25中 / EN
系统课程linear-algebrasymmetric-matricespositive-definitespectral-theorem
语言
字号
目录
篇内目录

为什么对称矩阵最重要

对称矩阵满足

A=ATA=A^T

它有两个核心性质:

  1. 特征值全是实数;
  2. 特征向量可以选成两两正交。

严格地说,第二条应表述为「可以选成」。若特征值互不相同,每个特征空间是一维,这些直线自动正交;若特征值重复,对应的特征空间是一个平面或更高维子空间,在这个子空间内可以挑出一组正交基。单位矩阵是极端例子:每个向量都是特征向量,但依然可以选出标准正交基。

谱定理

把正交特征向量单位化,得到标准正交组 q1,…,qnq_1,\dots,q_n,放进矩阵

Q=[q1⋯qn]Q=\begin{bmatrix}q_1&\cdots&q_n\end{bmatrix}

则 QTQ=IQ^TQ=I,即 Q−1=QTQ^{-1}=Q^T。于是对角化写成

A=QΛQTA=Q\Lambda Q^T

这就是谱定理(在力学中称主轴定理)。它说明:任何对称矩阵都可以通过一次正交换基变成对角形,且换基矩阵的逆就是它的转置。

按投影矩阵展开

把 A=QΛQTA=Q\Lambda Q^T 按列乘行展开:

A=λ1q1q1T+λ2q2q2T+⋯+λnqnqnTA=\lambda_1q_1q_1^T+\lambda_2q_2q_2^T+\cdots+\lambda_nq_nq_n^T

每一项 qiqiTq_iq_i^T 都是投影到 qiq_i 方向的投影矩阵(因为 qiq_i 是单位向量)。所以:

一句话总结: 对称矩阵是若干个互相垂直的投影矩阵按特征值加权的和。

时间轴

时间内容
0:00对称矩阵的主题:特征值为实数,特征向量两两正交
1:21反例:旋转矩阵的特征值可以是复数
2:36单位矩阵是极端情形,每个向量都是特征向量
5:45特征向量矩阵可正交化,ST=S−1S^{\mathsf T}=S^{-1}
7:42谱分解 A=SΛS−1=QΛQTA=S\Lambda S^{-1}=Q\Lambda Q^{\mathsf T}
9:00证明对称矩阵的特征值必为实数
17:11复特征向量的长度与内积 xˉTx\bar x^{\mathsf T}x
23:15结论:对称矩阵总可以被正交矩阵对角化
25:23谱定理的秩一形式 A=∑iλiqiqiTA=\sum_i\lambda_i q_iq_i^{\mathsf T}
29:07正定性的第一个判据:所有主元为正
35:31正定矩阵的定义与例子
37:21二阶情形:左上元为正且行列式为正
38:02主元之积等于行列式
40:40顺序主子式全为正(Sylvester 判据)
42:50半正定:特征值可以等于零

为什么特征值是实数

设 Ax=λxAx=\lambda x,暂时允许 λ\lambda 与 xx 是复数。两边取共轭:

Axˉ=λˉxˉA\bar x=\bar\lambda\bar x

(这里 AA 是实矩阵,所以 Aˉ=A\bar A=A。)再转置:

xˉTAT=λˉxˉT\bar x^T A^T=\bar\lambda\bar x^T

利用对称性 AT=AA^T=A:

xˉTA=λˉxˉT\bar x^T A=\bar\lambda\bar x^T

两边右乘 xx:

xˉTAx=λˉxˉTx\bar x^TAx=\bar\lambda\bar x^Tx

另一方面,把原方程两边左乘 xˉT\bar x^T:

xˉTAx=λxˉTx\bar x^TAx=\lambda\bar x^Tx

两式左边相同,所以右边相等:

(λ−λˉ)xˉTx=0(\lambda-\bar\lambda)\bar x^Tx=0

关键一步:对于非零的复向量,

xˉTx=∣x1∣2+∣x2∣2+⋯+∣xn∣2>0\bar x^Tx=|x_1|^2+|x_2|^2+\cdots+|x_n|^2>0

因此只能有 λ=λˉ\lambda=\bar\lambda,即 λ\lambda 是实数。

复矩阵的正确推广

若 AA 是复矩阵,转置时还必须取共轭。定义 Hermitian 转置

AH=AˉTA^H=\bar A^T

「好矩阵」的条件变成 AH=AA^H=A(Hermitian 矩阵),此时同样有实特征值与正交特征向量。实对称矩阵只是它在实数域的特例。

主元与特征值的符号一致

这是对称矩阵独有的性质:正主元的个数等于正特征值的个数。

它不意味着主元等于特征值。例如二阶矩阵的主元是 aa 与 det⁡A/a\det A/a,而特征值是二次方程的根,通常是无理数。

这条性质的实际价值在于:求 50 阶矩阵的 50 个特征值在数值上既慢又不稳定,而消元求主元又快又稳。知道符号分布后,还可以把矩阵平移 7I7I,再数一次主元,从而知道有多少特征值大于 7、多少小于 7。

主元乘积等于特征值乘积,因为两者都等于行列式。

正定矩阵

定义

正定矩阵是对称矩阵,且所有特征值都为正:

λi>0对所有 i\lambda_i>0 \quad \text{对所有 } i

三个等价判据

判据内容
特征值全部 λi>0\lambda_i>0
主元全部主元 >0>0
顺序主子式从左上角开始的每个 k×kk\times k 行列式都 >0>0

第三条中的「全部」不能省。只检查最大的行列式是不够的。

反例

[−100−3]\begin{bmatrix}-1&0\\0&-3\end{bmatrix}

行列式为 3>03>0,但特征值是 −1,−3-1,-3,主元也是负的。它不满足正定性。问题出在一阶顺序主子式 −1<0-1<0。

正例

A=[5332]A=\begin{bmatrix}5&3\\3&2\end{bmatrix}

主元:

  • 第一个主元是 55;
  • 第二个主元由「主元乘积等于行列式」得到:det⁡A=10−9=1\det A=10-9=1,所以第二个主元是 1/51/5。

两个主元都为正,因此特征值都为正。验证:

det⁡(A−λI)=λ2−7λ+1\det(A-\lambda I)=\lambda^2-7\lambda+1

特征值为

λ=7±452\lambda=\frac{7\pm\sqrt{45}}{2}

两个都是正数。

补充: 正定矩阵在微分方程与优化中对应「能量函数向上弯曲」的情形:二次型 xTAxx^TAx 对所有非零 xx 为正,因此平衡点是稳定的极小点。

三条主线的汇合

这一讲把课程前中后三段连起来:

  • 第一周:消元与主元;
  • 中段:行列式与顺序主子式;
  • 当前:特征值与符号。

对对称矩阵,这三组信息是等价的:主元全正   ⟺  \iff 所有顺序主子式为正   ⟺  \iff 所有特征值为正。

核心回顾

  • 对称矩阵:实特征值,可正交对角化,A=QΛQTA=Q\Lambda Q^T。
  • 谱定理的另一形式:A=∑λiqiqiTA=\sum\lambda_iq_iq_i^T,即投影矩阵的加权和。
  • 实对称矩阵特征值为实的证明,核心是 xˉTx>0\bar x^Tx>0。
  • 复矩阵的对应概念是 Hermitian 矩阵与酉矩阵。
  • 对称矩阵中,正主元个数等于正特征值个数。
  • 正定   ⟺  \iff 特征值全正   ⟺  \iff 主元全正   ⟺  \iff 全部顺序主子式为正。

常见误区

  1. 以为特征向量「天然」正交。正确说法是「可以选成」正交,重复特征值时要主动选。
  2. 把 A=QΛQTA=Q\Lambda Q^T 写成 QTΛQQ^T\Lambda Q。顺序与 A=SΛS−1A=S\Lambda S^{-1} 一致。
  3. 用行列式为正判断正定。必须检查全部顺序主子式。
  4. 认为主元等于特征值。只有符号个数相同。
  5. 在复数情形仍用转置而不是 Hermitian 转置。

理解检验

1. 为什么对称矩阵的复特征值不可能出现?

参考答案:设 Ax=λxAx=\lambda x,x≠0x\ne0,先允许 λ\lambda 与 xx 取复数。由 A=ATA=A^T 且 AA 实,得 Axˉ=λˉxˉA\bar x=\bar\lambda\bar x,转置后利用 AT=AA^T=A 得到 xˉTA=λˉxˉT\bar x^TA=\bar\lambda\bar x^T。右乘 xx 得 xˉTAx=λˉ xˉTx\bar x^TAx=\bar\lambda\,\bar x^Tx;另一方面原方程左乘 xˉT\bar x^T 得 xˉTAx=λ xˉTx\bar x^TAx=\lambda\,\bar x^Tx。两式相减:(λ−λˉ)xˉTx=0(\lambda-\bar\lambda)\bar x^Tx=0。而非零复向量满足 xˉTx=∑∣xi∣2>0\bar x^Tx=\sum|x_i|^2>0,所以必须 λ=λˉ\lambda=\bar\lambda,即 λ\lambda 为实数。关键在于 xˉTx\bar x^Tx 恒正,这与实向量情形下 xTx=∥x∥2>0x^Tx=\|x\|^2>0 是同一个事实。

2. 写出 A=[2225]A=\begin{bmatrix}2&2\\2&5\end{bmatrix} 的主元,并判断是否正定。

参考答案:第一个主元是 22。det⁡A=2⋅5−2⋅2=6\det A=2\cdot5-2\cdot2=6,由「主元乘积等于行列式」得第二个主元 6/2=36/2=3。两个主元 2,32,3 都为正,因此 AA 正定。也可以直接验证顺序主子式:一阶为 2>02>0,二阶为 6>06>0。特征值可由 λ2−7λ+6=0\lambda^2-7\lambda+6=0 求得为 11 与 66,都为正,与判据一致。

3. 谱定理的投影矩阵形式中,每一项的系数是什么?

参考答案:系数是相应的特征值。A=QΛQT=∑iλiqiqiTA=Q\Lambda Q^T=\sum_i\lambda_iq_iq_i^T,其中 qiqiTq_iq_i^T 是投影到单位特征向量 qiq_i 方向的投影矩阵(秩 1、对称、幂等),它的系数正是与之配对的 λi\lambda_i。所以对称矩阵等于「一组互相正交的投影矩阵按特征值加权求和」。

4. 一个 3×33\times3 对称矩阵的主元是 2,−1,42,-1,4,它有几个正特征值?

参考答案:两个。对称矩阵中正主元的个数等于正特征值的个数,这里正主元是 22 和 44,所以恰有两个正特征值、一个负特征值。注意只能确定符号的个数,不能断言特征值等于 2,−1,42,-1,4;只有乘积关系 λ1λ2λ3=2⋅(−1)⋅4=−8\lambda_1\lambda_2\lambda_3=2\cdot(-1)\cdot4=-8 成立。

5. 举一个行列式为正但不是正定的矩阵。

参考答案:A=[−100−3]A=\begin{bmatrix}-1&0\\0&-3\end{bmatrix}。det⁡A=3>0\det A=3>0,但特征值为 −1-1 和 −3-3,都小于零,所以不正定。问题出在一阶顺序主子式 −1<0-1<0——正定要求全部顺序主子式为正,只检查最大的行列式会误判。另例:[−2−1−1−2]\begin{bmatrix}-2&-1\\-1&-2\end{bmatrix} 的行列式为 3>03>0,特征值为 −1,−3-1,-3,同样不正定。

与前后课程的关系

上一讲用 Markov 矩阵展示了「特殊矩阵给出特殊特征值」。这一讲把对称矩阵的结论系统化,并引出正定性。下一讲处理复数:Hermitian 矩阵、酉矩阵与傅里叶矩阵,其中傅里叶矩阵的快速分解(FFT)会把「矩阵分解」推向计算效率。

Why symmetric matrices matter most

A symmetric matrix satisfies

A=ATA=A^T

Two facts follow:

  1. All eigenvalues are real.
  2. Eigenvectors can be chosen mutually orthogonal.

Strictly, the second should read "can be chosen". With distinct eigenvalues each eigenspace is a line, and those lines are automatically perpendicular. With a repeated eigenvalue the eigenspace is a plane or larger, and an orthogonal basis can be selected inside it. The identity is the extreme case: every vector is an eigenvector, yet an orthonormal basis still exists.

The spectral theorem

Normalize the orthogonal eigenvectors to unit length and put them in

Q=[q1⋯qn]Q=\begin{bmatrix}q_1&\cdots&q_n\end{bmatrix}

Then QTQ=IQ^TQ=I, so Q−1=QTQ^{-1}=Q^T, and diagonalization becomes

A=QΛQTA=Q\Lambda Q^T

This is the spectral theorem (the principal axis theorem in mechanics). Any symmetric matrix becomes diagonal under a change of basis by an orthogonal matrix, whose inverse is its transpose.

Expansion into projections

Multiply out A=QΛQTA=Q\Lambda Q^T by columns times rows:

A=λ1q1q1T+λ2q2q2T+⋯+λnqnqnTA=\lambda_1q_1q_1^T+\lambda_2q_2q_2^T+\cdots+\lambda_nq_nq_n^T

Each qiqiTq_iq_i^T is the projection onto the line through qiq_i, since qiq_i is a unit vector. Therefore:

One-sentence summary: A symmetric matrix is a weighted sum of mutually perpendicular projection matrices, with the eigenvalues as weights.

Timeline

TimeTopic
0:00The theme: symmetric matrices have real eigenvalues and orthogonal eigenvectors
1:21A counterexample: rotation matrices can have complex eigenvalues
2:36The identity is the extreme case where every vector is an eigenvector
5:45Eigenvectors can be chosen orthonormal, so ST=S−1S^{\mathsf T}=S^{-1}
7:42Spectral decomposition A=SΛS−1=QΛQTA=S\Lambda S^{-1}=Q\Lambda Q^{\mathsf T}
9:00Proving that eigenvalues of a symmetric matrix are real
17:11Length and inner product for complex eigenvectors
23:15Conclusion: every symmetric matrix is orthogonally diagonalizable
25:23The rank-one form of the spectral theorem
29:07First test for positive definiteness: all pivots positive
35:31Definition of a positive definite matrix, with examples
37:21The 2 by 2 case: leading entry and determinant both positive
38:02The product of the pivots equals the determinant
40:40All leading principal minors positive
42:50Positive semidefinite: eigenvalues allowed to be zero

Why the eigenvalues are real

Let Ax=λxAx=\lambda x, temporarily allowing λ\lambda and xx to be complex. Conjugate both sides:

Axˉ=λˉxˉA\bar x=\bar\lambda\bar x

(Here AA is real, so Aˉ=A\bar A=A.) Transpose:

xˉTAT=λˉxˉT\bar x^T A^T=\bar\lambda\bar x^T

Using symmetry AT=AA^T=A:

xˉTA=λˉxˉT\bar x^T A=\bar\lambda\bar x^T

Multiply on the right by xx:

xˉTAx=λˉxˉTx\bar x^TAx=\bar\lambda\bar x^Tx

On the other hand, multiply the original equation on the left by xˉT\bar x^T:

xˉTAx=λxˉTx\bar x^TAx=\lambda\bar x^Tx

The left sides agree, so the right sides do too:

(λ−λˉ)xˉTx=0(\lambda-\bar\lambda)\bar x^Tx=0

The key step: for a nonzero complex vector,

xˉTx=∣x1∣2+∣x2∣2+⋯+∣xn∣2>0\bar x^Tx=|x_1|^2+|x_2|^2+\cdots+|x_n|^2>0

Hence λ=λˉ\lambda=\bar\lambda, which means λ\lambda is real.

The complex generalization

For a complex matrix, transposition must be paired with conjugation. Define the Hermitian transpose

AH=AˉTA^H=\bar A^T

The "good matrix" condition becomes AH=AA^H=A (a Hermitian matrix), which again gives real eigenvalues and orthogonal eigenvectors. Real symmetric matrices are the special case over the reals.

Pivots and eigenvalues have the same signs

This is special to symmetric matrices: the number of positive pivots equals the number of positive eigenvalues.

It does not say pivots equal eigenvalues. For a 2×22\times2 matrix the pivots are aa and det⁡A/a\det A/a, while the eigenvalues are roots of a quadratic and usually irrational.

The practical value: finding fifty eigenvalues of a 50×5050\times50 matrix numerically is slow and unstable, while elimination for pivots is fast and stable. Knowing the sign counts, you can also shift by 7I7I, count pivots again, and learn how many eigenvalues lie above and below 7.

The pivot product equals the eigenvalue product because both equal the determinant.

Positive definite matrices

Definition

A positive definite matrix is symmetric with all eigenvalues positive:

λi>0for all i\lambda_i>0 \quad \text{for all } i

Three equivalent tests

TestStatement
EigenvaluesEvery λi>0\lambda_i>0
PivotsEvery pivot is >0>0
Leading minorsEvery k×kk\times k determinant from the top-left corner is >0>0

The word "every" in the third test cannot be dropped. Checking only the full determinant is not enough.

A counterexample

[−100−3]\begin{bmatrix}-1&0\\0&-3\end{bmatrix}

Its determinant is 3>03>0, but its eigenvalues are −1,−3-1,-3 and its pivots are negative. It is not positive definite. The failure is visible in the first leading minor, −1<0-1<0.

A positive example

A=[5332]A=\begin{bmatrix}5&3\\3&2\end{bmatrix}

The pivots:

  • the first pivot is 55;
  • the second follows from "pivot product equals determinant": det⁡A=10−9=1\det A=10-9=1, so the second pivot is 1/51/5.

Both pivots are positive, so both eigenvalues are positive. Check:

det⁡(A−λI)=λ2−7λ+1\det(A-\lambda I)=\lambda^2-7\lambda+1

so

λ=7±452\lambda=\frac{7\pm\sqrt{45}}{2}

and both are positive.

Background: In differential equations and optimization, positive definiteness corresponds to an energy function that curves upward: the quadratic form xTAxx^TAx is positive for every nonzero xx, so the equilibrium is a stable minimum.

Where three threads meet

This lecture ties together the course's three stages:

  • Week one: elimination and pivots;
  • Middle: determinants and leading minors;
  • Now: eigenvalues and signs.

For symmetric matrices these three descriptions are equivalent: all pivots positive   ⟺  \iff all leading minors positive   ⟺  \iff all eigenvalues positive.

Core review

  • Symmetric matrices have real eigenvalues and orthogonal eigenvectors, giving A=QΛQTA=Q\Lambda Q^T.
  • The spectral theorem also reads A=∑λiqiqiTA=\sum\lambda_iq_iq_i^T, a weighted sum of projections.
  • The proof of real eigenvalues rests on xˉTx>0\bar x^Tx>0.
  • The complex analogues are Hermitian matrices and unitary matrices.
  • For symmetric matrices, positive pivot count equals positive eigenvalue count.
  • Positive definite   ⟺  \iff positive eigenvalues   ⟺  \iff positive pivots   ⟺  \iff all leading minors positive.

Common misconceptions

  1. Thinking eigenvectors are automatically orthogonal. They can be chosen orthogonal; repeats require a choice.
  2. Writing A=QTΛQA=Q^T\Lambda Q. The order matches A=SΛS−1A=S\Lambda S^{-1}.
  3. Using a positive determinant to conclude positive definiteness. Every leading minor must be checked.
  4. Equating pivots with eigenvalues. Only the sign counts match.
  5. Using the plain transpose instead of the Hermitian transpose in the complex case.

Check your understanding

1. Why can a symmetric matrix not have a genuinely complex eigenvalue?

Reference answer: Let Ax=λxAx=\lambda x with x≠0x\ne0, allowing complex λ\lambda and xx. Since A=ATA=A^T and AA is real, Axˉ=λˉxˉA\bar x=\bar\lambda\bar x; transposing and using AT=AA^T=A gives xˉTA=λˉxˉT\bar x^TA=\bar\lambda\bar x^T. Right-multiplying by xx yields xˉTAx=λˉ xˉTx\bar x^TAx=\bar\lambda\,\bar x^Tx. Left-multiplying the original equation by xˉT\bar x^T yields xˉTAx=λ xˉTx\bar x^TAx=\lambda\,\bar x^Tx. Subtracting, (λ−λˉ)xˉTx=0(\lambda-\bar\lambda)\bar x^Tx=0. But for a nonzero complex vector xˉTx=∑∣xi∣2>0\bar x^Tx=\sum|x_i|^2>0, so λ=λˉ\lambda=\bar\lambda and λ\lambda is real. The decisive point is that xˉTx\bar x^Tx is strictly positive, the complex analogue of ∥x∥2>0\|x\|^2>0.

2. Find the pivots of A=[2225]A=\begin{bmatrix}2&2\\2&5\end{bmatrix} and decide whether it is positive definite.

Reference answer: The first pivot is 22. Since det⁡A=2⋅5−2⋅2=6\det A=2\cdot5-2\cdot2=6 and the product of pivots equals the determinant, the second pivot is 6/2=36/2=3. Both pivots are positive, so AA is positive definite. The leading principal minors confirm it: 2>02>0 and 6>06>0. The eigenvalues solve λ2−7λ+6=0\lambda^2-7\lambda+6=0, giving 11 and 66, both positive.

3. In the projection form of the spectral theorem, what is the coefficient of each projection?

Reference answer: The corresponding eigenvalue. A=QΛQT=∑iλiqiqiTA=Q\Lambda Q^T=\sum_i\lambda_iq_iq_i^T, where qiqiTq_iq_i^T is the rank-one orthogonal projection onto the unit eigenvector qiq_i; its coefficient is exactly the eigenvalue λi\lambda_i paired with it. A symmetric matrix is therefore a weighted sum of mutually orthogonal projections.

4. A 3×33\times3 symmetric matrix has pivots 2,−1,42,-1,4. How many positive eigenvalues does it have?

Reference answer: Two. For a symmetric matrix the number of positive pivots equals the number of positive eigenvalues; here the positive pivots are 22 and 44, so there are two positive eigenvalues and one negative one. Only the sign count is determined — the eigenvalues are not equal to 2,−1,42,-1,4 — although the product relation λ1λ2λ3=2⋅(−1)⋅4=−8\lambda_1\lambda_2\lambda_3=2\cdot(-1)\cdot4=-8 does hold.

5. Give a matrix with positive determinant that is not positive definite.

Reference answer: A=[−100−3]A=\begin{bmatrix}-1&0\\0&-3\end{bmatrix} has det⁡A=3>0\det A=3>0, but its eigenvalues are −1-1 and −3-3, both negative, so it is not positive definite. The failure shows in the leading 1×11\times1 minor −1<0-1<0: positive definiteness requires all leading principal minors to be positive, so checking only the full determinant is not enough. Another example is [−2−1−1−2]\begin{bmatrix}-2&-1\\-1&-2\end{bmatrix}, with determinant 3>03>0 and eigenvalues −1,−3-1,-3.

How this connects

The previous lecture used Markov matrices to show that special matrices have special eigenvalues. This one systematizes the symmetric case and introduces positive definiteness. The next lecture handles complex numbers: Hermitian matrices, unitary matrices, and the Fourier matrix, whose fast factorization (the FFT) turns matrix decomposition into computational speed.

来源