Inertia
This work by Jephian Lin is licensed under a Creative Commons Attribution 4.0 International License.
$\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{\mult}{\operatorname{mult}} \newcommand{\iner}{\operatorname{iner}}$
from lingeo import random_int_list
from sym import sym_from_list, inertia
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
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.
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
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
That is, applying some symmetric row/column operations simultaneously to $A$ will result in $B$.
### code
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(A))
對 $A$ 進行列運算 $\rho_2:-\rho_1$、再進行行運算 $\kappa_2:-\kappa_1$ 的結果為何?
Apply the row operation $\rho_2:-\rho_1$ and the column operation $\kappa_2:-\kappa_1$ to $A$. What is the result?
將 $A$ 進行一系列對稱的行列運算,讓它變成對角矩陣且對角線上只有 $1$、$0$、$-1$。
求 $\iner(A)$。
Apply some symmetric row/column operations simultaneously to $A$ so that it becomes a diagonal matrix with $1$, $0$, or $-1$ on the diagonal. Find $\iner(A)$.
一個矩陣 $A$ 的 二次型(quadratic form) 指的是長得像 $\bx\trans A\bx$ 的式子。
證明以下關於二次型的性質。
The quadratic form of a matrix $A$ is any expression of the form $\bx\trans A\bx$. Prove the following properties about the quadratic form.
令
$$ 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$。
Let
$$ A = \begin{bmatrix} 2 & -1 \\ -1 & 2 \end{bmatrix}, \quad \bx = \begin{bmatrix} x \\ y \end{bmatrix}. $$Prove that $\bx\trans A\bx \geq 0$.
Hint: Expand it and try to write it into the form of $1(ax + by)^2 + 3(cx+dy)^2$.
令 $A$ 為一 $2\times 2$ 實對稱矩陣,且其特徵值為 $\lambda_1,\lambda_2$。
令
證明 $\bx\trans A\bx$ 可寫成 $\lambda_1(ax + bx)^2 + \lambda_2(cx + dy)^2$ 的形式。
Let $A$ be a $2\times 2$ real symmetric matrix with eigenvalues $\lambda_1,\lambda_2$. Let
$$ \bx = \begin{bmatrix} x \\ y \end{bmatrix}. $$Show that $\bx\trans A\bx$ can be written as $\lambda_1(ax + bx)^2 + \lambda_2(cx + dy)^2$.
令 $A$ 為一 $2\times 2$ 實對稱矩陣,且其特徵值為 $\lambda_1,\lambda_2$。
證明:
Let $A$ be a $2\times 2$ real symmetric matrix with eigenvalues $\lambda_1,\lambda_2$. Show the following:
令 $A$ 為一 $2\times 2$ 實對稱矩陣。
證明:
Let $A$ be a $2\times 2$ real symmetric matrix. Show the following:
令 $f: \mathbb{R}^2 \rightarrow \mathbb{R}$ 為一二次可微函數且其微分連續。
令 $(x_0,y_0)\in\mathbb{R}^2$ 為一點使得一次微分 $f_x(x_0,y_0) = f_y(x_0,y_0) = 0$、
而 $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_0 + x \\ y_0 + y \end{bmatrix}. $$已知 $f$ 的函數值可以用
$$ f(x_0 + x, y_0 + y) \sim f(x_0, y_0) + \frac{1}{2}\bx\trans A \bx $$逼近。
說明為什麼:
Let $f: \mathbb{R}^2 \rightarrow \mathbb{R}$ be a function whose second derivatives exist and are continuous. Let $(x_0,y_0)\in\mathbb{R}^2$ be a point such that the first derivatives $f_x(x_0,y_0) = f_y(x_0,y_0) = 0$, and let $f_{xx}, f_{xy} = f_{yx}, f_{yy}$ be the second partial derivatives of $f$ with respect to $x$ and $y$.
Let
$$ A = \begin{bmatrix} f_{xx} & f_{yx} \\ f_{xy} & f_{yy} \end{bmatrix}, \quad \bx = \begin{bmatrix} x + x+0 \\ y_0 + y \end{bmatrix}. $$It is known that the approximation
$$ f(x_0 + x, y_0 + y) \sim f(x_0, y_0) + \frac{1}{2}\bx\trans A \bx $$holds.
Give some intuitive reasons to the following facts.
定義
$$ E(t) = \begin{bmatrix} 1 & t \\ 0 & 1 \end{bmatrix}. $$說明 $E(t)\trans AE(t)$ 在任何 $t\in\mathbb{R}$ 時都有相同的零維數。
Define
$$ E(t) = \begin{bmatrix} 1 & t \\ 0 & 1 \end{bmatrix}. $$Show that $E(t)\trans AE(t)$ has the same nullity for any $t\in\mathbb{R}$.
定義
$$ E(t) = \begin{bmatrix} t & 0 \\ 0 & 1 \end{bmatrix}. $$說明 $E(t)\trans AE(t)$ 在任何 $t > 0$ 時都有相同的零維數。
Define
$$ E(t) = \begin{bmatrix} t & 0 \\ 0 & 1 \end{bmatrix}. $$Show that $E(t)\trans AE(t)$ has the same nullity for any $t > 0$.
定義
$$ E = \begin{bmatrix} -1 & 0 \\ 0 & 1 \end{bmatrix}. $$說明 $\iner(E\trans AE) = \iner(A)$。
Define
$$ E = \begin{bmatrix} -1 & 0 \\ 0 & 1 \end{bmatrix}. $$Show that $\iner(E\trans AE) = \iner(A)$.
已知矩陣的特徵值會隨矩陣的數值連續變動。
利用這個性質證明西爾維斯特慣性定理。
It is known that the eigenvalues is a continuous function of the entries of the matrix. Use this fact to prove Sylvester's law of inertia.