-
Notifications
You must be signed in to change notification settings - Fork 5
/
8.html
2167 lines (2031 loc) · 83.2 KB
/
8.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!doctype html>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>プログラマの為の数学勉強会</title>
<!-- For reveal.js -->
<link rel="stylesheet" href="lib/reveal/css/reveal.css">
<link rel="stylesheet" href="lib/reveal/css/theme/night.css">
<link rel="stylesheet" href="lib/reveal/lib/css/ir_black.css">
<!-- For Graphics -->
<link rel="stylesheet" href="css/graphics.css">
<style>
.reveal .chapter-title {
margin-top: 3em;
}
.reveal {
font-size: 32px;
line-height: 1.4em;
}
.reveal .slides {
text-align: left;
}
.reveal section img {
border: none;
background: 0;
margin-left: 1em;
margin-right: 1em;
box-shadow: none;
}
.reveal strong {
color: yellow;
}
.reveal sup {
font-size: 40%;
}
.reveal table {
margin-top: 0.5em;
margin-bottom: 0.5em;
border: 2px solid lightblue;
}
.reveal pre {
font-size: 0.7em;
}
.reveal pre code {
max-height: 600px;
}
.reveal .note {
font-size: 50%;
}
.reveal .controls div.navigate-up,
.reveal .controls div.navigate-down {
display: none;
}
.reveal .block {
border: solid 2px;
position: relative;
border-radius: 8px;
margin-top: 0.8em;
margin-bottom: 0.8em;
padding: 1em 0.8em 1em 0.8em;
}
.reveal .block:after {
content: "";
display: block;
clear: both;
height: 1px;
overflow: hidden;
}
.reveal .answer {
color: #111111;
}
.reveal .block h4 {
position: absolute;
top: -0.5em;
margin: 0 auto;
background: #111111;
font-weight: bold;
}
</style>
<!-- Setup libraries for RequireJS-->
<script src="lib/require.js"></script>
<script>
requirejs.config({
baseUrl: "js",
paths: {
d3: "../lib/d3/d3.v3.min",
numeric: "../lib/numeric-1.2.6",
MathJax: "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS_HTML"
},
shim: {
d3: { exports: "d3" },
numeric: { exports: "numeric" },
MathJax: { exports: "MathJax" }
}
});
</script>
<!-- Initialize MathJax -->
<script type="text/x-mathjax-config">
require(["MathJax"], function (MathJax){
MathJax.Hub.Register.StartupHook("AsciiMath Jax Config", function () {
var AM = MathJax.InputJax.AsciiMath.AM;
AM.symbols.push(
{input:"mathbi",tag:"mstyle",atname:"mathvariant",atval:"bold-italic",
output:"mathbi",tex:null,ttype:AM.TOKEN.UNARY}
);
});
MathJax.Hub.Config({
showProcessingMessages: false,
skipStartupTypeset: true,
tex2jax: {
inlineMath: [ ["\\(","\\)"] ],
displayMath: [ ["\\[","\\]"] ]
}
});
});
</script>
<script>
</script>
</head>
<body>
<div class="reveal">
<div class="slides">
<section style="text-align: center">
<h1> プログラマの為の<br>数学勉強会<br>第8回</h1>
<span>
(於)ワークスアプリケーションズ<br>
中村晃一<br>
2013年10月31日
</span>
</section>
<section>
<h2>謝辞</h2>
<p>
この会の企画・会場設備の提供をして頂きました<br>
㈱ ワークスアプリケーションズ様<br>
にこの場をお借りして御礼申し上げます。
</p>
</section>
<section>
<h2> この資料について </h2>
<p>
<ul>
<li> <a href="http://nineties.github.com/math-seminar">
http://nineties.github.com/math-seminar
</a>に置いてあります。 </li>
<li> SVGに対応したブラウザで見て下さい。主要なブラウザで古いバージョンでなければ大丈夫だと思います。</li>
<li> 内容の誤り、プログラムのバグは<a href="http://twitter.com/9_ties">@9_ties</a>かkoichi.nakamur AT gmail.comまでご連絡下さい。</li>
<li> サンプルプログラムはPythonで記述しています。 </li>
</ul>
</p>
</section>
<section>
<h2 class="chapter-title"> 行列式・逆行列 </h2>
</section>
<section>
<p>
前回,3つの行基本変形
</p>
<ul>
<li> \(P_{i,j}\): 第\(i\)行と第\(j\)行を入れ替える </li>
<li> \(Q_{i,c}\): 第\(i\)行を\(c \neq 0\)倍する </li>
<li> \(R_{i,j,c}\): 第\(i\)行を\(c\)倍したものを第\(j\)行に加える </li>
</ul>
<p>
を組み合わせて連立一次方程式を解くことが出来るという話をしました。
</p>
<p>
<strong>行列式</strong>とは,このような行列の変形に関して良い性質を持った量です。
連立一次方程式の可解性や,(来週やる)線型写像の性質など様々な分析に利用出来る便利な道具であると言えます。
</p>
</section>
<section>
<div class="block" style="border-color:pink;font-size:90%">
<h4 style="color:pink"> 行列式 </h4>
<p style="font-size:85%">
正方行列\(A\)に,スカラー値を対応させる関数\(\det\)が,
\[ \begin{aligned}
1. &\det E = 1 \\
2. &\det (\cdots, \mathbf{a}_i, \cdots, \mathbf{a}_j, \cdots) = - \det (\cdots, \mathbf{a}_j, \cdots, \mathbf{a}_i, \cdots) \\
3. &\det (\cdots, k\mathbf{a}_i + l\mathbf{a}'_i, \cdots) = k\det (\cdots, \mathbf{a}_i, \cdots) + l\det(\cdots, \mathbf{a}'_i, \cdots) \\
\end{aligned} \]
を満たすとき,<strong>\(\det A\)</strong>を\(A\)の<strong>行列式</strong>と言う。性質2,3はそれぞれ<strong>交代性</strong>,<strong>線型性</strong>と呼ばれる。
</p>
<p>
\[ \det A = |A| \]
とも書く。
</p>
</div>
<p style="font-size:80%">
交代性より,<strong>同じ列があったら行列式の値は\(0\)</strong>となります。
\[|\cdots, \mathbf{a}, \cdots, \mathbf{a}, \cdots| = -|\cdots, \mathbf{a}, \cdots, \mathbf{a}, \cdots|\ \Leftrightarrow\ \color{yellow}{|\cdots, \mathbf{a}, \cdots, \mathbf{a}, \cdots| = 0} \]
</p>
</section>
<section style="font-size:80%">
<p>
この行列式の3つの性質から,行列式の値を一意に計算する事が出来ます。
</p>
<p>
\[
\begin{vmatrix} 1 & 2 \\ 3 & 4 \end{vmatrix}
\]
を例に考えて見ましょう。
</p>
<p>
まず第1列を
\[ \begin{pmatrix} 1 \\ 3 \end{pmatrix} = \color{yellow}{\begin{pmatrix} 1 \\ 0 \end{pmatrix} + 3\begin{pmatrix} 0 \\ 1 \end{pmatrix}} \]
と分解して線型性を用いれば
\[
\begin{vmatrix} 1 & 2 \\ 3 & 4 \end{vmatrix} = \begin{vmatrix} \color{yellow}{1} & 2 \\ \color{yellow}{0} & 4 \end{vmatrix} + \color{yellow}{3}\begin{vmatrix} \color{yellow}{0} & 2 \\ \color{yellow}{1} & 4 \end{vmatrix}
\]
となります。(これは<strong>第一列に関する余因子展開</strong>と呼ばれます。)
</p>
</section>
<section style="font-size:80%">
<p>
続いて第2列を
\[ \begin{pmatrix} 2 \\ 4 \end{pmatrix} = \color{yellow}{2\begin{pmatrix} 1 \\ 0 \end{pmatrix} + 4\begin{pmatrix} 0 \\ 1 \end{pmatrix}} \]
と分解して線型性を用いれば
\[\begin{aligned}
\begin{vmatrix} 1 & 2 \\ 3 & 4 \end{vmatrix} &= \begin{vmatrix} 1 & 2 \\ 0 & 4 \end{vmatrix} + 3\begin{vmatrix} 0 & 2 \\ 1 & 4 \end{vmatrix} \\
&= \left\{\color{yellow}{2}\begin{vmatrix} 1 & \color{yellow}{1} \\ 0 & \color{yellow}{0} \end{vmatrix}+ \color{yellow}{4}\begin{vmatrix} 1 & \color{yellow}{0} \\ 0 & \color{yellow}{1} \end{vmatrix}\right\} + 3\left\{\color{yellow}{2}\begin{vmatrix} 0 & \color{yellow}{1} \\ 1 & \color{yellow}{0} \end{vmatrix}+ \color{yellow}{4}\begin{vmatrix} 0 & \color{yellow}{0} \\ 1 & \color{yellow}{1} \end{vmatrix}\right\}
\end{aligned} \]
となりますが,交代性より列が重複すると0なので
\[
\begin{vmatrix} 1 & 2 \\ 3 & 4 \end{vmatrix} = 4\begin{vmatrix} 1 & 0 \\ 0 & 1 \end{vmatrix} + 6\begin{vmatrix} 0 & 1 \\ 1 & 0 \end{vmatrix}
\]
となります。
</p>
</section>
<section style="font-size:90%">
<p>
次に列の並べ替えをして\(E\)に形に揃えます。交代性より,列を交換する度に符号が変化します。
\[
\begin{vmatrix} 1 & 2 \\ 3 & 4 \end{vmatrix} = 4\begin{vmatrix} 1 & 0 \\ 0 & 1 \end{vmatrix} - 6\begin{vmatrix} 1 & 0 \\ 0 & 1 \end{vmatrix}
\]
最後に\( \det E = 1\)を利用すれば
\[
\begin{vmatrix} 1 & 2 \\ 3 & 4 \end{vmatrix} = 4 - 6 = \color{yellow}{-2}
\]
が求める結果となります。
</p>
</section>
<section>
<p>
このように,行列式を計算する為には行列の列を
\[
\begin{aligned}
\begin{pmatrix} a_1\\a_2\\ \vdots \\a_n \end{pmatrix}
&=
a_1\begin{pmatrix} 1 \\ 0 \\ \vdots \\ 0 \end{pmatrix} +
a_2\begin{pmatrix} 0 \\ 1 \\ \vdots \\ 0 \end{pmatrix} + \cdots +
a_n\begin{pmatrix} 0 \\ 0 \\ \vdots \\ 1 \end{pmatrix} \\
&=
\color{yellow}{a_1\mathbf{e_1}+ a_2\mathbf{e_2}+\cdots+ a_n\mathbf{e_n}}
\end{aligned}
\]
と分解し線型性を用いて展開するという事を繰り返していきます。但し\(\mathbf{e}_i\)は第\(i\)成分が\(1\),それ以外が\(0\)のベクトルです。
</p>
<p>
展開結果には\(\mathbf{e}_1,\cdots,\mathbf{e}_n\)を1つずつ列に持つ項だけが残り,\(E\)の形にする為に必要な列の交換の回数だけ\(-1\)倍されるという事になります。
</p>
</section>
<section style="font-size:90%">
<div class="block" style="border-color:lightgreen">
<h4 style="color:lightgreen">練習問題</h4>
\[ \det \begin{pmatrix} a & b \\ c & d \end{pmatrix} \]
を求めて下さい。
</div>
<p class="fragment">
【答え】<br>
\[ \begin{aligned}
\begin{vmatrix} a & b \\ c & d \end{vmatrix}
&= | a\mathbf{e}_1 + c\mathbf{e}_2, b\mathbf{e}_1 + d\mathbf{e}_2 |\\
&= ad|\mathbf{e}_1,\mathbf{e}_2|+bc|\mathbf{e}_2,\mathbf{e}_1| \\
&= ad|\mathbf{e}_1,\mathbf{e}_2|-bc|\mathbf{e}_1,\mathbf{e}_2| \\
&= \color{yellow}{ad-bc}
\end{aligned} \]
</p>
</section>
<section style="font-size:80%">
<div class="block" style="border-color:lightgreen">
<h4 style="color:lightgreen">練習問題</h4>
\[ \det \begin{pmatrix} a & b & c \\ d & e & f \\ g & h & i\end{pmatrix} \]
を求めて下さい。
</div>
<p class="fragment" style="font-size:90%">
【答え】<br>
\[ \begin{aligned}
&\begin{vmatrix} a & b & c \\ d & e & f \\ g & h & i\end{vmatrix} = |a\mathbf{e}_1+d\mathbf{e}_2+g\mathbf{e}_3,b\mathbf{e}_1+e\mathbf{e}_2+h\mathbf{e}_3,c\mathbf{e}_1+f\mathbf{e}_2+i\mathbf{e}_3| \\
=&
aei|\mathbf{e}_1,\mathbf{e}_2,\mathbf{e}_3| +
ahf|\mathbf{e}_1,\mathbf{e}_3,\mathbf{e}_2| +
dbi|\mathbf{e}_2,\mathbf{e}_1,\mathbf{e}_3| +\\
&dhc|\mathbf{e}_2,\mathbf{e}_3,\mathbf{e}_1| +
gbf|\mathbf{e}_3,\mathbf{e}_1,\mathbf{e}_2| +
gec|\mathbf{e}_3,\mathbf{e}_2,\mathbf{e}_1| \\
=&
aei|\mathbf{e}_1,\mathbf{e}_2,\mathbf{e}_3|
-ahf|\mathbf{e}_1,\mathbf{e}_2,\mathbf{e}_3|
-dbi|\mathbf{e}_1,\mathbf{e}_2,\mathbf{e}_3| +\\
&dhc|\mathbf{e}_1,\mathbf{e}_2,\mathbf{e}_3| +
gbf|\mathbf{e}_1,\mathbf{e}_2,\mathbf{e}_3|
-gec|\mathbf{e}_1,\mathbf{e}_2,\mathbf{e}_3| \\
=&aei-afh+bfg-bdi+cdh-ceg
\end{aligned} \]
</p>
</section>
<section>
<p style="font-size:80%">
以上で見たことから以下の公式が成立します。
</p>
<div class="block" style="border-color:pink;font-size:90%">
<h4 style="color:pink"> 行列式の公式 </h4>
<p>
\(n\)次正方行列\(A\)に対して
\[ \det A = \sum \mathrm{sign}(i_1,\cdots,i_n) a_{i_1,1}a_{i_2,2}\cdots a_{i_n,n} \]
である。但し和は集合\(\{1,2,\cdots,n\}\)の全ての置換\((i_1,\cdots,i_n)\)に対して取る。
</p>
</div>
<p style="font-size:70%">
ここで,\(\mathrm{sign}(i_1, \cdots, i_n)\)は,\((i_1,\cdots,i_n)\)を\((1,\cdots,n)\)に並べ替える為に必要な二数の入れ替え(互換)の回数が偶数なら1,奇数なら-1です。
</p>
<p style="font-size:70%">
例えば\( \mathrm{sign}(2,3,1) = 1,\ \mathrm{sign}(3,2,1) = -1 \)といった具合です。
\[
\begin{aligned}
& (2, 3, 1) \ \xrightarrow{\text{1,2入れ替え}}\ (1, 3, 2)\ \xrightarrow{\text{2,3入れ替え}}\ (1, 2, 3) \qquad \text{(偶数回)}\\
& (3, 2, 1) \ \xrightarrow{\text{1,3入れ替え}}\ (1,2,3) \qquad\text{(奇数回)}
\end{aligned}
\]
</p>
</section>
<section>
<div class="block" style="border-color:lightgreen">
<h4 style="color:lightgreen">例題</h4>
公式を用いて
\[ \det A = \det \begin{pmatrix} a & b \\ c & d \end{pmatrix} \]
を求めてみます。
</div>
<p>
\(\{1,2\}\)の置換は\((1,2)\)と\((2,1)\)ですから
\[ \begin{aligned}
\det A &= \mathrm{sign}(1,2)a_{11}a_{22} + \mathrm{sign}(2,1)a_{21}a_{12} \\
&= a_{11}a_{22}-a_{12}a_{21} \\
&= ad-bc
\end{aligned}
\]
となります。
</p>
</section>
<section style="font-size:70%">
<div class="block" style="border-color:lightgreen">
<h4 style="color:lightgreen">練習問題</h4>
公式を用いて
\[ \det A = \det \begin{pmatrix} a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \\ a_{31} & a_{32} & a_{33}\end{pmatrix} \]
を求めて下さい。
</div>
<p class="fragment">
【答え】<br>
\[ \begin{aligned}
& \det A\\
= & \mathrm{sign}(1,2,3)a_{11}a_{22}a_{33} + \mathrm{sign}(1,3,2)a_{11}a_{32}a_{23} + \mathrm{sign}(2,1,3)a_{21}a_{12}a_{33} + \\
& \qquad \mathrm{sign}(2,3,1)a_{21}a_{32}a_{13} + \mathrm{sign}(3,1,2)a_{31}a_{12}a_{23} + \mathrm{sign}(3,2,1)a_{31}a_{22}a_{13} \\
= & a_{11}a_{22}a_{33} - a_{11}a_{32}a_{23} - a_{21}a_{12}a_{33} + a_{21}a_{32}a_{13} + a_{31}a_{12}a_{23} - a_{31}a_{22}a_{13} \\
\end{aligned} \]
</p>
</section>
<section style="font-size:80%">
<p>
公式
\[ \det A = \sum \mathrm{sign}(i_1,\cdots,i_n) a_{i_1,1}a_{i_2,2}\cdots a_{i_n,n} \]
より行と列を入れ替えた
\[ \det A = \sum \mathrm{sign}(i_1,\cdots,i_n) a_{1,i_1}a_{2,i_2}\cdots a_{n,i_n} \]
が成立する事も容易に示せます。\((i_1,\cdots,i_n)\)を並べ替えて\((1,\cdots,n)\)にする互換の回数と,
\((1,\cdots,n)\)を並べ替えて\((i_1,\cdots,i_n)\)にする互換の回数は当然等しいからです。
</p>
<p>
従って
</p>
<div class="block" style="border-color:pink;font-size:90%">
<h4 style="color:pink"> 転置行列の行列式 </h4>
\[ \det (A^T) = \det A \]
</div>
<p>
が成り立ちます。また,<strong>今まで列に対して行っていた全ての変形は行についても同様に行える</strong>という事になります。
</p>
</section>
<section style="font-size:80%">
<h2> 行基本変形と行列式 </h2>
<p>
ということで,3つの行基本変形と行列式の関係を述べる事が出来ます。
</p>
<ul>
<li> <strong> \(P_{i,j}\)を行うと\(-1\)倍</strong>
\[|\cdots, \mathbf{a}_i, \cdots, \mathbf{a}_j, \cdots| = - |\cdots, \mathbf{a}_j, \cdots, \mathbf{a}_i, \cdots|\]
</li>
<li> <strong> \(Q_{i,c}\)を行うと\(c\)倍</strong>
\[|\cdots, c\mathbf{a}_i, \cdots| = c |\cdots, \mathbf{a}_i, \cdots| \]
</li>
<li> <strong> \(R_{i,j,c}\)に関して不変 </strong>
\[ \begin{aligned}
&|\cdots, \mathbf{a}_i,\cdots,c\mathbf{a}_i+\mathbf{a}_j,\cdots| \\
= &c|\cdots, \mathbf{a}_i,\cdots,\mathbf{a}_i,\cdots| + |\cdots, \mathbf{a}_i,\cdots,\mathbf{a}_j,\cdots| \\
= &|\cdots, \mathbf{a}_i,\cdots,\mathbf{a}_j,\cdots|
\end{aligned}
\]
</li>
</ul>
</section>
<section>
<p>
例えば,
</p>
<p style="font-size:80%">
\[
\begin{aligned}
\left[\begin{array}{cc}
3& 1 \\
2& 4 \\
\end{array}\right]
&\xrightarrow{P_{1,2}}
\left[\begin{array}{cc}
2& 4 \\
3& 1 \\
\end{array}\right]
\xrightarrow{Q_{1,\frac{1}{2}}}
\left[\begin{array}{cc}
1& 2 \\
3& 1 \\
\end{array}\right]
\xrightarrow{R_{1,2,-3}}
\left[\begin{array}{cc}
1& 2 \\
0&-5 \\
\end{array}\right] \\
&\xrightarrow{Q_{2,-\frac{1}{5}}}
\left[\begin{array}{cc}
1& 2 \\
0& 1 \\
\end{array}\right]
\xrightarrow{R_{2,1,-2}}
\left[\begin{array}{cc}
1& 0 \\
0& 1 \\
\end{array}\right]
\end{aligned}
\]
という行基本変形の列に関して
\[ \begin{vmatrix}3 & 1 \\ 2 & 4\end{vmatrix} \times (-1) \times \frac12\times \left(-\frac15\right) = \begin{vmatrix} 1 & 0 \\ 0 & 1\end{vmatrix}\]
つまり
\[ \begin{vmatrix}3 & 1 \\ 2 & 4\end{vmatrix} = 10 \]
が成り立っています。
</p>
</section>
<section style="font-size:80%">
<p>
続いて,正方行列\(A,B\)の積の行列式
\[ \det (AB) \]
がどうなるか説明します。
</p>
<p>
二次の場合を考えてみましょう。
\[ \det \left(\begin{pmatrix} a & b \\ c & d \end{pmatrix}
\begin{pmatrix} e & f \\ g & h \end{pmatrix}\right) \]
ここで,
\[ \begin{pmatrix} a & b \\ c & d \end{pmatrix}
\begin{pmatrix} e & f \\ g & h \end{pmatrix} =
\left(
e\begin{pmatrix} a \\ c\end{pmatrix} + g\begin{pmatrix} b \\ d\end{pmatrix},
f\begin{pmatrix} a \\ c\end{pmatrix} + h\begin{pmatrix} b \\ d\end{pmatrix}
\right) \]
という分解が出来るので,
</p>
</section>
<section style="font-size:80%">
<p>
線型性・交代性を使えば
\[ \begin{aligned}
\left|\begin{pmatrix} a & b \\ c & d \end{pmatrix}
\begin{pmatrix} e & f \\ g & h \end{pmatrix}\right| &=
\left|
e\begin{pmatrix} a \\ c\end{pmatrix} + g\begin{pmatrix} b \\ d\end{pmatrix},
f\begin{pmatrix} a \\ c\end{pmatrix} + h\begin{pmatrix} b \\ d\end{pmatrix}
\right| \\
&= eh\begin{vmatrix}a&b\\c&d\end{vmatrix}
+fg\begin{vmatrix}b&a\\d&c\end{vmatrix} \\
&= eh\begin{vmatrix}a&b\\c&d\end{vmatrix}
-fg\begin{vmatrix}a&b\\c&d\end{vmatrix} \\
&= \begin{vmatrix}a&b\\c&d\end{vmatrix}\times(eh-fg) \\
&= (ad-bc)(eh-fg) \\
\end{aligned} \]
となり,
\[ \det(AB) = (\det A)(\det B) \]
が成立しています。
</p>
</section>
<section>
<p> 一般の場合も同様で,以下の性質が成立します。 </p>
<div class="block" style="border-color:pink;font-size:90%">
<h4 style="color:pink"> 行列積の行列式 </h4>
<p>
正方行列\(A,B\)に対して
\[ \det (AB) = (\det A)(\det B) \]
が成立する。
</p>
<p>
また,これより帰納的に
\[ \det A^n = (\det A)^n \]
となる。
</p>
</div>
</section>
<section style="font-size:90%">
<h2> 余因子展開 </h2>
<p>
行列式の計算に利用した
\[
\begin{vmatrix} 1 & \color{yellow}{2} & 3 \\ 4 & \color{yellow}{5} & 6 \\ 7 & \color{yellow}{8} & 9\end{vmatrix}
=
\color{yellow}{2}\begin{vmatrix} 1 & \color{yellow}{1} & 3 \\ 4 & \color{yellow}{0} & 6 \\ 7 & \color{yellow}{0} & 9\end{vmatrix} +
\color{yellow}{5}\begin{vmatrix} 1 & \color{yellow}{0} & 3 \\ 4 & \color{yellow}{1} & 6 \\ 7 & \color{yellow}{0} & 9\end{vmatrix} +
\color{yellow}{8}\begin{vmatrix} 1 & \color{yellow}{0} & 3 \\ 4 & \color{yellow}{0} & 6 \\ 7 & \color{yellow}{1} & 9\end{vmatrix}
\]
といった展開を<strong>余因子展開</strong>と言います。上は第2列に関する余因子展開です。
</p>
<p>
ここで\(\mathbf{e}_i\)で行列\(A\)の第\(j\)列を置き換えた物の行列式を<strong>第\((i,j)\)余因子</strong>と言い,\(A_{ij}\)と書くことにします。すると,上の式は
\[ |A| = a_{12}A_{12} + a_{22}A_{22} + a_{32}A_{32} \]
と書くことが出来ます。
</p>
</section>
<section style="font-size:80%">
<p>
ところで,余因子に関して
\[ \begin{aligned}
A_{23} &= \begin{vmatrix} 1 & 2 & \color{yellow}{0} & 4\\ \color{yellow}{5} & \color{yellow}{6} & \color{yellow}{1} & \color{yellow}{8} \\ 9 & 10 & \color{yellow}{0} & 12\\ 13 & 14 & \color{yellow}{0} & 16 \end{vmatrix}
= (-1)^{2+3}\begin{vmatrix}
1 & 2 & 4 &\color{yellow}{0}\\
9 & 10 & 12 &\color{yellow}{0}\\
13 & 14 & 16 &\color{yellow}{0}\\
\color{yellow}{5} & \color{yellow}{6} & \color{yellow}{8} &\color{yellow}{1}
\end{vmatrix} \\
&= (-1)^{2+3}\begin{vmatrix}
1 & 2 & 4 \\
9 & 10 & 12 \\
13 & 14 & 16 \\
\end{vmatrix}
\end{aligned}
\]
といった行列式のサイズの縮小が可能です。
</p>
<p>
\((-1)^{2+3}\)は第2行,第3列を第4行,第4列に移す際の符号の変化です。移した後は,第\((4,4)\)成分の1を含む項しか残らず,さらに\(\mathrm{sign}(i,j,k,4)=\mathrm{sign}(i,j,k)\)である事から最後の等式が成立します。
</p>
</section>
<section style="font-size:70%">
<div class="block" style="border-color:pink;font-size:90%">
<h4 style="color:pink"> 余因子・余因子展開 </h4>
<p>
正方行列\(A\)の第\(j\)列を\(\mathbf{e}_i\)に置き換えた行列の行列式を<strong>第\((i,j)\)余因子</strong>と言い,これは\(A\)から第\(i\)行と第\(j\)列を除去した行列の行列式を\((-1)^{i+j}\)倍した
\[
A_{ij} = (-1)^{i+j}\begin{vmatrix}
a_{11} & \cdots & a_{1,j-1} & a_{1,j+1} & \cdots & a_{1n}\\
\vdots & \ddots & \vdots & \vdots & \ddots & \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 & \ddots & \vdots & \vdots & \ddots & \vdots \\
a_{n1} & \cdots & a_{n,j-1} & a_{n,j+1} & \cdots & a_{nn}\\
\end{vmatrix}
\]
と等しい。
</p>
<p>
また,\(j=1,\cdots,n\)に対して
\[ \det A = \sum_i a_{ij} A_{ij} \]
が成立する。これを第\(j\)列に関する<strong>余因子展開</strong>と言う。
</p>
</div>
<p>
転置行列を考えれば,第\(i\)行に関する余因子展開\( \det A = \sum_i a_{ij} A_{ij} \)も成立します。
</p>
</section>
<section style="font-size:80%">
<div class="block" style="border-color:lightgreen">
<h4 style="color:lightgreen">例題</h4>
\[ \det A = \det \begin{pmatrix} 2 & 4 & 1 \\ 3 & 2 & 0 \\ 3 & 1 & 4 \end{pmatrix} \]
を余因子展開で求めてみます。
</div>
<p>
第3列に関して展開すれば
\[ \begin{aligned}
\det A &= a_{13}A_{13} + a_{23}A_{23} + a_{33}A_{33} \\
&= A_{13} + 4A_{33} \quad(\because a_{23} = 0) \\
&= (-1)^{1+3}\begin{vmatrix}
3 & 2 \\ 3 & 1
\end{vmatrix}
+
(-1)^{3+3}\times 4
\begin{vmatrix}
2 & 4 \\ 3 & 2
\end{vmatrix} \\
&= -3 + 4\times (-8) \\
&= -35
\end{aligned} \]
となります。別の列・行での展開もやってみて下さい。
</p>
</section>
<section style="font-size:80%">
<div class="block" style="border-color:lightgreen">
<h4 style="color:lightgreen">練習問題</h4>
<p>
\[
\det \begin{pmatrix}
2 & 0 & 1 & -1 \\
0 & 2 & 3 & 0 \\
2 & 0 & 1 & 2 \\
-2 & 1 & 0 & 3
\end{pmatrix} \]
を求めて下さい。0の多い行・列に関して余因子展開するのがポイントです。
</p>
</div>
<p class="fragment" style="font-size:80%">
【答え】<br>
\[ \begin{aligned}
& \begin{vmatrix}
2 & 0 & 1 & -1 \\
0 & 2 & 3 & 0 \\
2 & 0 & 1 & 2 \\
-2 & 1 & 0 & 3
\end{vmatrix}
=
2\begin{vmatrix}
2 & 1 & -1 \\
2 & 1 & 2 \\
-2 & 0 & 3
\end{vmatrix}
+
\begin{vmatrix}
2 & 1 & -1 \\
0 & 3 & 0 \\
2 & 1 & 2
\end{vmatrix} \\
= &
2\left\{
-\begin{vmatrix}2 & 2 \\ -2 & 3 \end{vmatrix}
+ \begin{vmatrix}2 & -1 \\ -2 & 3 \end{vmatrix}
\right\}
+ 3\begin{vmatrix}2 & -1 \\ 2 & 2 \end{vmatrix} \\
= &
2\times(-10+4)+3\times 6\\
= &6
\end{aligned} \]
</p>
</section>
<section>
<h2> 逆行列 </h2>
<div class="block" style="border-color:pink;font-size:90%">
<h4 style="color:pink"> 逆行列 </h4>
<p>
正方行列\(A\)に対して
\[ AX = XA = E \]
を満たす行列が存在するならば,\(X\)を\(A\)の<strong>逆行列</strong>と言う。
</p>
<p>
逆行列は存在するならば\(A\)に対して一意に定まるので,\(A\)の逆行列を
\[ \color{yellow}{A^{-1}} \]
と表記する。また,逆行列を持つ行列を<strong>正則行列</strong>と言う。
</p>
</div>
<p style="font-size:70%">
【一意性の証明】<br>
\( AX=XA=E \)と\( AY=YA=E \)が成立するならば
\[ AX=E\Rightarrow YAX=Y\Rightarrow EX=Y\Rightarrow X=Y\]
<span style="float:right">□</span> </p>
</p>
</section>
<section style="font-size:80%">
<p>
行列式の理論を用いて逆行列の公式を導きましょう。
</p>
<p>
例えば,
\[ A = \begin{pmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{pmatrix} \]
を第1列について余因子展開すると
\[
\begin{vmatrix} \color{yellow}{1} & 2 & 3 \\ \color{yellow}{4} & 5 & 6 \\ \color{yellow}{7} & 8 & 9\end{vmatrix}
=
\color{yellow}{1}\begin{vmatrix} \color{yellow}{1} & 2 & 3 \\ \color{yellow}{0} & 5 & 6 \\ \color{yellow}{0} & 8 & 9\end{vmatrix} +
\color{yellow}{4}\begin{vmatrix} \color{yellow}{0} & 2 & 3 \\ \color{yellow}{1} & 5 & 6 \\ \color{yellow}{0} & 8 & 9\end{vmatrix} +
\color{yellow}{7}\begin{vmatrix} \color{yellow}{0} & 2 & 3 \\ \color{yellow}{0} & 5 & 6 \\ \color{yellow}{1} & 8 & 9\end{vmatrix}
\]
つまり,\( a_{11}A_{11} + a_{21}A_{21} + a_{31}A_{31} = |A|\)が成り立ちます。第2列,第3列に関して展開しても同様なので
\[ \begin{aligned}
&a_{11}A_{11} + a_{21}A_{21} + a_{31}A_{31} = |A|\\
&a_{12}A_{12} + a_{22}A_{22} + a_{32}A_{32} = |A|\\
&a_{13}A_{13} + a_{23}A_{23} + a_{33}A_{33} = |A|\\
\end{aligned} \]
が成立します。
</p>
</section>
<section style="font-size:80%">
<p>
では,列の番号が揃っていない
\[ a_{1\color{yellow}{2}}A_{1\color{red}{1}} + a_{2\color{yellow}{2}}A_{2\color{red}{1}} + a_{3\color{yellow}{2}}A_{3\color{red}{1}} \]
などはどうなるでしょうか?
</p>
<p>
これは
\[
\color{yellow}{2}\begin{vmatrix} \color{yellow}{1} & 2 & 3 \\ \color{yellow}{0} & 5 & 6 \\ \color{yellow}{0} & 8 & 9\end{vmatrix} +
\color{yellow}{5}\begin{vmatrix} \color{yellow}{0} & 2 & 3 \\ \color{yellow}{1} & 5 & 6 \\ \color{yellow}{0} & 8 & 9\end{vmatrix} +
\color{yellow}{8}\begin{vmatrix} \color{yellow}{0} & 2 & 3 \\ \color{yellow}{0} & 5 & 6 \\ \color{yellow}{1} & 8 & 9\end{vmatrix}
=
\begin{vmatrix} \color{yellow}{2} & 2 & 3 \\ \color{yellow}{5} & 5 & 6 \\ \color{yellow}{8} & 8 & 9\end{vmatrix}
= 0
\]
となり,第2列が重複してしまうので\(0\)となります。
</p>
<p>
この様に
\[ a_{1i}A_{1j} + a_{2i}A_{2j} + a_{3i}A_{3j} \]
は\(i = j\)(列番号が同じ)なら\(|A|\),\(i \neq j\)(列番号が違う)なら\(0\)となります。
</p>
</section>
<section style="font-size:80%">
<p>
すると
\[
\begin{pmatrix}
A_{11} & A_{21} & A_{31} \\
A_{12} & A_{22} & A_{32} \\
A_{13} & A_{23} & A_{33} \\
\end{pmatrix}
\begin{pmatrix}
a_{11} & a_{12} & a_{13} \\
a_{21} & a_{22} & a_{23} \\
a_{31} & a_{32} & a_{33} \\
\end{pmatrix}
=
\begin{pmatrix}
|A| & 0 & 0 \\
0 & |A| & 0 \\
0 & 0 & |A| \\
\end{pmatrix}
\]
となります。つまり,\(|A| \neq 0\)であるならば
\[
\frac{1}{|A|}
\begin{pmatrix}
A_{11} & A_{21} & A_{31} \\
A_{12} & A_{22} & A_{32} \\
A_{13} & A_{23} & A_{33} \\
\end{pmatrix}
A
=
E
\]
となっています。行に関する余因子展開を考えれば,全く同様にして
\[
A
\cdot
\frac{1}{|A|}
\begin{pmatrix}
A_{11} & A_{21} & A_{31} \\
A_{12} & A_{22} & A_{32} \\
A_{13} & A_{23} & A_{33} \\
\end{pmatrix}
=
E
\]
も示されるので,逆行列が得られた事になります。
</p>
</section>
<section style="font-size:90%">
<div class="block" style="border-color:pink;font-size:90%">
<h4 style="color:pink"> 逆行列の公式 </h4>
<p>
\(A\)が正則である必要十分条件は\(\det A \neq 0\)であり
\[ A^{-1} = \frac{1}{\det A}(A_{ji})_{n,n} =
\frac{1}{\det A}
\begin{pmatrix}
A_{11} & A_{21} & \cdots & A_{n1} \\
A_{12} & A_{22} & \cdots & A_{n2} \\
\vdots & \vdots & \ddots & \vdots \\
A_{1n} & A_{2n} & \cdots & A_{nn} \\
\end{pmatrix} \]
となる。
</p>
</div>
<p style="font-size:80%">
十分性は前ページの通りです。また\(A\)が正則ならば
\[ AA^{-1} = E\ \Rightarrow\ (\det A)(\det A^{-1}) = \det E \neq 0 \]
なので\(\det A \neq 0\)である事が必要です。
</p>
</section>
<section style="font-size:80%">
<div class="block" style="border-color:lightgreen">
<h4 style="color:lightgreen">例題</h4>
\[ A = \begin{pmatrix} a & b \\ c & d \end{pmatrix} \]
の逆行列の公式を導いてみます。
</div>
<p>
まず,\(\det A = ad-bc\)です。そして
\[ \begin{aligned}
A_{11} &= (-1)^{1+1}|d| = d\\
A_{12} &= (-1)^{1+2}|c| = -c\\
A_{21} &= (-1)^{2+1}|b| = -b\\
A_{22} &= (-1)^{2+2}|a| = a
\end{aligned} \]
ですから\(ad-bc\neq 0\)の時
\[ A^{-1} = \frac{1}{ad-bc}\begin{pmatrix} A_{11} & A_{21} \\ A_{12} & A_{22} \end{pmatrix} = \color{yellow}{\frac{1}{ad-bc}\begin{pmatrix} d & -b \\ -c & a \end{pmatrix}} \]
</p>
</section>
<section style="font-size:70%">
<div class="block" style="border-color:lightgreen">
<h4 style="color:lightgreen">練習問題</h4>
\[ A = \begin{pmatrix} 1 & 2 & 0 \\ 2 & 1 & 3 \\ 0 & 0 & 1 \end{pmatrix} \]
の逆行列を公式で求めて下さい。
</div>
<p class="fragment">
まず\(\det A = -3\)で,
\[ \begin{aligned}
A_{11} &= 1\cdot1 - 3\cdot 0 = 1,\quad A_{12} = -(2\cdot 1-3\cdot 0) = -2,\quad A_{13} = 2\cdot 0 -1\cdot 0 = 0 \\
A_{21} &= -(2\cdot 1-0\cdot 0) = -2,\quad A_{22}=1\cdot 1-0\cdot 0=1,\quad A_{23} = 1\cdot 0-2\cdot 0 = 0 \\
A_{31} &= 2\cdot 3-0\cdot 1=6,\quad A_{32} = -(1\cdot 3-0\cdot 2)=-3,\quad A_{33} = 1\cdot 1-2\cdot 2 = -3
\end{aligned} \]
となりますから
\[ A^{-1} = -\frac{1}{3}\begin{pmatrix}
1 & -2 & 6 \\-2 & 1 & -3 \\0 & 0 & -3
\end{pmatrix}
=\color{yellow}{\begin{pmatrix}
-\frac13 & \frac23 & -2 \\
\frac23 & -\frac13 & 1 \\
0 & 0 & 1
\end{pmatrix}}
\]
</p>
</section>
<section style="font-size:80%">
<div class="block" style="border-color:pink;font-size:90%">
<h4 style="color:pink"> 逆行列の性質 </h4>
<p>
正方行列\(A,X\)に対して
\[ AX=E\ \Leftrightarrow\ XA=E \]
</p>
<p>
\(A\)が正則ならば\(A^{-1}\)も正則で
\[ (A^{-1})^{-1} = A \]
</p>
<p>
\(A,B\)が正則ならば\(AB\)も正則で
\[ (AB)^{-1} = B^{-1}A^{-1} \]
</p>
</div>
<p style="font-size:70%">
【証明】<br>
\(AX=E\)ならば\((\det A)(\det X)=1\neq 0\)より\(\det A\neq 0\)。よって\(A^{-1}\)が存在するので
\[ AX=E\Rightarrow A^{-1}AXA=A^{-1}A \Rightarrow XA=E \]
逆も同様。<br>
2つ目の命題は自明。3つ目は
\[ ABB^{-1}A^{-1} = AA^{-1} = E \]
であることより成立する。
</p>
</section>
<section style="font-size:80%">
<h2> 連立一次方程式の可解性 </h2>
<p>
連立一次方程式はいつでも唯一の解を持つわけではありません。例えば
\[ \left\{\begin{array}{c}
x + y = 1 \\
2x + 2y = 2
\end{array}\right.
\ \Leftrightarrow\
x + y = 1
\]
は無数の解を持ちますし,
\[ \left\{\begin{array}{c}
x + y = 1 \\
2x + 2y = 3
\end{array}\right.
\ \Leftrightarrow\
x + y = 1 = \frac{3}{2}
\]
は解を持ちません。
</p>
<p>
この様に,連立一次方程式は
</p>
<ul>
<li> 唯一の解を持つ </li>
<li> 無数の解を持つ </li>
<li> 解を持たない </li>
</ul>
<p>
の3つの場合があり,特に唯一解を持つ条件の判定は重要です。
</p>
</section>
<section style="font-size:80%">
<p>
まず,連立一次方程式
\[ A\mathbf{x} = \mathbf{b} \]
について\(A\)が正則ならば,両辺に\(A^{-1}\)を左から掛ければ
\[ \color{yellow}{\mathbf{x} = A^{-1}\mathbf{b}} \]
となります。つまり,
\[ \color{yellow}{\text{$A$が正則}\ \Rightarrow\ \text{$A\mathbf{x}=\mathbf{b}$が唯一解を持つ}} \]
が言えます。
</p>
<p>
次に\(A\mathbf{y}=0\)を満たす\(\mathbf{y}\neq 0\)が存在するとしましょう。すると
\[ A\mathbf{x} = \mathbf{b},\ A\mathbf{y} = 0\ \Rightarrow A(\mathbf{x}+\mathbf{y}) = \mathbf{b}\]
であり,\(\mathbf{x} \neq \mathbf{x}+\mathbf{y}\)ですから
\[ A\mathbf{y} = 0\text{が$0$でない解を持つ}\ \Rightarrow\ \text{$A\mathbf{x}=\mathbf{b}$が唯一解を持たない} \]
が成立します。さらに,次ページで示すように
\[ \text{$A$が正則でない}\ \Rightarrow\ A\mathbf{y}=0\text{が$0$でない解を持つ}\qquad\cdots(1) \]
なので,対偶を考えて
\[ \color{yellow}{\text{$A\mathbf{x}=\mathbf{b}$が唯一解を持つ}\ \Rightarrow\ \text{$A$が正則}} \]
も成立します。
</p>
</section>
<section style="font-size:55%">
<p>
数学的帰納法で証明します。
</p>
<p>
【証明】<br>
\((1,1)\)型行列については明らかに成立する。<br>
そこで\(n-1\)元連立一次方程式について(1)が成り立つと仮定し,\(n\)元連立一次方程式
\[
\left[\begin{array}{cccccc}
a_{11}&a_{12}&\cdots&a_{1n}&:& b_1 \\
a_{21}&a_{22}&\cdots&a_{2n}&:& b_2 \\
\vdots&\vdots&\ddots&\vdots&:&\vdots\\
a_{n1}&a_{n2}&\cdots&a_{nn}&:& b_n \\
\end{array}\right]
\]
について考える。ここで第1列が全て\(0\)なら\(x_1\)を自由に取れるので(1)が成立し,そうでないならばピボット行の交換によって\(a_{11}\neq 0\)と出来,前進消去によって
\[