owned this note
owned this note
Published
Linked with GitHub
# 體驗喬丹標準型
Understand the Jordan canonical form

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{\mult}{\operatorname{mult}}
\newcommand{\iner}{\operatorname{iner}}$
```python
from lingeo import random_int_list, random_good_matrix
```
## Main idea
Let $\lambda\in\mathbb{C}$ and $n$ an integer.
A **Jordan block** of $\lambda$ of order $n$ is the $n\times n$ matrix
$$
J_{\lambda,n} = \begin{bmatrix}
\lambda & 1 & & \\
& \ddots & \ddots & \\
& & & 1 \\
& & & \lambda \\
\end{bmatrix}.
$$
According to the spectrum theorem, for every symmetric matrix $A$, there is an orthonormal basis $\beta$ such that $[f_A]_\beta^\beta$ is orthogonal.
This is not necessarily true for not necessarily symmetric matrices, even we give up the condition of being orthonormal.
Any Jordan block of order at least $2$ is such an example.
Fortunately, we have the folloing canonical form.
##### Jordan canonical form
Let $A$ be an $n\times n$ matrix.
Then there is a basis $\beta$ of $\mathbb{R}^n$ such that
$$
[f_A]_\beta^\beta = J_{\lambda_1,n_1}\oplus \cdots \oplus J_{\lambda_d,n_d},
$$
where $\oplus$ is the direct sum of two matrices.
That is, there is an invertible matrix $Q$ such that $Q^{-1}AQ = J_{\lambda_1,n_1}\oplus \cdots \oplus J_{\lambda_d,n_d}$.
We say two $n\times n$ matrices $A$ and $B$ are **similar** if there is an invertible matrix $Q$ such that $Q^{-1}AQ = B$.
Equivalently, $A$ and $B$ are similar if there is a basis $\beta$ of $\mathbb{R}^n$ such that $[f_A]_\beta^\beta = B$.
It is not trivial how to determine whether two given matrices are similar.
It turns out that two matrices are similar if and only if they have the same Jordan canonical form.
## Side stories
- matrix algebra
## Experiments
##### Exercise 1
執行以下程式碼。
已知 $A$ 和 $B$ 相似﹐且 $Q^{-1}AQ = B$。
<!-- eng start -->
Run the code below. Suppose $A$ and $B$ are similar and $Q^{-1}AQ = B$.
<!-- eng end -->
```python
### code
set_random_seed(0)
print_ans = False
n = 2
A = matrix(2, random_int_list(n*n))
Q = random_good_matrix(n,n,n)
B = Q.inverse() * A * Q
print("Qinv * A * Q = B")
pretty_print(Q.inverse(), A, Q, "=", B)
if print_ans:
print("rank =", A.rank())
print("nullity =", A.nullity())
print("determinant =", A.determinant())
print("B (Qinv v) = (Qinv b)")
```
##### Exercise 1(a)
驗證 $A$ 和 $B$ 有相同的秩、核數、行列式值。
<!-- eng start -->
Verify that $A$ and $B$ have the same rank, nullity, and determinant.
<!-- eng end -->
##### Exercise 1(b)
若已知 $A\bv = \bb$。
求 $B(Q^{-1}\bv)$。
<!-- eng start -->
Suppose $A\bv = \bb$. Then find $B(Q^{-1}\bv)$.
<!-- eng end -->
## Exercises
##### Exercise 2
令 $A$ 和 $B$ 為兩 $n\times n$ 矩陣。
證明以下敘述等價:
1. $A$ 和 $B$ 相似。
2. 存在 $\mathbb{R}^n$ 的一組基底 $\beta$ 使得 $[f_A]_\beta^\beta = B$。
<!-- eng start -->
Let $A$ and $B$ be $n\times n$ matrices. Show that the following are equivalent:
1. $A$ and $B$ are similar.
2. There is a basis $\beta$ of $\mathbb{R}^n$ such that $[f_A]_\beta^\beta = B$.
<!-- eng end -->
##### Exercise 3
令
$$
J = J_{2,3} =
\begin{bmatrix}
2 & 1 & 0 \\
0 & 2 & 1 \\
0 & 0 & 2 \\
\end{bmatrix}.
$$
<!-- eng start -->
Let
$$
J = J_{2,3} =
\begin{bmatrix}
2 & 1 & 0 \\
0 & 2 & 1 \\
0 & 0 & 2 \\
\end{bmatrix}.
$$
<!-- eng end -->
##### Exercise 3(a)
說明若存在一組基底 $\beta = \{ \bv_1,\ldots,\bv_3 \}$ 使得 $[f_J]_\beta^\beta$ 是對角矩陣 $\operatorname{diag}(\lambda_1,\lambda_2,\lambda_3)$﹐
則對每個 $i = 1,\ldots, 3$ 都有 $J\bv_i = \lambda_i \bv_i$。
<!-- eng start -->
Show that if there is a basis $\beta = \{ \bv_1,\ldots,\bv_3 \}$ such that $[f_J]_\beta^\beta$ is a diagonal matrix $\operatorname{diag}(\lambda_1,\lambda_2,\lambda_3)$, then $J\bv_i = \lambda_i \bv_i$ for each $i = 1, \ldots, 3$.
<!-- eng end -->
##### Exercise 3(b)
說明若這樣的基底存在﹐必定是 $\lambda_1 = \cdots = \lambda_3 = 2$﹐
然而 $J$ 不可能和 $2I$ 相似。
<!-- eng start -->
Show that if such a basis exists, then it must be $\lambda_1 = \cdots = \lambda_3 = 2$. However, $J$ is impossible to be similar with $2I$.
<!-- eng end -->
##### Exercise 4
令 $A$ 為一 $n\times n$ 矩陣。
已知 $\beta$ 為 $\mathbb{R}^n$ 的一組基底使得 $[f_A]_\beta^\beta = J = J_{\lambda,n}$。
將每個 $A\bv_i$ 寫成 $\beta$ 的線性組合。
<!-- eng start -->
Let $A$ be an $n\times n$ matrix. Suppose $\beta$ is a basis of $\mathbb{R}^n$ such that $[f_A]_\beta^\beta = J = J_{\lambda,n}$. Write each $A\bv_i$ as a linear combination of $\beta$.
<!-- eng end -->
##### Exercise 5
令
$$
A = \begin{bmatrix}
5 & 1 & 0 \\
-7 & -1 & 1 \\
-6 & -2 & 2
\end{bmatrix}.
$$
令
$\bv_1 = (1, -3, -2)$、
$\bv_2 = (1, -2, -2)$、
$\bv_3 = (2, -5, -3)$、
$\beta = \{ \bv_1, \ldots, \bv_3 \}$。
求 $[f_A]_\beta^\beta$。
<!-- eng start -->
Let
$$
A = \begin{bmatrix}
5 & 1 & 0 \\
-7 & -1 & 1 \\
-6 & -2 & 2
\end{bmatrix}.
$$
Let $\bv_1 = (1, -3, -2)$, $\bv_2 = (1, -2, -2)$, $\bv_3 = (2, -5, -3)$, and $\beta = \{ \bv_1, \ldots, \bv_3 \}$. Find $[f_A]_\beta^\beta$.
<!-- eng end -->
##### Exercise 6
證明兩矩陣相似是等價關係。
<!-- eng start -->
Show that the similarity between matrices is an equivalence relation.
<!-- eng end -->