# fcla / src / section-MO.xml

 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 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370
Matrix Operations

In this section we will back up and start simple. We begin with a definition of a totally general set of matrices, and see where that takes us.

Matrix Equality, Addition, Scalar Multiplication Vector Space of $m\times n$ Matrices

The vector space $M_{mn}$ is the set of all $m\times n$ matrices with entries from the set of complex numbers.

Vector Space of Matrices $M_{mn}$

Just as we made, and used, a careful definition of equality for column vectors, so too, we have precise definitions for matrices.

Matrix Equality

The $m\times n$ matrices $A$ and $B$ are equal, written $A=B$ provided $\matrixentry{A}{ij}=\matrixentry{B}{ij}$ for all $1\leq i\leq m$, $1\leq j\leq n$.

Matrix Equality $A=B$

So equality of matrices translates to the equality of complex numbers, on an entry-by-entry basis. Notice that we now have yet another definition that uses the symbol = for shorthand. Whenever a theorem has a conclusion saying two matrices are equal (think about your objects), we will consider appealing to this definition as a way of formulating the top-level structure of the proof.

We will now define two operations on the set $M_{mn}$. Again, we will overload a symbol (`+') and a convention (juxtaposition for scalar multiplication).

Given the $m\times n$ matrices $A$ and $B$, define the sum of $A$ and $B$ as an $m\times n$ matrix, written $A+B$, according to

Matrix Addition $A+B$

So matrix addition takes two matrices of the same size and combines them (in a natural way!) to create a new matrix of the same size. Perhaps this is the obvious thing to do, but it doesn't relieve us from the obligation to state it carefully.

Addition of two matrices in $M_{23}$

If A= \begin{bmatrix} \end{bmatrix} B= \begin{bmatrix} \end{bmatrix} then \begin{bmatrix} \end{bmatrix} + \begin{bmatrix} \end{bmatrix}\\ \begin{bmatrix} \end{bmatrix} =\begin{bmatrix} \end{bmatrix}

Our second operation takes two objects of different types, specifically a number and a matrix, and combines them to create another matrix. As with vectors, in this context we call a number a scalar in order to emphasize that it is not a matrix.

Matrix Scalar Multiplication

Given the $m\times n$ matrix $A$ and the scalar $\alpha\in\complex{\null}$, the scalar multiple of $A$ is an $m\times n$ matrix, written $\alpha A$ and defined according to \quad 1\leq i\leq m,\,1\leq j\leq n

Matrix Scalar Multiplication $\alpha A$

Notice again that we have yet another kind of multiplication, and it is again written putting two symbols side-by-side. Computationally, scalar matrix multiplication is very easy.

Scalar multiplication in $M_{32}$

If A= \begin{bmatrix} \end{bmatrix} and $\alpha=7$, then \alpha A=

Matrix Spaces Sage defines our set $M_{mn}$ as a matrix space with the command MatrixSpace(R, m, n) where R is a number system and m and n are the number of rows and number of columns, respectively. This object does not have much functionality defined in Sage. Its main purposes are to provide a parent for matrices, and to provide another way to create matrices. The two matrix operations just defined (addition and scalar multiplication) are implemented as you would expect. In the example below, we create two matrices in $M_{2,3}$ from just a list of 6 entries, by coercing the list into a matrix by using the relevant matrix space as if it were a function. Then we can perform the basic operations of matrix addition () and matrix scalar multiplication (). MS = MatrixSpace(QQ, 2, 3) MS Full MatrixSpace of 2 by 3 dense matrices over Rational Field A = MS([1, 2, 1, 4, 5, 4]) B = MS([1/1, 1/2, 1/3, 1/4, 1/5, 1/6]) A + B [ 2 5/2 4/3] [17/4 26/5 25/6] 60*B [60 30 20] [15 12 10] 5*A - 120*B [-115 -50 -35] [ -10 1 0] Coercion can make some interesting conveniences possible. Notice how the scalar 37 in the following expression is coerced to $37$ times an identity matrix of the proper size. A = matrix(QQ, [[ 0, 2, 4], [ 6, 0, 8], [10, 12, 0]]) A + 37 [37 2 4] [ 6 37 8] [10 12 37] This coercion only applies to sums with square matrices. You might try this again, but with a rectangular matrix, just to see what the error message says.
Vector Space Properties

With definitions of matrix addition and scalar multiplication we can now state, and prove, several properties of each operation, and some properties that involve their interplay. We now collect ten of them here for later reference.

Vector Space Properties of Matrices

Suppose that $M_{mn}$ is the set of all $m\times n$ matrices () with addition and scalar multiplication as defined in and . Then Additive Closure, Matrices If $A,\,B\in M_{mn}$, then $A+B\in M_{mn}$. Scalar Closure, Matrices If $\alpha\in\complex{\null}$ and $A\in M_{mn}$, then $\alpha A\in M_{mn}$. Commutativity, Matrices If $A,\,B\in M_{mn}$, then $A+B=B+A$. Additive Associativity, Matrices If $A,\,B,\,C\in M_{mn}$, then $A+\left(B+C\right)=\left(A+B\right)+C$. Zero Vector, Matrices There is a matrix, $\zeromatrix$, called the zero matrix, such that $A+\zeromatrix=A$ for all $A\in M_{mn}$. Additive Inverses, Matrices If $A\in M_{mn}$, then there exists a matrix $-A\in M_{mn}$ so that $A+(-A)=\zeromatrix$. Scalar Multiplication Associativity, Matrices If $\alpha,\,\beta\in\complex{\null}$ and $A\in M_{mn}$, then $\alpha(\beta A)=(\alpha\beta)A$. Distributivity across Matrix Addition, Matrices If $\alpha\in\complex{\null}$ and $A,\,B\in M_{mn}$, then $\alpha(A+B)=\alpha A+\alpha B$. Distributivity across Scalar Addition, Matrices If $\alpha,\,\beta\in\complex{\null}$ and $A\in M_{mn}$, then $(\alpha+\beta)A=\alpha A+\beta A$. One, Matrices If $A\in M_{mn}$, then $1A=A$.

While some of these properties seem very obvious, they all require proof. However, the proofs are not very interesting, and border on tedious. We'll prove one version of distributivity very carefully, and you can test your proof-building skills on some of the others. We'll give our new notation for matrix entries a workout here. Compare the style of the proofs here with those given for vectors in while the objects here are more complicated, our notation makes the proofs cleaner.

To prove , $(\alpha+\beta)A=\alpha A+\beta A$, we need to establish the equality of two matrices (see ). says we need to establish the equality of their entries, one-by-one. How do we do this, when we do not even know how many entries the two matrices might have? This is where the notation for matrix entries, given in , comes into play. Ready? Here we go.

For any $i$ and $j$, $1\leq i\leq m$, $1\leq j\leq n$, \text{}\\ \text{}\\ \text{}

There are several things to notice here. (1) Each equals sign is an equality of numbers. (2) The two ends of the equation, being true for any $i$ and $j$, allow us to conclude the equality of the matrices by . (3) There are several plus signs, and several instances of juxtaposition. Identify each one, and state exactly what operation is being represented by each.

For now, note the similarities between about matrices and about vectors.

The zero matrix described in this theorem, $\zeromatrix$, is what you would expect a matrix full of zeros.

Zero Matrix

The $m\times n$ zero matrix is written as $\zeromatrix=\zeromatrix_{m\times n}$ and defined by $\matrixentry{\zeromatrix}{ij}=0$, for all $1\leq i\leq m$, $1\leq j\leq n$.

Zero Matrix $\zeromatrix$
Transposes and Symmetric Matrices

We describe one more common operation we can perform on matrices. Informally, to transpose a matrix is to build a new matrix by swapping its rows and columns.

Transpose of a Matrix

Given an $m\times n$ matrix $A$, its transpose is the $n\times m$ matrix $\transpose{A}$ given by \matrixentry{\transpose{A}}{ij}=\matrixentry{A}{ji},\quad 1\leq i\leq n,\,1\leq j\leq m.

Transpose of a Matrix $\transpose{A}$
Transpose of a $3\times 4$ matrix

Suppose D= \begin{bmatrix} \end{bmatrix}.

We could formulate the transpose, entry-by-entry, using the definition. But it is easier to just systematically rewrite rows as columns (or vice-versa). The form of the definition given will be more useful in proofs. So we have \transpose{D}= \begin{bmatrix} \end{bmatrix}

It will sometimes happen that a matrix is equal to its transpose. In this case, we will call a matrix symmetric. These matrices occur naturally in certain situations, and also have some nice properties, so it is worth stating the definition carefully. Informally a matrix is symmetric if we can flip it about the main diagonal (upper-left corner, running down to the lower-right corner) and have it look unchanged.

Symmetric Matrix

The matrix $A$ is symmetric if $A=\transpose{A}$.

A symmetric $5\times 5$ matrix

The matrix E= \begin{bmatrix} \end{bmatrix} is symmetric.

You might have noticed that did not specify the size of the matrix $A$, as has been our custom. That's because it wasn't necessary. An alternative would have been to state the definition just for square matrices, but this is the substance of the next proof.

Before reading the next proof, we want to offer you some advice about how to become more proficient at constructing proofs. Perhaps you can apply this advice to the next theorem. Have a peek at now.

Symmetric Matrices are Square

Suppose that $A$ is a symmetric matrix. Then $A$ is square.

We start by specifying $A$'s size, without assuming it is square, since we are trying to prove that, so we can't also assume it. Suppose $A$ is an $m\times n$ matrix. Because $A$ is symmetric, we know by that $A=\transpose{A}$. So, in particular, requires that $A$ and $\transpose{A}$ must have the same size. The size of $\transpose{A}$ is $n\times m$. Because $A$ has $m$ rows and $\transpose{A}$ has $n$ rows, we conclude that $m=n$, and hence $A$ must be square by .

We finish this section with three easy theorems, but they illustrate the interplay of our three new operations, our new notation, and the techniques used to prove matrix equalities.

Transpose and Matrix Addition

Suppose that $A$ and $B$ are $m\times n$ matrices. Then $\transpose{(A+B)}=\transpose{A}+\transpose{B}$.

The statement to be proved is an equality of matrices, so we work entry-by-entry and use . Think carefully about the objects involved here, and the many uses of the plus sign. For $1\leq i\leq m$, $1\leq j\leq n$, \matrixentry{\transpose{(A+B)}}{ij} \text{}\\ \text{}\\ \text{}\\ \text{}

Since the matrices $\transpose{(A+B)}$ and $\transpose{A}+\transpose{B}$ agree at each entry, tells us the two matrices are equal.

Transpose and Matrix Scalar Multiplication

Suppose that $\alpha\in\complex{\null}$ and $A$ is an $m\times n$ matrix. Then $\transpose{(\alpha A)}=\alpha\transpose{A}$.

The statement to be proved is an equality of matrices, so we work entry-by-entry and use . Notice that the desired equality is of $n\times m$ matrices, and think carefully about the objects involved here, plus the many uses of juxtaposition. For $1\leq i\leq m$, $1\leq j\leq n$, \text{}\\ \text{}\\ \text{}\\ \text{}

Since the matrices $\transpose{(\alpha A)}$ and $\alpha\transpose{A}$ agree at each entry, tells us the two matrices are equal.

Transpose of a Transpose

Suppose that $A$ is an $m\times n$ matrix. Then $\transpose{\left(\transpose{A}\right)}=A$.

We again want to prove an equality of matrices, so we work entry-by-entry and use . For $1\leq i\leq m$, $1\leq j\leq n$, \matrixentry{\transpose{\left(\transpose{A}\right)}}{ij} \text{}\\ \text{}

Matrices and Complex Conjugation

As we did with vectors (), we can define what it means to take the conjugate of a matrix.

Complex Conjugate of a Matrix

Suppose $A$ is an $m\times n$ matrix. Then the conjugate of $A$, written $\conjugate{A}$ is an $m\times n$ matrix defined by \matrixentry{\conjugate{A}}{ij}=\conjugate{\matrixentry{A}{ij}}

Complex Conjugate of a Matrix $\conjugate{A}$
Complex conjugate of a matrix

If A= \begin{bmatrix} \end{bmatrix} then \conjugate{A}= \begin{bmatrix} \end{bmatrix}

The interplay between the conjugate of a matrix and the two operations on matrices is what you might expect.

Conjugation Respects Matrix Addition

Suppose that $A$ and $B$ are $m\times n$ matrices. Then $\conjugate{A+B}=\conjugate{A}+\conjugate{B}$.

For $1\leq i\leq m$, $1\leq j\leq n$, \matrixentry{\conjugate{A+B}}{ij} \text{}\\ \text{}\\ \text{}\\ \text{}\\ \text{}

Since the matrices $\conjugate{A+B}$ and $\conjugate{A}+\conjugate{B}$ are equal in each entry, says that $\conjugate{A+B}=\conjugate{A}+\conjugate{B}$.

Conjugation Respects Matrix Scalar Multiplication

Suppose that $\alpha\in\complex{\null}$ and $A$ is an $m\times n$ matrix. Then $\conjugate{\alpha A}=\conjugate{\alpha}\conjugate{A}$.

For $1\leq i\leq m$, $1\leq j\leq n$, \matrixentry{\conjugate{\alpha A}}{ij} \text{}\\ \text{}\\ \text{}\\ \text{}\\ \text{}

Since the matrices $\conjugate{\alpha A}$ and $\conjugate{\alpha}\conjugate{A}$ are equal in each entry, says that $\conjugate{\alpha A}=\conjugate{\alpha}\conjugate{A}$.

Conjugate of the Conjugate of a Matrix

Suppose that $A$ is an $m\times n$ matrix. Then $\conjugate{\left(\conjugate{A}\right)}=A$.

For $1\leq i\leq m$, $1\leq j\leq n$, \matrixentry{\conjugate{\left(\conjugate{A}\right)}}{ij} \text{}\\ \text{}\\ \text{}%

Since the matrices $\conjugate{\left(\conjugate{A}\right)}$ and $A$ are equal in each entry, says that $\conjugate{\left(\conjugate{A}\right)}=A$.

Finally, we will need the following result about matrix conjugation and transposes later.

Matrix Conjugation and Transposes

Suppose that $A$ is an $m\times n$ matrix. Then $\conjugate{\left(\transpose{A}\right)}=\transpose{\left(\conjugate{A}\right)}$.

For $1\leq i\leq m$, $1\leq j\leq n$, \matrixentry{\conjugate{\left(\transpose{A}\right)}}{ji} \text{}\\ \text{}\\ \text{}\\ \text{}\\

Since the matrices $\conjugate{\left(\transpose{A}\right)}$ and $\transpose{\left(\conjugate{A}\right)}$ are equal in each entry, says that $\conjugate{\left(\transpose{A}\right)}=\transpose{\left(\conjugate{A}\right)}$.

Adjoint of a Matrix

The combination of transposing and conjugating a matrix will be important in subsequent sections, such as and . We make a key definition here and prove some basic results in the same spirit as those above.

If $A$ is a matrix, then its adjoint is $\adjoint{A}=\transpose{\left(\conjugate{A}\right)}$.

Adjoint $\adjoint{A}$

You will see the adjoint written elsewhere variously as $A^H$, $A^\ast$ or $A^\dagger$. Notice that says it does not really matter if we conjugate and then transpose, or transpose and then conjugate.

Suppose $A$ and $B$ are matrices of the same size. Then $\adjoint{\left(A+B\right)}=\adjoint{A}+\adjoint{B}$.

\adjoint{\left(A+B\right)} \text{}\\ \text{}\\ \text{}\\ \text{}

Adjoint and Matrix Scalar Multiplication

Suppose $\alpha\in\complexes$ is a scalar and $A$ is a matrix. Then $\adjoint{\left(\alpha A\right)}=\conjugate{\alpha}\adjoint{A}$.

\adjoint{\left(\alpha A\right)} \text{}\\ \text{}\\ \text{}\\ \text{}

Suppose that $A$ is a matrix. Then $\adjoint{\left(\adjoint{A}\right)}=A$.

Take note of how the theorems in this section, while simple, build on earlier theorems and definitions and never descend to the level of entry-by-entry proofs based on . In other words, the equal signs that appear in the previous proofs are equalities of matrices, not scalars (which is the opposite of a proof like that of ).

Matrix Operations Every operation in this section is implemented in Sage. The only real subtlety is determining if certain matrices are symmetric, which we will discuss below. In linear algebra, the term adjoint has two unrelated meanings, so you need to be careful when you see this term. In particular, in Sage it is used to mean something different. So our version of the adjoint is implemented as the matrix method .conjugage_transpose(). Here are some straightforward examples. A = matrix(QQ, [[-1, 2, 4], [ 0, 3, 1]]) A [-1 2 4] [ 0 3 1] A.transpose() [-1 0] [ 2 3] [ 4 1] A.is_symmetric() False B = matrix(QQ, [[ 1, 2, -1], [ 2, 3, 4], [-1, 4, -6]]) B.is_symmetric() True C = matrix(QQbar, [[ 2-I, 3+4*I], [5+2*I, 6]]) C.conjugate() [2 + 1*I 3 - 4*I] [5 - 2*I 6] C.conjugate_transpose() [2 + 1*I 5 - 2*I] [3 - 4*I 6] With these constructions, we can test, or demonstrate, some of the theorems above. Of course, this does not make the theorems true, but is satisfying nonetheless. This can be an effective technique when you are learning new Sage commands or new linear algebra if your computations are not consistent with theorems, then your understanding of the linear algebra may be flawed, or your understanding of Sage may be flawed, or Sage may have a bug! Note in the following how we use comparison (==) between matrices as an implementation of matrix equality (). A = matrix(QQ, [[ 1, -1, 3], [-3, 2, 0]]) B = matrix(QQ, [[5, -2, 7], [1, 3, -2]]) C = matrix(QQbar, [[2+3*I, 1 - 6*I], [3, 5+2*I]]) A.transpose().transpose() == A True (A+B).transpose() == A.transpose() + B.transpose() True (2*C).conjugate() == 2*C.conjugate() True a = QQbar(3 + 4*I) acon = a.conjugate() (a*C).conjugate_transpose() == acon*C.conjugate_transpose() True The opposite is true you can use theorems to convert, or express, Sage code into alternative, but mathematically equivalent forms.

Here is the subtlety. With approximate numbers, such as in RDF and CDF, it can be tricky to decide if two numbers are equal, or if a very small number is zero or not. In these situations Sage allows us to specify a tolerance the largest number that can be effectively considered zero. Consider the following: A = matrix(CDF, [[1.0, 0.0], [0.0, 1.0]]) A [1.0 0.0] [0.0 1.0] A.is_symmetric() True A[0,1] = 0.000000000002 A [ 1.0 2e-12] [ 0.0 1.0] A.is_symmetric() False A[0,1] = 0.000000000001 A [ 1.0 1e-12] [ 0.0 1.0] A.is_symmetric() True Clearly the last result is not correct. This is because $0.000000000001 = 1.0\times 10^{-12}$ is small enough to be confused as equal to the zero in the other corner of the matrix. However, Sage will let us set our own idea of when two numbers are equal, by setting a tolerance on the difference between two numbers that will allow them to be considered equal. The default tolerance is set at $1.0\times 10^{-12}$. Here we use Sage's syntax for scientific notation to specify the tolerance. A = matrix(CDF, [[1.0, 0.0], [0.0, 1.0]]) A.is_symmetric() True A[0,1] = 0.000000000001 A.is_symmetric() True A.is_symmetric(tol=1.0e-13) False This is not a course in numerical linear algebra, even if that is a fascinating field of study. To concentrate on the main ideas of introductory linear algebra, whenever possible we will concentrate on number systems like the rational numbers or algebraic numbers where we can rely on exact results. If you are ever unsure if a number system is exact or not, just ask. QQ.is_exact() True RDF.is_exact() False
1. Perform the following matrix computation. (6) \begin{bmatrix} \end{bmatrix} + (-2) \begin{bmatrix} \end{bmatrix}
2. reminds you of what previous theorem? How strong is the similarity?
3. Compute the transpose of the matrix below. \begin{bmatrix} \end{bmatrix}
Let Let $\alpha = 4$ and $\beta = 1/2$. Perform the following calculations:\quad (1)~$A + B$,\quad (2)~$A + C$,\quad (3)~$\transpose{B} + C$,\quad (4)~$A + \transpose{B}$,\quad (5)~$\beta C$,\quad (6)~$4A - 3B$,\quad (7)~$\transpose{A} + \alpha C$,\quad (8)~$A + B - \transpose{C}$,\quad (9)~$4A + 2B - 5\transpose{C}$
1. $A + C$ is undefined; $A$ and $C$ are not the same size.
2. $A + \transpose{B}$ is undefined; $A$ and $\transpose{B}$ are not the same size.
Solve the given vector equation for $x$, or explain why no solution exists: = The given equation = is valid only if $4 - 3x = -2$. Thus, the only solution is $x = 2$. Solve the given matrix equation for $\alpha$, or explain why no solution exists: = The given equation \alpha\begin{bmatrix} \end{bmatrix} + \begin{bmatrix} \end{bmatrix}\\ \begin{bmatrix} \end{bmatrix} + \begin{bmatrix} \end{bmatrix}\\ \begin{bmatrix} \end{bmatrix} leads to the 6 equations in $\alpha$: The only value that solves all 6 equations is $\alpha = 3$, which is the solution to the original matrix equation. Solve the given matrix equation for $\alpha$, or explain why no solution exists: = The given equation \begin{bmatrix} \end{bmatrix} \alpha\begin{bmatrix} \end{bmatrix} + \begin{bmatrix} \end{bmatrix} = \begin{bmatrix} \end{bmatrix} gives a system of six equations in $\alpha$: Solving each of these equations, we see that the first three and the fifth all lead to the solution $\alpha = 2$, the fourth equation is true no matter what the value of $\alpha$, but the last equation is only solved by $\alpha = 7/4$. Thus, the system has no solution, and the original matrix equation also has no solution. Find $\alpha$ and $\beta$ that solve the following equation: = The given equation \begin{bmatrix} \end{bmatrix} \alpha \begin{bmatrix} \end{bmatrix} + \beta \begin{bmatrix} \end{bmatrix} = \begin{bmatrix} \end{bmatrix} gives a system of four equations in two variables Solving this linear system by row-reducing the augmnented matrix shows that $\alpha = 3$, $\beta = -2$ is the only solution.

In we defined the operations of vector addition and vector scalar multiplication in and . These two operations formed the underpinnings of the remainder of the chapter. We have now defined similar operations for matrices in and . You will have noticed the resulting similarities between and .

In Exercises M20M25, you will be asked to extend these similarities to other fundamental definitions and concepts we first saw in . This sequence of problems was suggested by .

Suppose $S=\set{B_1,\,B_2,\,B_3,\,\ldots,\,B_p}$ is a set of matrices from $M_{mn}$. Formulate appropriate definitions for the following terms and give an example of the use of each.
1. A linear combination of elements of $S$.
2. A relation of linear dependence on $S$, both trivial and non-trivial.
3. $S$ is a linearly independent set.
4. $\spn{S}$.
Show that the set $S$ is linearly independent in $M_{2,2}$. S=\set{ } Suppose there exist constants $\alpha$, $\beta$, $\gamma$, and $\delta$ so that Then, so that $\begin{bmatrix} \end{bmatrix} = \begin{bmatrix} \end{bmatrix}$. The only solution is then $\alpha = 0$, $\beta = 0$, $\gamma = 0$, and $\delta = 0$, so that the set $S$ is a linearly independent set of matrices. Determine if the set $S$ below is linearly independent in $M_{2,3}$. \set{ } Suppose that there exist constants $a_1$, $a_2$, $a_3$, $a_4$, and $a_5$ so that Then, we have the matrix equality () \begin{bmatrix} \end{bmatrix} which yields the linear system of equations By row-reducing the associated $6\times 5$ homogeneous system, we see that the only solution is $a_1 = a_2 = a_3 = a_4 = a_5 = 0$, so these matrices are a linearly independent subset of $M_{2,3}$. Determine if the matrix $A$ is in the span of $S$. In other words, is $A\in\spn{S}$? If so write $A$ as a linear combination of the elements of $S$. \begin{bmatrix} \end{bmatrix}\\ } The matrix $A$ is in the span of $S$, since Note that if we were to write a complete linear combination of all of the matrices in $S$, then the fourth matrix would have a zero coefficient. Suppose $Y$ is the set of all $3\times 3$ symmetric matrices (). Find a set $T$ so that $T$ is linearly independent and $\spn{T}=Y$. Since any symmetric matrix is of the form Any symmetric matrix is a linear combination of the linearly independent vectors in set $T$ below, so that $\spn{T} = Y$: T = \set{ } (Something to think about: How do we know that these matrices are linearly independent?) Define a subset of $M_{3,3}$ by U_{33}=\setparts{ A\in M_{3,3} }{ \matrixentry{A}{ij}=0\text{ whenever }i>j } Find a set $R$ so that $R$ is linearly independent and $\spn{R}=U_{33}$.
Prove of . Write your proof in the style of the proof of given in this section. For all $A,\,B\in M_{mn}$ and for all $1\leq i\leq m$, $1\leq i\leq n$, \matrixentry{A+B}{ij} \text{}\\ \text{} With equality of each entry of the matrices $A+B$ and $B+A$ being equal tells us the two matrices are equal. Prove of . Write your proof in the style of the proof of given in this section. Prove of . Write your proof in the style of the proof of given in this section. Prove of . Write your proof in the style of the proof of given in this section.

A matrix $A$ is skew-symmetric if $\transpose{A}=-A$ Exercises T30T37 employ this definition.

Prove that a skew-symmetric matrix is square. (Hint: study the proof of .) Prove that a skew-symmetric matrix must have zeros for its diagonal elements. In other words, if $A$ is skew-symmetric of size $n$, then $\matrixentry{A}{ii}=0$ for $1\leq i\leq n$. (Hint: carefully construct an example of a $3\times 3$ skew-symmetric matrix before attempting a proof.) Prove that a matrix $A$ is both skew-symmetric and symmetric if and only if $A$ is the zero matrix. (Hint: one half of this proof is very easy, the other half takes a little more work.) Suppose $A$ and $B$ are both skew-symmetric matrices of the same size and $\alpha,\,\beta\in\complexes$. Prove that $\alpha A + \beta B$ is a skew-symmetric matrix. Suppose $A$ is a square matrix. Prove that $A+\transpose{A}$ is a symmetric matrix. Suppose $A$ is a square matrix. Prove that $A-\transpose{A}$ is a skew-symmetric matrix. Suppose $A$ is a square matrix. Prove that there is a symmetric matrix $B$ and a skew-symmetric matrix $C$ such that $A=B+C$. In other words, any square matrix can be decomposed into a symmetric matrix and a skew-symmetric matrix (). (Hint: consider building a proof on and .) Prove that the decomposition in is unique (see ). (Hint: a proof can turn on .)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.