エレファント・ビジュアライザー調査記録

ビジュアルプログラミングで数式の変形を表すことを考えていくブロクです。

現代数学のエレファント(4)

逆行列

行列式を使って逆行列を表します。

 A = \begin{pmatrix}
a_{11} & a_{12} & \cdots & a_{1n} \\
a_{21} & a_{22} & \cdots & a_{2n} \\
 \vdots & \vdots & \ddots & \vdots \\
a_{n1} & a_{n2} & \cdots & a_{nn} \\
\end{pmatrix} x = \begin{pmatrix}
x_{1} \\
x_{2} \\
 \vdots \\
x_{n} \\
\end{pmatrix} y = \begin{pmatrix}
y_{1} \\
y_{2} \\
 \vdots \\
y_{n} \\
\end{pmatrix}
として  Ax = y、すなわち
 \begin{pmatrix}
a_{11} & a_{12} & \cdots & a_{1n} \\
a_{21} & a_{22} & \cdots & a_{2n} \\
 \vdots & \vdots & \ddots & \vdots \\
a_{n1} & a_{n2} & \cdots & a_{nn} \\
\end{pmatrix} \begin{pmatrix}
x_{1} \\
x_{2} \\
 \vdots \\
x_{n} \\
\end{pmatrix} = \begin{pmatrix}
y_{1} \\
y_{2} \\
 \vdots \\
y_{n} \\
\end{pmatrix} とします。

 E単位行列  E = (\delta_{ij}) = \begin{pmatrix}
1 & 0 & \cdots & 0 \\
0 & 1 & \cdots & 0 \\
 \vdots & \vdots & \ddots & \vdots \\
0 & 0 & \cdots & 1 \\
\end{pmatrix} とします。ここで  \delta_{ij}
 \delta_{ij} = \begin{cases} 0 & (i \ne j \ のとき) \\ 1 & (i = j \ のとき) \end{cases}
を表すものとします。 E i 列目を  e_i = \begin{pmatrix}
\delta_{1i} \\
\delta_{2i} \\
\vdots \\
\delta_{ni} \\
\end{pmatrix} = \begin{pmatrix}
0 \\
\vdots \\
0 \\
1 \\
0 \\
\vdots \\
0 \\
\end{pmatrix} ( i 行目が  1)とおきます。

 a_i = A e_i A i 列目となります。このとき  A = \begin{pmatrix} a_{1} & a_{2} & \cdots & a_{n} \end{pmatrix} のように書くことにします。

 Ax = y A e_i = a_i から
 \begin{eqnarray*}
 & & A \begin{pmatrix} e_{1} & \cdots & e_{k-1} & x & e_{k+1} & \cdots & e_{n} \end{pmatrix} \\
 & = & \begin{pmatrix} a_{1} & \cdots & a_{k-1} & y & a_{k+1} & \cdots & a_{n} \end{pmatrix}
\end{eqnarray*}
となります。この行列式を考えると
 \begin{eqnarray*}
 & & (\det A) \cdot (\det \begin{pmatrix} e_{1} & \cdots & e_{k-1} & x & e_{k+1} & \cdots & e_{n} \end{pmatrix}) \\
 & = & \det \begin{pmatrix} a_{1} & \cdots & a_{k-1} & y & a_{k+1} & \cdots & a_{n} \end{pmatrix}
\end{eqnarray*}
となって  \det \begin{pmatrix} e_{1} & \cdots & e_{k-1} & x & e_{k+1} & \cdots & e_{n} \end{pmatrix} = x_k なので  \det A \ne 0 のとき
 x_k = \cfrac{1}{\det A} \det \begin{pmatrix} a_{1} & \cdots & a_{k-1} & y & a_{k+1} & \cdots & a_{n} \end{pmatrix}
 x = \cfrac{1}{\det A} \begin{pmatrix}
\det \begin{pmatrix} y & a_{2} & \cdots & a_{n-1} & a_{n} \end{pmatrix} \\
\vdots \\
\det \begin{pmatrix} a_{1} & a_{2} & \cdots & a_{n-1} & y \end{pmatrix} \\
\end{pmatrix}
となります。

 A逆行列
 B = \begin{pmatrix}
b_{11} & b_{12} & \cdots & b_{1n} \\
b_{21} & b_{22} & \cdots & b_{2n} \\
 \vdots & \vdots & \ddots & \vdots \\
b_{n1} & b_{n2} & \cdots & b_{nn} \\
\end{pmatrix} とします。 b_i = B e_i とおくと  B = \begin{pmatrix} b_{1} & b_{2} & \cdots & b_{n} \end{pmatrix} となります。

 AB = E より  Ab_i = e_i となるので  \det A \ne 0 のとき
 b_i = \cfrac{1}{\det A} \begin{pmatrix}
\det \begin{pmatrix} e_i & a_{2} & \cdots & a_{n-1} & a_{n} \end{pmatrix} \\
\vdots \\
\det \begin{pmatrix} a_{1} & a_{2} & \cdots & a_{n-1} & e_i \end{pmatrix} \\
\end{pmatrix} となります。よって
 \begin{eqnarray*}
B & = & \begin{pmatrix} b_{1} & b_{2} & \cdots & b_{n} \end{pmatrix} \\
 & = & \cfrac{1}{\det A} \begin{pmatrix}
\det \begin{pmatrix} e_1 & a_{2} & \cdots & a_{n-1} & a_{n} \end{pmatrix} & \cdots &
\det \begin{pmatrix} e_n & a_{2} & \cdots & a_{n-1} & a_{n} \end{pmatrix} \\
\vdots & \ddots & \vdots \\
\det \begin{pmatrix} a_{1} & a_{2} & \cdots & a_{n-1} & e_1 \end{pmatrix} & \cdots &
\det \begin{pmatrix} a_{1} & a_{2} & \cdots & a_{n-1} & e_n \end{pmatrix} \\
\end{pmatrix}
\end{eqnarray*}
行列式で表すことができます。