2019年5月23日木曜日

数学 - Python - 線形代数学 - 行列式 - 行列式の存在(バンデルモンドの行列式、帰納法)

ラング線形代数学(上)(S.ラング (著)、芹沢 正三 (翻訳)、ちくま学芸文庫)の6章(行列式)、4(行列式の存在)、練習問題5の解答を求めてみる。

1. $\begin{array}{l}\mathrm{det}\left[\begin{array}{ccc}1& {x}_{1}& {x}_{1}^{2}\\ 1& {x}_{2}& {x}_{2}^{2}\\ 1& {x}_{3}& {x}_{3}^{2}\end{array}\right]\\ =\left({x}_{2}{x}_{3}^{2}-{x}_{2}^{2}{x}_{3}\right)-\left({x}_{1}{x}_{3}^{2}-{x}_{1}^{2}{x}_{3}\right)+\left({x}_{1}{x}_{2}^{2}-{x}_{1}^{2}{x}_{2}\right)\\ =\left({x}_{2}-{x}_{1}\right){x}_{3}^{2}+\left({x}_{1}^{2}-{x}_{2}^{2}\right){x}_{3}+{x}_{1}{x}_{2}\left({x}_{2}-{x}_{1}\right)\\ =\left({x}_{2}-{x}_{1}\right)\left({x}_{3}^{2}-\left({x}_{2}+{x}_{1}\right){x}_{3}+{x}_{1}{x}_{2}\right)\\ =\left({x}_{2}-{x}_{1}\right)\left({x}_{3}-{x}_{1}\right)\left({x}_{3}-{x}_{2}\right)\end{array}$

2. $\begin{array}{l}\mathrm{det}\left[\begin{array}{cccc}1& {x}_{1}& \dots & {x}_{1}^{n-1}\\ 1& {x}_{2}& \dots & {x}_{2}^{n-1}\\ & & \dots & \\ 1& {x}_{n}& \dots & {x}_{n}^{n-1}\end{array}\right]\\ =\mathrm{det}\left[\begin{array}{ccccc}1& 0& 0& \dots & 0\\ 1& {x}_{2}-{x}_{1}& {x}_{2}^{2}-{x}_{2}{x}_{1}& \dots & {x}_{2}^{n-1}-{x}_{2}^{n-2}{x}_{1}\\ & & & \dots & \\ 1& {x}_{n}-{x}_{1}& {x}_{n}^{2}-{x}_{n}{x}_{1}& \dots & {x}_{n}^{n-1}-{x}_{n}^{n-2}{x}_{1}\end{array}\right]\\ =\left({x}_{n}-{x}_{1}\right)\dots \left({x}_{2}-{x}_{1}\right)\mathrm{det}\left[\begin{array}{ccccc}1& 0& 0& \dots & 0\\ 1& 1& {x}_{2}& \dots & {x}_{2}^{n-2}\\ & & & \dots & \\ 1& 1& {x}_{n}& \dots & {x}_{n}^{n-2}\end{array}\right]\\ =\left({x}_{n}-{x}_{1}\right)\dots \left({x}_{2}-{x}_{1}\right){V}_{n-1}\end{array}$

よって、機の方より問題の等式は成り立つ。

(証明終)

コード

Python 3

#!/usr/bin/env python3
from sympy import pprint, symbols, Matrix

print('5.')

for n in range(1, 6):
A = Matrix([[symbols(f'x{i}') ** (j - 1) for j in range(1, n + 1)]
for i in range(1, n + 1)])
for o in [A, A.det().factor()]:
pprint(o)
print()


C:\Users\...>py sample5.py
5.
[1]

1

⎡1  x₁⎤
⎢     ⎥
⎣1  x₂⎦

-x₁ + x₂

⎡         2⎤
⎢1  x₁  x₁ ⎥
⎢          ⎥
⎢         2⎥
⎢1  x₂  x₂ ⎥
⎢          ⎥
⎢         2⎥
⎣1  x₃  x₃ ⎦

-(x₁ - x₂)⋅(x₁ - x₃)⋅(x₂ - x₃)

⎡         2    3⎤
⎢1  x₁  x₁   x₁ ⎥
⎢               ⎥
⎢         2    3⎥
⎢1  x₂  x₂   x₂ ⎥
⎢               ⎥
⎢         2    3⎥
⎢1  x₃  x₃   x₃ ⎥
⎢               ⎥
⎢         2    3⎥
⎣1  x₄  x₄   x₄ ⎦

(x₁ - x₂)⋅(x₁ - x₃)⋅(x₁ - x₄)⋅(x₂ - x₃)⋅(x₂ - x₄)⋅(x₃ - x₄)

⎡         2    3    4⎤
⎢1  x₁  x₁   x₁   x₁ ⎥
⎢                    ⎥
⎢         2    3    4⎥
⎢1  x₂  x₂   x₂   x₂ ⎥
⎢                    ⎥
⎢         2    3    4⎥
⎢1  x₃  x₃   x₃   x₃ ⎥
⎢                    ⎥
⎢         2    3    4⎥
⎢1  x₄  x₄   x₄   x₄ ⎥
⎢                    ⎥
⎢         2    3    4⎥
⎣1  x₅  x₅   x₅   x₅ ⎦

(x₁ - x₂)⋅(x₁ - x₃)⋅(x₁ - x₄)⋅(x₁ - x₅)⋅(x₂ - x₃)⋅(x₂ - x₄)⋅(x₂ - x₅)⋅(x₃ - x₄
)⋅(x₃ - x₅)⋅(x₄ - x₅)

C:\Users\...>