題目
Let \(A\) be an \(n\times n\) invertible matrix. Show that \(A\bx = \bb\) has solution \(x_i = \frac{\det A_i(\bb)}{\det(A)}\) for \(i = 1, 2, ..., n\), where \(x_i\) is the \(i\)th entry of \(\bx\) and \(A_i(\bb)\) is the matrix obtained from \(A\) by replaceing the \(i\)th column with vector \(\bb\).
想法與解法
林其璜 says
想法
求解線性方程組 \(A\bx = \bb\) 一個最直觀的想法就是求出 \(A\) 的反矩陣,有了反矩陣,我們就可以通過對方程組左右同乘 \(A^{-1}\) 來求解,如下:
\[A\bx = \bb \implies A^{-1}A\bx = A^{-1}\bb \implies \bx = A^{-1}\bb
\]
而克拉瑪公式其實就是在解反矩陣,一個直觀的證明方式是利用伴隨矩陣(adjugate matrix)來計算反矩陣,化簡之後就會得到克拉瑪公式。在講伴隨矩陣之前,我們要先知道何為餘因子矩陣(cofactor matrix)。
餘因子矩陣
給定一個 \(n \times n\) 的矩陣 \(A\),我們定義子行列式 \(M_{ij}\) 為 \(A\) 刪除第 \(i\) 列第 \(j\) 行後的行列式值,如下
\[M_{ij} = \det
\begin{bmatrix}
a_{11} & \cdots & a_{1\ j-1} & a_{1\ j+1} & \cdots & a_{1n} \\
\vdots & \ddots & \vdots & \vdots & \cdots & \vdots \\
a_{i-1\ 1} & \cdots & a_{i-1\ j-1} & a_{i-1\ j+1} & \cdots & a_{i-1\ n} \\
a_{i+1\ 1} & \cdots & a_{i+1\ j-1} & a_{i+1\ j+1} & \cdots & a_{i+1\ n} \\
\vdots & \cdots & \vdots & \vdots & \ddots & \vdots \\
a_{n1} & \cdots & a_{n\ j-1} & a_{n\ j+1} & \cdots & a_{nn}
\end{bmatrix}.
\]
其中 \(a_{ij}\) 為 \(A\) 的第 \(i\) 列第 \(j\) 行的元素。
接著我們定義 \(C_{ij} = (-1)^{i+j}M_{ij}\) 稱為 \(A\) 在 \((i,j)\) 上的餘因子,則我們將 \(A\cof = \begin{bmatrix}C_{ij}\end{bmatrix}\) 稱作 \(A\) 的餘因子矩陣。
伴隨矩陣
伴隨矩陣其實就是餘因子矩陣的轉置 \((A\cof)\trans\),我們將其記為 \(A\adj\),並且伴隨矩陣有個特性,也就是 \(A^{-1} = \frac{1}{\det(A)}A\adj\)。
根據伴隨矩陣與反矩陣的關聯,我們可以知道線性方程式的解 \(\bx = A^{-1}\bb = \frac{1}{\det(A)}A\adj \cdot \bb\)。
現在,我們把 \(\frac{1}{\det(A)}A\adj \cdot \bb\) 寫開來,會變成
\[\bx = \frac{1}{\det(A)}A\adj \cdot \bb =
\frac{1}{\det(A)}
\begin{bmatrix}
C_{11} & C_{21} & \cdots & C_{n1} \\
C_{12} & C_{22} & \cdots & C_{n2} \\
\vdots & \vdots & \ddots & \vdots \\
C_{1n} & C_{2n} & \cdots & C_{nn}
\end{bmatrix}
\begin{bmatrix}
b_{1} \\
b_{2} \\
\vdots \\
b_{n}
\end{bmatrix}.
\]
(注意,這邊的下標是因為 \(A\adj\) 與 \(A\cof\) 差一個轉置,並不是寫錯。)
如果我們特別關注 \(\bx\) 的第一項,則可發現
\[\bx =
\begin{bmatrix}
x_{1} \\
x_{2} \\
\vdots \\
x_{n}
\end{bmatrix} =
\frac{1}{\det(A)}A\adj \cdot \bb =
\frac{1}{\det(A)}
\begin{bmatrix}
C_{11} & C_{21} & \cdots & C_{n1} \\
\\
\\
\\
\end{bmatrix}
\begin{bmatrix}
b_{1} \\
b_{2} \\
\vdots \\
b_{n}
\end{bmatrix}
\]
並得到
\[x_1 = \frac{1}{\det(A)}(b_1 C_{11} + b_2 C_{21} + \cdots + b_n C_{n1}).
\]
則我們就會發現其中的 \(b_1 C_{11} + b_2 C_{21} + \cdots + b_n C_{n1}\) 其實就是 \(\det A_1(\bb)\)。
把 \(\det A_1(\bb)\) 的各項寫出來為
\[\det A_1(\bb) = \det
\begin{bmatrix}
b_{1} & a_{12} & \cdots & a_{1n} \\
b_{2} & a_{22} & \cdots & a_{2n} \\
\vdots & \vdots & \ddots & \vdots \\
b_{n} & a_{n2} & \cdots & a_{nn}
\end{bmatrix}.
\]
如果我們對第一行(column)做降階來求行列式,應該很容易就會發現兩者相等。
但其實我想介紹的是另一種證明方式,感覺上比較不直觀,但是過程短很多,也比較漂亮。
解法
令 \(I_i(\bx)\) 為將 \(n \times n\) 單位矩陣的第 \(i\) 行取代成向量 \(\bx\) 的矩陣,然後我們計算 \(AI_i(\bx)\),如下
\[\begin{aligned}
AI_i(\bx) &=
\begin{bmatrix}
| & | & & | \\
\ba_{1} & \ba_{2} & \cdots & \ba_{n} \\
| & | & & |
\end{bmatrix}
\begin{bmatrix}
| & & | & | & | & & | \\
e_{1} & \cdots & e_{i-1} & \bx & e_{i+1} & \cdots & e_{n} \\
| & & | & | & | & & |
\end{bmatrix} \\ &=
\begin{bmatrix}
| & & | & | & | & & | \\
\ba_{1} & \cdots & \ba_{i-1} & A \bx & \ba_{i+1} & \cdots & \ba_{n} \\
| & & | & | & | & & |
\end{bmatrix} \\ &=
\begin{bmatrix}
| & & | & | & | & & | \\
\ba_{1} & \cdots & \ba_{i-1} & \bb & \ba_{i+1} & \cdots & \ba_{n} \\
| & & | & | & | & & |
\end{bmatrix} =
A_i(\bb)
\end{aligned}\]
(最後一個等號是因為 \(A\bx = \bb\),也就是我們要求的線性方程組。)
此時,根據行列式的性質 \(\det(AB) = \det(A) \det(B)\),我們有
\[\det(A) \det(I_i(\bx)) = \det(AI_i(\bx)) = \det A_i(\bb).
\]
移項後就得到
\[\det I_i(\bx) = \frac{\det A_i(\bb)}{\det(A)}.
\]
最後,我們觀察一下 \(\det I_i(\bx)\)
\[\begin{aligned}
\det I_i(\bx)
&= \det \begin{bmatrix}
| & & | & | & | & & | \\
e_{1} & \cdots & e_{i-1} & \bx & e_{i+1} & \cdots & e_{n} \\
| & & | & | & | & & |
\end{bmatrix} \\
&= \det \begin{bmatrix} \\[-1cm]
1 & 0 & \cdots & 0 & x_1 & 0 & \cdots & 0 \\
0 & 1 & \cdots & 0 & x_2 & 0 & \cdots & 0 \\
\vdots & \vdots & \ddots & \vdots & \vdots & \vdots & \ddots & \vdots \\
0 & 0 & \cdots & 1 & x_{i-1} & 0 & \cdots & 0 \\
0 & 0 & \cdots & 0 & x_i & 0 & \cdots & 0 \\
0 & 0 & \cdots & 0 & x_{i+1} & 1 & \cdots & 0 \\
\vdots & \vdots & \ddots & \vdots & \vdots & \vdots & \ddots & \vdots \\
0 & 0 & \cdots & 0 & x_n & 0 & \cdots & 1
\end{bmatrix}
\end{aligned}\]
我們對 \(\bx\) 所在的那一行進行降階,很容易可以發現有只有一項非 \(0\),也就是對 \(x_i\) 做展開的時候,因此我們有 \(\det I_i(\bx) = x_i\det I = x_i\)。
因此得證克拉瑪公式 \(\displaystyle x_i = \det I_i(\bx) = \frac{\det A_i(\bb)}{\det(A)}\)。