Matrix inverse
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_good_matrix
Let $A$ be an $m\times n$ matrix.
Let $B$ be an $n\times \ell$ matrix whose columns are $\bu_1,\ldots,\bu_\ell$.
Then the columns of $AB$ are $A\bu_1, \ldots, A\bu_\ell$.
Recall that an $n\times n$ matrix $A$ is invertible if there is a matrix $B$ such that $AB = BA = I_n$.
Indeed, an $n\times n$ matrix is invertible if and only if it is nonsingular.
invertible $\implies$ nonsingular
Suppose $A$ and $B$ are $n\times n$ matrices such that $AB = I_n$.
Then both $A$ and $B$ are nonsingular.
nonsingular $\implies$ invertible
Suppose $A$ is an $n\times n$ nonsingular matrix.
Let $\be_1,\ldots,\be_n$ be the columns of $I_n$.
Since $A$ is nonsingular and $\Col(A) = \mathbb{R}^n$, the equation $A\bx = \be_i$ has a solution $\bx = \bb_i$ for each $i = 1,\ldots, n$.
Let $B$ be the matrix whose columns are $\bb_1,\ldots,\bb_n$.
Then $AB = I_n$.
Here is a way to calculate $B$ at once:
Suppose $A$ and $B$ be $n\times n$ matrices such that $AB = I_n$.
Then $BA = I_n$.
Therefore, if $AB = I_n$, then both $A$ and $B$ are invertible and they are the inverse of each other.
Suppose $A$, $B$, and $C$ are $n\times n$ matrices such that $CA = I_n$ and $AB = I_n$.
Then $C = B$.
Therefore, each matrix only has one inverse.
is_invertible
inverse
執行下方程式碼。
矩陣 $\left[\begin{array}{c|c} I & B \end{array}\right]$ 是 $\left[\begin{array}{c|c} A & I \end{array}\right]$ 的最簡階梯形式矩陣。
Run the code below. Let $\left[\begin{array}{c|c} I & B \end{array}\right]$ be the reduced echelon form of $\left[\begin{array}{c|c} A & I \end{array}\right]$.
### code
set_random_seed(0)
print_ans = False
A = random_good_matrix(4,4,4)
AI = A.augment(identity_matrix(4), subdivide=True)
IB = AI.rref()
B = IB[:,4:]
print("[ A | I ] =")
show(AI)
print("[ I | B ] =")
show(IB)
令 $\bb_i$ 為 $B$ 的第 $i$ 個行向量。
令 $\be_i$ 為 $I$ 的第 $i$ 個行向量。
驗證是否 $A\bb_i = \be_i$。
說明為什麼。
Let $\bb_i$ be the $i$-th column of $B$ and $\be_i$ the $i$-th column of $I$. Check if $A\bb_i = \be_i$. Can you explain it?
令 $A$ 和 $B$ 為 $n\times n$ 矩陣。
驗證以下反矩陣的性質。
Let $A$ and $B$ be $n\times n$ matrices. Verify the following properties of an inverse matrix.
若 $A$ 可逆。
如果 $X$ 和 $B$ 是 $n\times m$ 矩陣且 $AX = B$
則 $X = A^{-1}B$。
如果 $X$ 和 $B$ 是 $m\times n$ 矩陣且 $XA = B$
則 $X = BA^{-1}$。
Suppose $A$ is invertible. If $X$ and $B$ are $n\times m$ matrices and $AX = B$, then $X = A^{-1}B$. If $X$ and $B$ are $m\times n$ matrices and $XA = B$, then $X = BA^{-1}$.
若 $A$ 和 $B$ 都可逆﹐
則 $AB$ 也可逆且 $(AB)^{-1} = B^{-1}A^{-1}$。
If $A$ and $B$ are invertible, then $AB$ is also invertible with $(AB)^{-1} = B^{-1}A^{-1}$.
若 $AB$ 可逆﹐
則 $A$ 和 $B$ 都可逆。
If $AB$ are invertible, then both $A$ and $B$ are invertible.
若 $A$ 可逆且 $B = A^{-1}$﹐
則 $B$ 也可逆且 $A = B^{-1}$。
If $A$ is invertible with $B = A^{-1}$, then $B$ is invertible with $A = B^{-1}$.
若 $A$ 可逆﹐
則 $A\trans$ 也可逆且 $(A\trans)^{-1} = (A^{-1})\trans$。
If $A$ is invertible, then $A\trans$ is invertible with $(A\trans)^{-1} = (A^{-1})\trans$.
令 $A$ 是一個 $m\times n$ 矩陣。
以下討論 $A\trans A$ 是否可逆。
Let $A$ be an $m\times n$. The following problems are about the invertibility of $A\trans A$.
證明以下敘述等價:
Show that the following are equivalent:
證明若 $m < n$ 則 $A\trans A$ 不可逆。
Show that if $m < n$ then $A\trans A$ is not invertible.
令 $A$ 和 $B$ 為 $n\times n$ 矩陣。
依照以下步驟證明
若 $AB = I_n$ 則 $BA = I_n$。
Let $A$ and $B$ be $n\times n$ matrices. Use the given instructions to prove that $AB = I_n$ if and only if $BA = I_n$.
若 $AB = I_n$。
證明增廣矩陣 $\left[\begin{array}{c|c} A & I_n \end{array}\right]$ 的最簡階梯形式矩陣
一定是 $\left[\begin{array}{c|c} I_n & B \end{array}\right]$。
Suppose $AB = I_n$. Show that the reduced echelon form of $\left[\begin{array}{c|c} A & I_n \end{array}\right]$ is $\left[\begin{array}{c|c} I_n & B \end{array}\right]$.
令 $\be_i$ 為 $I_n$ 的第 $i$ 個行向量。
令 $\ba_i$ 為 $A$ 的第 $i$ 個行向量。
說明對每個 $i = 1,\ldots, n$ 都有
$$ \left[\begin{array}{c|c} A & I_n \end{array}\right] \begin{bmatrix} \be_i \\ -\ba_i \end{bmatrix} = \bzero, $$因此也有
$$ \left[\begin{array}{c|c} I_n & B \end{array}\right] \begin{bmatrix} \be_i \\ -\ba_i \end{bmatrix} = \bzero. $$Let $\be_i$ be the $i$-th column of $I_n$ and $\ba_i$ the $i$-th column of $A$.
Show that for each $i = 1,\ldots, n$, we have
$$ \left[\begin{array}{c|c} A & I_n \end{array}\right] \begin{bmatrix} \be_i \\ -\ba_i \end{bmatrix} = \bzero, $$and
$$ \left[\begin{array}{c|c} I_n & B \end{array}\right] \begin{bmatrix} \be_i \\ -\ba_i \end{bmatrix} = \bzero. $$因為對每個 $i = 1,\ldots, n$ 都有
$$ \left[\begin{array}{c|c} I_n & B \end{array}\right] \begin{bmatrix} \be_i \\ -\ba_i \end{bmatrix} = \bzero. $$說明對每個 $i = 1,\ldots, n$ 都有 $B\ba_i = \be_i$、
因此 $BA = I_n$。
For each $i = 1,\ldots, n$, we know
$$ \left[\begin{array}{c|c} I_n & B \end{array}\right] \begin{bmatrix} \be_i \\ -\ba_i \end{bmatrix} = \bzero. $$Use this fact to show that $B\ba_i = \be_i$ for each $i = 1,\ldots, n$. Therefore, $BA = I_n$.
找一組例子使得
$A$ 是 $n\times m$ 矩陣、
$B$ 是 $m\times n$ 矩陣、
$AB = I_n$、
但是 $BA \neq I_m$。
Find an $n\times m$ matrix $A$ and an $m\times n$ matrix $B$ such that $AB = I_n$ but $BA \neq I_m$.
令 $A = \begin{bmatrix} a & b \\ c & d \end{bmatrix}$ 且 $\det(A) \neq 0$。
證明 $A^{-1} = \frac{1}{\det(A)}\begin{bmatrix} d & -b \\ -c & a \end{bmatrix}$。
Let $A = \begin{bmatrix} a & b \\ c & d \end{bmatrix}$ with $\det(A) \neq 0$. Show that $A^{-1} = \frac{1}{\det(A)}\begin{bmatrix} d & -b \\ -c & a \end{bmatrix}$.