owned this note
owned this note
Published
Linked with GitHub
{%hackmd 5xqeIJ7VRCGBfLtfMi0_IQ %}
# 慣性

This work by Jephian Lin is licensed under a [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/).
$\newcommand{\trans}{^\top}
\newcommand{\adj}{^{\rm adj}}
\newcommand{\cof}{^{\rm cof}}
\newcommand{\inp}[2]{\left\langle#1,#2\right\rangle}
\newcommand{\dunion}{\mathbin{\dot\cup}}
\newcommand{\bzero}{\mathbf{0}}
\newcommand{\bone}{\mathbf{1}}
\newcommand{\ba}{\mathbf{a}}
\newcommand{\bb}{\mathbf{b}}
\newcommand{\bc}{\mathbf{c}}
\newcommand{\bd}{\mathbf{d}}
\newcommand{\be}{\mathbf{e}}
\newcommand{\bh}{\mathbf{h}}
\newcommand{\bp}{\mathbf{p}}
\newcommand{\bq}{\mathbf{q}}
\newcommand{\br}{\mathbf{r}}
\newcommand{\bx}{\mathbf{x}}
\newcommand{\by}{\mathbf{y}}
\newcommand{\bz}{\mathbf{z}}
\newcommand{\bu}{\mathbf{u}}
\newcommand{\bv}{\mathbf{v}}
\newcommand{\bw}{\mathbf{w}}
\newcommand{\tr}{\operatorname{tr}}
\newcommand{\nul}{\operatorname{null}}
\newcommand{\rank}{\operatorname{rank}}
%\newcommand{\ker}{\operatorname{ker}}
\newcommand{\range}{\operatorname{range}}
\newcommand{\Col}{\operatorname{Col}}
\newcommand{\Row}{\operatorname{Row}}
\newcommand{\spec}{\operatorname{spec}}
\newcommand{\vspan}{\operatorname{span}}
\newcommand{\Vol}{\operatorname{Vol}}
\newcommand{\sgn}{\operatorname{sgn}}
\newcommand{\idmap}{\operatorname{id}}
\newcommand{\am}{\operatorname{am}}
\newcommand{\gm}{\operatorname{gm}}
\newcommand{\iner}{\operatorname{iner}}$
```python
from lingeo import random_int_list
from sym import sym_from_list, inertia
```
## Main idea
Let $A$ be an $n\times n$ symmetric matrix.
According to the spectral theorem, all eigenvalues of $A$ are real, so they can be arranged from small to large on the real line.
Let $n_+(A)$, $n_-(A)$, and $n_0(A)$ be the number of positive, negative, and zero eigenvalues of $A$, respectively.
Then the **inertia** of $A$ is defined as
$$
\iner(A) = (n_+(A), n_-(A), n_0(A)).
$$
Two symmetric matrices $A$ and $B$ are **congruent** if there is an invertible matrix $Q$ such that
$$
Q\trans AQ = B.
$$
Notice that $Q$ _has to_ be invertible, yet it is $Q\trans$ in the relation.
##### Sylvester's law of inertia
If two symmetric matrices are congruent, then they have the same inertia.
Moreover, every real symmetric matrix $A$ is congruent to a matrix of the form
$$
\begin{bmatrix}
I_p & ~ & ~ \\
~ & -I_q & ~ \\
~ & ~ & O_r
\end{bmatrix},
$$
where $p = n_+(A)$, $q = n_-(A)$, and $r = n_0(A)$.
Since every invertible matrix can be decomposed into the product of some elementary matrix.
Two symmetric matrices $A$ and $B$ are congruent means there are elementary matrices $E_1,\ldots, E_k$ such that
$$
E_k\trans\cdots E_1\trans AE_1\cdots E_k = B.
$$
That is, applying some symmetric row/column operations simultaneously to $A$ will result in $B$.
## Side stories
- quadratic form
- local optimum by derivatives
## Experiments
##### Exercise 1
執行以下程式碼。
```
set_random_seed(0)
print_ans = False
n = 3
entries = [1,1] + random_int_list(binomial(n+1,2) - 2, 3)
A = sym_from_list(n, entries)
pretty_print(LatexExpr("A ="), A)
if print_ans:
B = copy(A)
B.add_multiple_of_row(1,0,-1)
B.add_multiple_of_column(1,0,-1)
print("A after row/column operation:")
show(B)
print("(n+, n-, n0) =", inertia(B))
```
##### Exercise 1(a)
對 $A$ 進行列運算 $\rho_2:-\rho_1$、再進行行運算 $\kappa_2:-\kappa_1$ 的結果為何?
:::warning
- [x] seed1 --> `seed = 1`
:::
**Ans:**
執行上面的程式碼並使用 `seed = 1` 得到
$$
A = \begin{bmatrix}
1 & 1 & 3 \\
1 & -1 & 1 \\
3 & 1 & -2 \\
\end{bmatrix}.
$$
對 $A$進行列運算 $\rho_2:-\rho_1$ 及行運算 $\kappa_2:-\kappa_1$ 得到
$$
A_1 = \begin{bmatrix}
1 & 0 & 3 \\
0 & -2 & -2 \\
3 & -2 & -2 \\
\end{bmatrix}.
$$
##### Exercise 1(b)
將 $A$ 進行一系列對稱的行列運算,讓它變成對角矩陣且對角線上只有 $1$、$0$、$-1$。
求 $\iner(A)$。
:::warning
- [x] $A_2$ 有錯
:::
**Ans:**
對 $A$ 進行以下對稱的行列運算
$$
\begin{bmatrix}
1 & 0 & 0 \\
-1 & 1 & 0 \\
0 & 0 & 1 \\
\end{bmatrix}
\begin{bmatrix}
1 & 1 & 3 \\
1 & -1 & 1 \\
3 & 1 & -2 \\
\end{bmatrix}
\begin{bmatrix}
1 & -1 & 0 \\
0 & 1 & 0 \\
0 & 0 & 1 \\
\end{bmatrix} = A_1 =
\begin{bmatrix}
1 & 0 & 3 \\
0 & -2 & -2 \\
3 & -2 & -2 \\
\end{bmatrix}.
$$
$$
\begin{bmatrix}
1 & 0 & 0 \\
0 & 1 & 0 \\
-3 & 0 & 1 \\
\end{bmatrix}
\begin{bmatrix}
1 & 0 & 3 \\
0 & -2 & -2 \\
3 & -2 & -2 \\
\end{bmatrix}
\begin{bmatrix}
1 & 0 & -3 \\
0 & 1 & 0 \\
0 & 0 & 1 \\
\end{bmatrix} = A_2 =
\begin{bmatrix}
1 & 0 & 0 \\
0 & -2 & -2 \\
0 & -2 & -11 \\
\end{bmatrix}.
$$
$$
\begin{bmatrix}
1 & 0 & 0 \\
0 & 1 & 0 \\
0 & -1 & 1 \\
\end{bmatrix}
\begin{bmatrix}
1 & 0 & 0 \\
0 & -2 & -2 \\
0 & -2 & -11 \\
\end{bmatrix}
\begin{bmatrix}
1 & 0 & 0 \\
0 & 1 & -1 \\
0 & 0 & 1 \\
\end{bmatrix} = A_3 =
\begin{bmatrix}
1 & 0 & 0 \\
0 & -2 & 0 \\
0 & 0 & -9 \\
\end{bmatrix}.
$$
$$
\begin{bmatrix}
1 & 0 & 0 \\
0 & \frac{2}{\sqrt{2}} & 0 \\
0 & 0 & 1 \\
\end{bmatrix}
\begin{bmatrix}
1 & 0 & 0 \\
0 & -2 & 0 \\
0 & 0 & -9 \\
\end{bmatrix}
\begin{bmatrix}
1 & 0 & 0 \\
0 & \frac{2}{\sqrt{2}} & 0 \\
0 & 0 & 1 \\
\end{bmatrix} = A_4 =
\begin{bmatrix}
1 & 0 & 0 \\
0 & -1 & 0 \\
0 & 0 & -9 \\
\end{bmatrix}.
$$
$$
\begin{bmatrix}
1 & 0 & 0 \\
0 & 1 & 0 \\
0 & 0 & \frac{1}{3} \\
\end{bmatrix}
\begin{bmatrix}
1 & 0 & 0 \\
0 & -1 & 0 \\
0 & 0 & -9 \\
\end{bmatrix}
\begin{bmatrix}
1 & 0 & 0 \\
0 & 1 & 0 \\
0 & 0 & \frac{1}{3} \\
\end{bmatrix} = A_5 =
\begin{bmatrix}
1 & 0 & 0 \\
0 & -1 & 0 \\
0 & 0 & -1 \\
\end{bmatrix}.
$$
可求得 $\iner(A) = (1,2,0)$ .
## Exercises
##### Exercise 2
求以下矩陣 $A$ 的 $\iner(A)$。
##### Exercise 2(a)
$$
A = \begin{bmatrix}
1 & 1 \\
1 & 1
\end{bmatrix}.
$$
$Ans:$
$$
\begin{aligned}
p_A(x) &= \det(A-xI)\\
&= x^2 - 2x\\
&= x (x - 2),\\
\end{aligned}
$$
當 $p_A(x)=0$,得到 $\spec(A) = \{0,2\}$,
可求得 $\iner(A) = (1,0,1)$。
##### Exercise 2(b)
$$
A = \begin{bmatrix}
0 & 1 \\
1 & 0
\end{bmatrix}.
$$
$Ans:$
$$
\begin{aligned}
p_A(x) &= \det(A-xI)\\
&= x^2 - 1\\
&= (x + 1)(x - 1),\\
\end{aligned}
$$
當 $p_A(x)=0$,得到 $\spec(A) = \{-1,1\}$,
可求得 $\iner(A) = (1,1,0)$。
##### Exercise 2(c)
$$
A = \begin{bmatrix}
1 & 1 & 1 \\
1 & 1 & 1 \\
1 & 1 & 1 \\
\end{bmatrix}.
$$
$Ans:$
$$
\begin{aligned}
p_A(x) &= s_0(-x)^3 + s_1(-x)^2 + s_2(-x) + s_3\\
&= (-1)x^3 + 3x^2 \\
&= -x^2(x - 3),
\end{aligned}
$$
當 $p_A(x)=0$,得到 $\spec(A) = \{0,0,3\}$,
可求得 $\iner(A) = (1,0,2)$。
##### Exercise 2(d)
$$
A = \begin{bmatrix}
0 & 1 & 1 \\
1 & 0 & 1 \\
1 & 1 & 0 \\
\end{bmatrix}.
$$
$Ans:$
$$
\begin{aligned}
p_A(x) &= s_0(-x)^3 + s_1(-x)^2 + s_2(-x) + s_3\\
&= (-1)x^3 + 3x + 2 \\
&=-(x + 1)(x^2 - x - 2 ) \\
&=-(x + 1)^2(x - 2),
\end{aligned}
$$
當 $p_A(x)=0$,得到 $\spec(A) = \{-1,-1,2\}$,
可求得 $\iner(A) = (1,2,0)$。
##### Exercise 3
一個矩陣 $A$ 的 **二次型(quadratic form)** 指的是長得像 $\bx\trans A\bx$ 的式子。
證明以下關於二次型的性質。
##### Exercise 3(a)
令
$$
A = \begin{bmatrix}
2 & -1 \\
-1 & 2
\end{bmatrix}, \quad
\bx = \begin{bmatrix} x \\ y \end{bmatrix}.
$$
證明 $\bx\trans A\bx \geq 0$。
提示:展開後並將其寫成 $1(ax + by)^2 + 3(cx + dy)^2$。
**Ans:**
我們可將 $\bx\trans A\bx$ 寫成矩陣形式
$$\bx\trans A\bx =
\begin{bmatrix} x & y
\end{bmatrix}
\begin{bmatrix}
2 & -1 \\
-1 & 2
\end{bmatrix}
\begin{bmatrix} x \\ y
\end{bmatrix} =
\begin{bmatrix} 2x^2 - 2xy + 2y^2
\end{bmatrix}.
$$
而 $2x^2-2xy+2y^2$ 又可寫成 $1( \frac{1}{\sqrt{2}} x + \frac{1}{\sqrt{2}}y )^2 + 3( \frac{1}{\sqrt{2}}x + (\frac{-1}{\sqrt{2}})y )^2$。
因為平方為正,所以 **+1** $( \frac{1}{\sqrt{2}} x + \frac{1}{\sqrt{2}}y )^2$ **+3** $( \frac{1}{\sqrt{2}}x + (\frac{-1}{\sqrt{2}})y )^2$ 必為正,因此 $\bx\trans A\bx \geq 0$。
:::success
Nice.
不過我後來發覺我的提示有點誤導人,因為 $2x^2 -2xy + 2y^2$ 可以寫成 $(x-y)^2 + x^2 + y^2$ 也是大於等於 $0$。
:::
##### Exercise 3(b)
令 $A$ 為一 $2\times 2$ 實對稱矩陣,且其特徵值為 $\lambda_1,\lambda_2$。
令
$$
\bx = \begin{bmatrix} x \\ y \end{bmatrix}.
$$
證明 $\bx\trans A\bx$ 可寫成 $\lambda_1(ax + by)^2 + \lambda_2(cx + dy)^2$ 的形式。
:::warning
- [x] 寫得不錯,但這題用對稱矩陣可垂直對角化這個性質比較快。而實際上這裡的答案要求對角線上都是 $s$,但對稱矩陣不見得有這個性質。
:::
**Ans:**
因為 $A$ 是實對稱矩陣,所以可以用正交矩陣對角化,假設 $Q$ 是正交矩陣且
$$
Q = \begin{bmatrix}
a & c\\
b & d
\end{bmatrix},
$$
那麼
$$
Q^{-1} = Q \trans = \begin{bmatrix}
a & b\\
c & d
\end{bmatrix}.
$$
$Q$ 可以將 $A$ 對角化
$$
Q^{-1} AQ = \begin{bmatrix}
a & b\\
c & d
\end{bmatrix}A
\begin{bmatrix}
a &c\\
b & d
\end{bmatrix}=
\begin{bmatrix}
\lambda_1 & 0\\
0 & \lambda_2
\end{bmatrix}.
$$
因為 $\Col(Q) = \mathbb{R}^2$,$\bx$ 可以表示為
$$
\bx = Q\begin{bmatrix}
c_1\\
c_2
\end{bmatrix},\\
c_1,c_2 \in \mathbb{R}.
$$
左右乘上 $Q^{-1}$,
$$
\begin{aligned}
Q^{-1}\bx &= Q \trans \bx\\
&= \begin{bmatrix}
a & b\\
c & d
\end{bmatrix}
\begin{bmatrix}
x\\
y
\end{bmatrix}\\
&= \begin{bmatrix}
ax+by\\
cx+dy
\end{bmatrix}\\
&= \begin{bmatrix}
c_1\\
c_2
\end{bmatrix}.
\end{aligned}
$$
對 $\bx$ 做轉置,
$$
\bx \trans = \begin{bmatrix}
c_1 & c_2
\end{bmatrix}
Q \trans.
$$
最後考慮 $\bx \trans A \bx$,
$$
\begin{aligned}
\bx \trans A \bx &= \begin{bmatrix}
c_1 & c_2
\end{bmatrix}
Q \trans A Q\begin{bmatrix}
c_1\\
c_2
\end{bmatrix}\\
&= \begin{bmatrix}
c_1 & c_2
\end{bmatrix}
\begin{bmatrix}
\lambda_1 & 0\\
0 & \lambda_2
\end{bmatrix}
\begin{bmatrix}
c_1\\
c_2
\end{bmatrix}\\
&= \lambda_1{c_1}^2 + \lambda_2{c_2}^2\\
&= \lambda_1(ax + by)^2 + \lambda_2(cx + dy)^2.
\end{aligned}
$$
##### Exercise 3(c)
令 $A$ 為一 $2\times 2$ 實對稱矩陣,且其特徵值為 $\lambda_1,\lambda_2$。
證明:
1. 若 $\lambda_1, \lambda_2 \geq 0$ 時,$\bx\trans A\bx \geq 0$。
2. 若 $\lambda_1, \lambda_2 \leq 0$ 時,$\bx\trans A\bx \leq 0$。
3. 若 $\lambda_1, \lambda_2 > 0$ 且 $\bx\neq\bzero$ 時,$\bx\trans A\bx > 0$。
4. 若 $\lambda_1, \lambda_2 < 0$ 且 $\bx\neq\bzero$ 時,$\bx\trans A\bx < 0$。
:::warning
- [x] 觀念沒錯,不過內容要隨上一題修改
:::
**Ans:**
利用 3(b),$\bx\trans A\bx = \lambda_1(ax + by)^2 + \lambda_2(cx + dy)^2$,3(c) 是顯而易見的.
##### Exercise 4
令 $A$ 為一 $2\times 2$ 實對稱矩陣。
證明:
1. 若 $\det(A) > 0$ 且 $\tr(A) > 0$,則 $\iner(A) = (2,0,0)$。
2. 若 $\det(A) > 0$ 且 $\tr(A) < 0$,則 $\iner(A) = (0,2,0)$。
3. 若 $\det(A) < 0$,則 $\iner(A) = (1,1,0)$。
**Ans:**
$A$ 的特徵多項式,
$$
p_A(x) = x^2 - \tr(A)x + \det(A).
$$
$A$ 的特徵值是特徵多項式的根,所以
$$
\lambda_1 + \lambda_2 = \tr(A)\\
\lambda_1 \lambda_2 = \det(A).
$$
1. 若 $\det(A) > 0$,則 $\lambda_1$ 與 $\lambda_2$ 同號。若 $\tr(A) > 0$,則 $\lambda_1,\lambda_2$ 皆正,所以 $\iner(A) = (2,0,0)$.
2. 若 $\det(A) > 0$,則 $\lambda_1$ 與 $\lambda_2$ 同號。若 $\tr(A) < 0$,則 $\lambda_1,\lambda_2$ 皆負,所以 $\iner(A) = (0,2,0)$.
3. 若 $\det(A) < 0$,則 $\lambda_1$ 與 $\lambda_2$ 異號。所以 $\iner(A) = (1,1,0)$.
:::success
Great!
:::
##### Exercise 5
令 $f: \mathbb{R}^2 \rightarrow \mathbb{R}$ 為一二次可微函數且其微分連續。
令 $(x_0,y_0)\in\mathbb{R}^2$ 為一點、
而 $f_{xx}, f_{xy} = f_{yx}, f_{yy}$ 分別為 $f$ 對 $x$ 或 $y$ 的二次微分。
令
$$
A = \begin{bmatrix}
f_{xx} & f_{yx} \\
f_{xy} & f_{yy}
\end{bmatrix}, \quad
\bx = \begin{bmatrix} x \\ y \end{bmatrix}.
$$
已知 $f$ 的函數值可以用
$$
f(x_0 + x, y_0 + y) \sim f(x_0, y_0) + \bx\trans A \bx.
$$
逼近。
說明為什麼:
1. 若 $\det(A) > 0$ 且 $\tr(A) > 0$,則 $f$ 在 $(x_0,y_0)$ 有局部最小值。
2. 若 $\det(A) > 0$ 且 $\tr(A) < 0$,則 $f$ 在 $(x_0,y_0)$ 有局部最大值。
3. 若 $\det(A) < 0$,則 $f$ 在 $(x_0,y_0)$ 為𩣑點。
$Ans1:$
令
$$
x=th ,\ y=tk,\ f(x_0+th,y_0+tk)=g(t),\ f(x_0,y_0)=g(0).
$$
根據全微分公式,我們有
$$
g'(t)= \dfrac{dg}{dt} = \dfrac{\partial f}{\partial x}\cdot\dfrac{dx}{dt}+\dfrac{\partial f}{\partial y}\cdot\dfrac{dy}{dt}
= \dfrac{\partial f}{\partial x}\cdot\dfrac{d(x_0+th)}{dt}+\dfrac{\partial f}{\partial y}\cdot\dfrac{d(y_0+tk)}{dt}
=\dfrac{\partial f}{\partial x}\cdot h+\dfrac{\partial f}{\partial y}\cdot k,
$$
並且
$$
g''(t)=\dfrac{d}{dt}\Big( \dfrac{\partial f}{\partial x}\cdot h+\dfrac{\partial f}{\partial y}\cdot k \Big)
=f_{xx}h^2+2f_{xy}hk+f_{yy}k^2,
$$
以及
$$
g(t)\sim g(0)+g'(0)t+\frac{g''(0)\cdot t^2}{2}.
$$
所以
$$
\Delta f=g(t)-g(0)=\frac{t^2}{2}\cdot (f_{xx}h^2+2f_{xy}hk+f_{yy}k^2).
$$
其中
$$
f_{xx}h^2+2f_{xy}hk+f_{yy}k^2=f_{xx}(h+\frac{k\cdot f_{xy}}{f_{xx}})^2+\frac{f_{xx}\cdot f_{yy}-(f_{xy})^2}{f_{xx}}\cdot k^2.
$$
因為 $\dfrac{t^2}{2}$ 為正,
所以考慮 $f_{xx}h^2+2f_{xy}hk+f_{yy}k^2$ 的正負即可。
若 $\det(A) \gt 0$ 且 $\tr(A) \gt 0$,對於非零向量 $\bf_V=(h,k)$ 可得$$f_{xx}(h+\frac{k\cdot f_{xy}}{f_{xx}})^2+\frac{f_{xx}\cdot f_{yy}-(f_{xy})^2}{f_{xx}}\cdot k^2>0\Rightarrow \Delta\gt 0 \Rightarrow f(x_0+th,y_0+tk)\gt f(x_0,y_0).$$
所以 $(x_0,y_0)$ 為區域極小值。
若 $\det(A) \gt 0$ 且 $\tr(A) \lt 0$,對於非零向量 $\bf_V=(h,k)$ 可得
$$
f_{xx}(h+\frac{k\cdot f_{xy}}{f_{xx}})^2+\frac{f_{xx}\cdot f_{yy}-(f_{xy})^2}{f_{xx}}\cdot k^2\lt 0\Rightarrow \Delta<0 \Rightarrow f(x_0+th,y_0+tk) \lt f(x_0,y_0).
$$
所以 $(x_0,y_0)$ 為區域極大值。
\
若 $\det(A) \lt 0$ 且 $f_{xx} \gt 0$, 假設非零向量 $\bf_V=(h,k)=(1,0)$,
則
$$
f_{xx}(h+\frac{k\cdot f_{xy}}{f_{xx}})^2+\frac{f_{xx}\cdot f_yy-(f_{xy})^2}{f_{xx}}\cdot k^2\gt 0,
$$
假設非零向量 $\bf_V=(h,k)=(f_{xy},-f_{xx})$,
則
$$
f_{xx}(h+\frac{k\cdot f_{xy}}{f_{xx}})^2+\frac{f_{xx}\cdot f_{yy}-(f_{xy})^2}{f_{xx}}\cdot k^2\lt 0.
$$
故 $(x_0,y_0)$ 為鞍點。
如果 $\det(A) \lt 0$ 且 $f_{xx} \lt 0$,假設有兩非零向量 $\mathbf{v}=(h,k)=(-f_{xy},f_{xx})$,$(1,0)$。
則我們利用相同推理也可得 $(x_0,y_0)$ 為鞍點。
如果 $f_{xx}=0$,則可以交換 $x,y$ 的位子,得到當 $f_{yy}\neq0$ 時,$(x_0,y_0)$ 為鞍點。
如果 $f_{xx},f_{yy}=0$,由於 $\det\neq0$ 所以 $f_{xy}\neq0$,因此 $f_{xx}h^2+2f_{xy}hk+f_{yy}k^2=2f_{xy}hk{t}^2$。
假設 $f_{xy}\gt 0$,
若依非零向量 $\bf_V=(h,k)=(1,1)$,則 $2f_{xy}hk{t}^2\gt 0$;
若依非零向量 $\bf_V=(h,k)=(1,-1)$,則 $2f_{xy}hk{t}^2\lt 0$。
故 $(x_0,y_0)$ 為鞍點。
假設 $f_{xy}\lt 0$,
若依非零向量 $\bf_V=(h,k)=(1,1)$,則 $f_{xx}h^2+2f_{xy}hk+f_{yy}k^2=2f_{xy}hk{t}^2\lt 0$;
若依非零向量 $\bf_V=(h,k)=(1,-1)$,則 $f_{xx}h^2+2f_{xy}hk+f_{yy}k^2=2f_{xy}hk{t}^2\gt 0$。
故 $(x_0,y_0)$ 為鞍點。
根據上述推理,因此題目敘述得證。
**Ans2:**
利用Exercise 4的結果,
1. 若 $\det(A) > 0$ 且 $\tr(A) > 0$,則
$$
f(x_0 + x, y_0 + y) - f(x_0, y_0) \sim \bx\trans A \bx \geq 0.
$$
$f$ 在 $(x_0,y_0)$ 附近都不比在 $(x_0,y_0)$ 小,所以 $f$ 在$(x_0,y_0)$ 有局部最小值。
2. 若 $\det(A) > 0$ 且 $\tr(A) < 0$,則
$$
f(x_0 + x, y_0 + y) - f(x_0, y_0) \sim \bx\trans A \bx \leq 0.
$$
$f$ 在 $(x_0,y_0)$ 附近都不比在 $(x_0,y_0)$ 大,所以 $f$ 在$(x_0,y_0)$ 有局部最大值。
3. 若 $\det(A) < 0$,則可以取適當的 $\bx$ 使得 $\bx\trans A \bx \geq 0$ 或 $\bx\trans A \bx \leq 0$,
所以 $f$ 在 $(x_0,y_0)$ 是鞍點。
##### Exercise 6
利用以下步驟證明西爾維斯特慣性定理。
##### Sylvester's law of inertia
If two symmetric matrices are congruent, then they have the same inertia.
##### Exercise 6(a)
定義
$$
E(t) = \begin{bmatrix}
1 & t \\
0 & 1
\end{bmatrix}.
$$
說明 $E(t)\trans AE(t)$ 在任何 $t\in\mathbb{R}$ 時都有相同的零維數。
:::warning
這題主要是說明如果 $E$ 可逆,則 $\nul(E\trans AE) = \nul(A)$
:::
**Ans:**
回憶一下,
$$
\rank(ABC) \leq \min(\rank(A), \rank(B), \rank(C)),\\
\rank(A) + \nul(A) = n.
$$
因為 $E(t)$ 對於所有 $t \in \mathbb{R}$ 都是滿秩的,所以 $\rank(E(t)) = 2$,且 $E(t)$ 可逆。
令
$$
\begin{aligned}
E(t) \trans AE(t) &= B,\\
(E(t) \trans)^{-1} B (E(t))^{-1} &= A.
\end{aligned}
$$
因為 $E(t)$ 是滿秩的,所以 $\rank(A), \rank(B) \leq \rank(E(t)) = \rank(E(t) \trans)$
那麼
$$
\begin{aligned}
&\rank(B) \leq \min(\rank(E(t) \trans), \rank(A), \rank(E(t))) = \rank(A)\\
&\rank(A) \leq \min(\rank(E(t) \trans)^{-1}, \rank(B), \rank((E(t))^{-1})) = \rank(B)\\
\end{aligned}
$$
所以
$$
\begin{aligned}
\rank(A) &= \rank(B)\\
&= \rank(E(t) \trans AE(t)),\\
n - \rank(A) &= \nul(A)\\
&= \nul(E(t) \trans AE(t))\\
&= n - \rank(E(t) \trans AE(t)).
\end{aligned}
$$
##### Exercise 6(b)
定義
$$
E(t) = \begin{bmatrix}
t & 0 \\
0 & 1
\end{bmatrix}.
$$
說明 $E(t)\trans AE(t)$ 在任何 $t > 0$ 時都有相同的零維數。
**Ans:**
因為對於任何 $t > 0$,$E(t)$ 都是滿秩的,根據6(a),
$$
\nul(E(t) \trans AE(t)) = \nul(A).
$$
##### Exercise 6(c)
定義
$$
E = \begin{bmatrix}
-1 & 0 \\
0 & 1
\end{bmatrix}.
$$
說明 $\iner(E\trans AE) = \iner(A)$。
**Ans:**
令
$$
A = \begin{bmatrix}
a & b\\
c & d
\end{bmatrix}.
$$
直接計算 $E \trans AE$,
$$
E \trans AE = \begin{bmatrix}
a & -b\\
-c & d
\end{bmatrix}.
$$
因為
$$
\begin{aligned}
\det(A) &= \det(E \trans AE) = ad - bc\\
\tr(A) &= \tr(E \trans AE) = a + d.
\end{aligned}
$$
還有 Exercise 4 的結果,所以 $\iner(E \trans AE) = \iner(A)$.
##### Exercise 6(d)
已知矩陣的特徵值會隨矩陣的數值連續變動。
利用這個性質證明西爾維斯特慣性定理。
:::warning
- [ ] 這題要說明 $F$ 要怎麼把 $I$ 變成 $Q$
- [ ] 不可逆的部份論證有問題;說明在變化過程中 $0$ 的個數不變就好
:::
**Ans:**
若一個矩陣是可逆的,則該矩陣的 $\ker = \{ \bzero \}$,也就是該矩陣特徵值不為 $0$.
若 $A$ 可逆,則 $Q \trans AQ = B$ 也是可逆的,所以 $A,B$ 的特徵值皆不為 $0$.
定義一個連續可逆函數 $F : [0,1] \rightarrow M_{n \times n}$,且 $F(0) = I_n$,$F(1) = Q$.
當 $t$ 從 $0$ 增大到 $1$,$F(t) \trans A F(t)$ 的特徵值慢慢從 $A$ 的特徵值變成 $B$ 的特徵值,因為 $F(t) \trans A F(t)$ 一直都是可逆的,所以特徵值變化的過程都沒有經過 $0$,所以 $\iner(A) = \iner(B)$.
若 $A$ 不可逆,考慮可逆矩陣 $A + \epsilon I$,
$$
\begin{aligned}
Q \trans (A + \epsilon I) Q &= Q \trans AQ + \epsilon Q \trans Q\\
&= B + \epsilon Q \trans Q.
\end{aligned}
$$
根據上一個結論,所以 $\iner(A + \epsilon I) = \iner(B + \epsilon Q \trans)$.
當 $\epsilon \rightarrow 0$,$\iner(A) = \iner(B)$.
:::info
分數 = 7
:::