Adjugate
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
Let $A$ be an $n\times n$ matrix.
The $ij$-minor of $A$ is $\det A(i,j)$, while
the $ij$-cofactor of $A$ is $(-1)^{i + j} \det A(i,j)$.
The cofactor matrix of $A$ is an $n\times n$ matrix $A\cof$ whose $ij$-entry is the $ij$-cofactor of $A$.
Let $\br_1,\ldots,\br_n$ be the rows of $A$.
Let $\bc_1,\ldots,\bc_n$ be the rows of $A\cof$.
Thus, the Laplace expansion can be written as
for any $i = 1,\ldots, n$.
Suppose $i$ and $j$ are two different indices in $\{1,\ldots,n\}$.
Consider the matrix $B$ obtained from $A$ by replacing its $j$-th row with $\br_i$.
Since $B$ has repeated rows, $\det(B) = 0$.
Meanwhile, the $jk$-cofactor of $B$ is the same as the $jk$-cofactor of $A$ for any $k = 1,\ldots, n$.
This means
In summary,
$$ \inp{\br_i}{\bc_j} = \begin{cases} \det(A) & \text{if }i = j, \\ 0 & \text{if }i \neq j. \end{cases} $$Define the adjugate of $A$ as $A\adj = (A\cof)\trans$.
Thus, the above summary leads to the identity
Therefore, when $\det(A) \neq 0$,
$$ A^{-1} = \frac{1}{\det(A)}A\adj. $$### code
set_random_seed(0)
print_ans = False
n = 3
A = matrix(n, random_int_list(n^2,3))
pretty_print(LatexExpr("A ="), A)
if print_ans:
for i in range(n):
for j in range(n):
alpha = list(range(n))
alpha.remove(i)
beta = list(range(n))
beta.remove(j)
print("det A(%s,%s) ="%(i,j), A[alpha,beta].det())
print("cofactor matrix:")
pretty_print(A.adjugate().transpose())
print("adjugate:")
pretty_print(A.adjugate())
根據拉普拉斯展開,計算行列式值時只會用到加法和乘法。
所以一個整數矩陣的行列式值也會是整數、
而一個有理數矩陣的行列式值也會是有理數。
利用這個性質回答以下問題。
According to the Laplace expansion, the computation of a determinant only uses the addition and the multiplication. Therefore, the determinant of an integer matrix is also an integer, and the determinant of a rational matrix is also a rational number. Use these facts to answer the following problems.
說明一個有理數矩陣(若可逆)的反矩陣也會是有理數矩陣。
Explain why the inverse of an invertible rational matrix is also a rational matrix.
找一個可逆的整數矩陣,其反矩陣不是整數矩陣。
Find an invertible integer matrix such that its inverse it not an integer matrix.
一個整數方陣如果行列式值為 $\pm 1$,
則被稱為么模矩陣(unimodular matrix) 。
說明么模矩陣的反矩陣一定是整數矩陣。
An integer matrix with determinant $\pm 1$ is called a unimodular matrix . Explain why the inverse of a unimodular matrix is also an integer matrix.
令 $\br_1,\br_2,\br_3$ 為 $\mathbb{R}^3$ 中的向量、
且
說明 $A\cof$ 的第一列即為 $\br_2$ 和 $\br_3$ 的外積。
(根據定義,$A\cof$ 的第一列和 $\br_1$ 無關。)
Let $\br_1,\br_2,\br_3$ be vectors in $\mathbb{R}^3$ and
$$ A = \begin{bmatrix} - & \br_1 & - \\ ~ & \vdots & ~ \\ - & \br_3 & - \end{bmatrix}. $$Explain why the first row of $A\cof$ is exactly the cross product of $\br_2$ and $\br_3$. (By definition, the first row of $A\cof$ is independent of $\br_1$.)
給定 $\beta = \{\br_2,\ldots,\br_n\}$ 為 $\mathbb{R}^n$ 中的一群線性獨立的向量。
說明如何利用 $A\cof$ 找到一根向量 $\bv$ 使得 $\bv$ 跟 $\beta$ 中的所有向量都垂直。
(這個動作可以看成是 $\beta$ 中向量的外積。)
Let $\beta = \{\br_2,\ldots,\br_n\}$ be a linearly independent set in $\mathbb{R}^n$. Explain how to use $A\cof$ to find a vector $\bv$ such that $\bv$ is orthogonal to each vector in $\beta$. (You may also view this operation as the cross product of $\beta$.)
令 $A$ 為一 $n\times n$ 矩陣。
當 $\rank(A) = n$ 時,我們知道 $A\adj = \det(A)A^{-1}$。
Let $A$ be an $n\times n$ matrix. When $\rank(A) = n$, we know $A\adj = \det(A)A^{-1}$.
當 $\rank(A) = n - 1$ 時,
可以假設 $A$ 的左右核分別為 $\ker(A) = \vspan\{\bu\}$ 及 $\ker(A\trans) = \vspan\{\bv\}$。
說明存在某個係數 $c$ 使得 $A\adj = c\bu\bv\trans$。
Suppose $\rank(A) = n - 1$. We may assume the left kernel and the right kernel of $A$ are $\ker(A) = \vspan\{\bu\}$ 及 $\ker(A\trans) = \vspan\{\bv\}$, respectively. Show that there is a constanct $c$ such that $A\adj = c\bu\bv\trans$.
當 $\rank(A) \leq n - 2$ 時,
說明 $A\adj = O$。
(提示:子矩陣的秩一定要比原矩陣的秩來得小。)
Suppose $\rank(A) = n - 2$. Show that $A\adj = O$. (Hint: The rank of a submatrix is smaller than the rank of the matrix itself.)
定義 $(x)_k = x(x-1)\cdots(x-k+1)$ 且 $(x)_0 = 1$。
已知
$\alpha = \{1,x,\ldots, x_d\}$ 及
$\beta = \{(x)_0, (x)_1, \ldots, (x)_d\}$
皆是 $\mathcal{P}_d$ 的基底。
Define $(x)_k = x(x-1)\cdots(x-k+1)$ and $(x)_0 = 1$. Suppose we know $\alpha = \{1,x,\ldots, x_d\}$ and $\beta = \{(x)_0, (x)_1, \ldots, (x)_d\}$ are both bases of $\mathcal{P}_d$.
當 $d = 3$ 時,求出基底轉換矩陣 $[\operatorname{id}]_\beta^\alpha$。
並說明對任意的 $d$ 來說,$[\operatorname{id}]_\beta^\alpha$ 都會是整數矩陣
且行列式值為 $1$。
When $d = 3$, find the change-of-bases matrix $[\operatorname{id}]_\beta^\alpha$. Explain why $[\operatorname{id}]_\beta^\alpha$ is always an integer matrix with determinant $1$ for any $d$.
當 $d = 3$ 時,求出基底轉換矩陣 $[\operatorname{id}]_\alpha^\beta$。
利用上一題的結果,說明對任意的 $d$ 來說,$[\operatorname{id}]_\alpha^\beta$ 都會是整數矩陣。
When $d = 3$, find the change-of-bases matrix $[\operatorname{id}]_\alpha^\beta$. Explain why $[\operatorname{id}]_\beta^\alpha$ is always an integer matrix for any $d$.