Source

fcla / src / section-CRS.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
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
<?xml version="1.0" encoding="UTF-8" ?>
<section acro="CRS">
<title>Column and Row Spaces</title>

<!-- %%%%%%%%%% -->
<!-- % -->
<!-- %  Section CRS -->
<!-- %  Column and Row Spaces -->
<!-- % -->
<!-- %%%%%%%%%% -->
<introduction>
<p>A matrix-vector product (<acroref type="definition" acro="MVP" />) is a linear combination of the columns of the matrix and this allows us to connect matrix multiplication with systems of equations via <acroref type="theorem" acro="SLSLC" />.  Row operations are linear combinations of the rows of a matrix, and of course, reduced row-echelon form (<acroref type="definition" acro="RREF" />) is also intimately related to solving systems of equations.  In this section we will formalize these ideas with two key definitions of sets of vectors derived from a matrix.</p>

</introduction>

<subsection acro="CSSE">
<title>Column Spaces and Systems of Equations</title>

<p><acroref type="theorem" acro="SLSLC" /> showed us that there is a natural correspondence between solutions to linear systems and linear combinations of the columns of the coefficient matrix.  This idea motivates the following important definition.</p>

<definition acro="CSM" index="matrix!column space">
<title>Column Space of a Matrix</title>
<indexlocation index="column space!matrix" />
<p>Suppose that $A$ is an $m\times n$ matrix with columns $\set{\vectorlist{A}{n}}$.  Then the <define>column space</define> of $A$, written $\csp{A}$, is the subset of $\complex{m}$ containing all linear combinations of the columns of $A$,
<equation>
\csp{A}=\spn{\set{\vectorlist{A}{n}}}
</equation></p>

<notation acro="CSM" index="column space">
<title>Column Space of a Matrix</title>
<usage>$\csp{A}$</usage>
</notation>
</definition>

<p>Some authors refer to the column space of a matrix as the <define>range</define>, but we will reserve this term for use with linear transformations (<acroref type="definition" acro="RLT" />).</p>

<p>Upon encountering any new set, the first question we ask is what objects are in the set, and which objects are not?  Here's an example of one way to answer this question, and it will motivate a theorem that will then answer the question precisely.</p>

<example acro="CSMCS" index="column space!consistent systems">
<title>Column space of a matrix and consistent systems</title>

<p><acroref type="archetype" acro="D" /> and <acroref type="archetype" acro="E" /> are linear systems of equations, with an identical $3\times 4$ coefficient matrix, which we call $A$ here.  However, <acroref type="archetype" acro="D" /> is consistent, while <acroref type="archetype" acro="E" /> is not.  We can explain this difference by employing the column space of the matrix $A$.</p>

<p>The column vector of constants, $\vect{b}$, in <acroref type="archetype" acro="D" /> is
<equation>
\vect{b}=\colvector{8\\-12\\4}
</equation>
One solution to $\linearsystem{A}{\vect{b}}$, as listed, is
<equation>
\vect{x}=\colvector{7\\8\\1\\3}
</equation>
</p>

<p>By <acroref type="theorem" acro="SLSLC" />, we can summarize this solution as a linear combination of the columns of $A$ that equals $\vect{b}$,
<equation>
7\colvector{2\\-3\\1}+
8\colvector{1\\4\\1}+
1\colvector{7\\-5\\4}+
3\colvector{-7\\-6\\-5}=
\colvector{8\\-12\\4}=\vect{b}.
</equation>
</p>

<p>This equation says that $\vect{b}$ is a linear combination of the columns of $A$, and then by <acroref type="definition" acro="CSM" />, we can say that $\vect{b}\in\csp{A}$.</p>

<p>On the other hand, <acroref type="archetype" acro="E" /> is the linear system $\linearsystem{A}{\vect{c}}$, where the vector of constants is
<equation>
\vect{c}=\colvector{2\\3\\2}
</equation>
and this system of equations is inconsistent.  This means $\vect{c}\not\in\csp{A}$, for if it were, then it would equal a linear combination of the columns of $A$ and <acroref type="theorem" acro="SLSLC" /> would lead us to a solution of the system $\linearsystem{A}{\vect{c}}$.
</p>

</example>

<p>So if we fix the coefficient matrix, and vary the vector of constants, we can sometimes find consistent systems, and sometimes inconsistent systems.  The vectors of constants that lead to consistent systems are exactly the elements of the column space.  This is the content of the next theorem, and since it is an equivalence, it provides an alternate view of the column space.</p>

<theorem acro="CSCS" index="column space!consistent system">
<title>Column Spaces and Consistent Systems</title>
<statement>
<p>Suppose $A$ is an $m\times n$ matrix and $\vect{b}$ is a vector of size $m$.  Then $\vect{b}\in\csp{A}$ if and only if $\linearsystem{A}{\vect{b}}$ is consistent.</p>

</statement>

<proof>
<p><implyforward />  Suppose $\vect{b}\in\csp{A}$.  Then we can write $\vect{b}$ as some linear combination of the columns of $A$.  By <acroref type="theorem" acro="SLSLC" /> we can use the scalars from this linear combination to form a solution to  $\linearsystem{A}{\vect{b}}$, so this system is consistent.</p>

<p><implyreverse /> If $\linearsystem{A}{\vect{b}}$ is consistent, there is a solution that may be used with <acroref type="theorem" acro="SLSLC" /> to write $\vect{b}$ as a linear combination of the columns of $A$.  This qualifies $\vect{b}$ for membership in $\csp{A}$.
</p>

</proof>
</theorem>

<p>This theorem tells us that asking if the system $\linearsystem{A}{\vect{b}}$ is consistent is exactly the same question as asking if $\vect{b}$ is in the column space of $A$.  Or equivalently, it tells us that the column space of the matrix $A$ is precisely those vectors of constants, $\vect{b}$, that can be paired with $A$ to create a system of linear equations $\linearsystem{A}{\vect{b}}$ that is consistent.</p>

<p>Employing <acroref type="theorem" acro="SLEMM" /> we can form the chain of equivalences
<alignmath>
\vect{b}\in\csp{A}
\iff
\linearsystem{A}{\vect{b}}\text{ is consistent}
\iff
A\vect{x}=\vect{b}\text{ for some }\vect{x}
</alignmath>
</p>

<p>Thus, an alternative (and popular) definition of the column space of an $m\times n$ matrix $A$ is
<alignmath>
<![CDATA[\csp{A}&=]]>
\setparts{
\vect{y}\in\complex{m}
}{
\vect{y}=A\vect{x}\text{ for some }\vect{x}\in\complex{n}
}
=
\setparts{A\vect{x}}{\vect{x}\in\complex{n}}
\subseteq\complex{m}
</alignmath>
</p>

<p>We recognize this as saying create <em>all</em> the matrix vector products possible with the matrix $A$ by letting $\vect{x}$ range over all of the possibilities.  By <acroref type="definition" acro="MVP" /> we see that this means take all possible linear combinations of the columns of $A$ <mdash /> precisely the definition of the column space (<acroref type="definition" acro="CSM" />) we have chosen.</p>

<p>Notice how this formulation of the column space looks very much like the definition of the null space of a matrix (<acroref type="definition" acro="NSM" />), but for a rectangular matrix the column vectors of $\csp{A}$ and $\nsp{A}$ have different sizes, so the sets are very different.</p>

<p>Given a vector $\vect{b}$ and a matrix $A$ it is now very mechanical to test if $\vect{b}\in\csp{A}$.  Form the linear system $\linearsystem{A}{\vect{b}}$, row-reduce the augmented matrix, $\augmented{A}{\vect{b}}$, and test for consistency with <acroref type="theorem" acro="RCLS" />.  Here's an example of this procedure.</p>

<example acro="MCSM" index="column space!testing membership">
<title>Membership in the column space of a matrix</title>

<p>Consider the column space of the $3\times 4$ matrix $A$,
<equation>
A=
\begin{bmatrix}
<![CDATA[3 & 2 & 1 & -4\\]]>
<![CDATA[-1 & 1 & -2 & 3\\]]>
<![CDATA[2 & -4 & 6 & -8]]>
\end{bmatrix}
</equation>
</p>

<p>We first show that $\vect{v}=\colvector{18\\-6\\12}$ is in the column space of $A$, $\vect{v}\in\csp{A}$.  <acroref type="theorem" acro="CSCS" /> says we need only check the consistency of $\linearsystem{A}{\vect{v}}$.  Form the augmented matrix and row-reduce,
<equation>
\begin{bmatrix}
<![CDATA[3 & 2 & 1 & -4 & 18\\]]>
<![CDATA[-1 & 1 & -2 & 3 & -6\\]]>
<![CDATA[2 & -4 & 6 & -8 & 12]]>
\end{bmatrix}
\rref
\begin{bmatrix}
<![CDATA[\leading{1} & 0 & 1 & -2 & 6\\]]>
<![CDATA[0 & \leading{1} & -1 & 1 & 0\\]]>
<![CDATA[0 & 0 & 0 & 0 & 0]]>
\end{bmatrix}
</equation>
</p>

<p>Without a leading 1 in the final column, <acroref type="theorem" acro="RCLS" /> tells us the system is consistent and therefore by <acroref type="theorem" acro="CSCS" />, $\vect{v}\in\csp{A}$.</p>

<p>If we wished to demonstrate explicitly that $\vect{v}$ is a linear combination of the columns of $A$, we can find a solution (any solution) of $\linearsystem{A}{\vect{v}}$ and use <acroref type="theorem" acro="SLSLC" /> to construct the desired linear combination.  For example, set the free variables to $x_3=2$ and $x_4=1$.  Then a solution has $x_2=1$ and $x_1=6$.  Then by <acroref type="theorem" acro="SLSLC" />,
<equation>
\vect{v}=\colvector{18\\-6\\12}=
6\colvector{3\\-1\\2}+
1\colvector{2\\1\\-4}+
2\colvector{1\\-2\\6}+
1\colvector{-4\\3\\-8}
</equation>
</p>

<p>Now we show that $\vect{w}=\colvector{2\\1\\-3}$ is not in the column space of $A$, $\vect{w}\not\in\csp{A}$.  <acroref type="theorem" acro="CSCS" /> says we need only check the consistency of $\linearsystem{A}{\vect{w}}$.  Form the augmented matrix and row-reduce,
<equation>
\begin{bmatrix}
<![CDATA[3 & 2 & 1 & -4 & 2\\]]>
<![CDATA[-1 & 1 & -2 & 3 & 1\\]]>
<![CDATA[2 & -4 & 6 & -8 & -3]]>
\end{bmatrix}
\rref
\begin{bmatrix}
<![CDATA[\leading{1} & 0 & 1 & -2 & 0\\]]>
<![CDATA[0 & \leading{1} & -1 & 1 & 0\\]]>
<![CDATA[0 & 0 & 0 & 0 & \leading{1}]]>
\end{bmatrix}
</equation>
</p>

<p>With a leading 1 in the final column, <acroref type="theorem" acro="RCLS" /> tells us the system is inconsistent and therefore by <acroref type="theorem" acro="CSCS" />, $\vect{w}\not\in\csp{A}$.</p>

</example>

<sageadvice acro="CSCS" index="column space!consistent systems">
<title>Column Space and Consistent Systems</title>
We could compute the column space of a matrix with a span of the set of columns of the matrix, much as we did back in <acroref type="sage" acro="CSS" /> when we were checking consistency of linear systems using spans of the set of columns of a coeffiicent matrix.  However, Sage provides a convenient matrix method to construct this same span: <code>.column_space()</code>.  Here is a check.
<sage>
<input>D = matrix(QQ, [[ 2, -1, -4],
                [ 5,  2, -1],
                [-3,  1,  5]])
cs = D.column_space(); cs
</input>
<output>Vector space of degree 3 and dimension 2 over Rational Field
Basis matrix:
[    1     0 -11/9]
[    0     1  -1/9]
</output>
</sage>

<sage>
<input>cs_span = (QQ^3).span(D.columns())
cs == cs_span
</input>
<output>True
</output>
</sage>

In <acroref type="sage" acro="CSS" /> we discussed solutions to systems of equations and the membership of the vector of constants in the span of the columns of the coefficient matrix.  This discussion turned on <acroref type="theorem" acro="SLSLC" />.  We can now be slightly more efficient with <acroref type="theorem" acro="CSCS" />, while still using the same ideas.  We recycle the computations from <acroref type="example" acro="CSMCS" /> that use <acroref type="archetype" acro="D" /> and <acroref type="archetype" acro="E" />.
<sage>
<input>coeff = matrix(QQ, [[ 2, 1,  7, -7],
                    [-3, 4, -5, -6],
                    [ 1, 1,  4, -5]])
constD = vector(QQ, [8, -12, 4])
constE = vector(QQ, [2, 3, 2])
cs = coeff.column_space()
coeff.solve_right(constD)
</input>
<output>(4, 0, 0, 0)
</output>
</sage>

<sage>
<input>constD in cs
</input>
<output>True
</output>
</sage>

<sage>
<input>coeff.solve_right(constE)
</input>
<output>Traceback (most recent call last):
...
ValueError: matrix equation has no solutions
</output>
</sage>

<sage>
<input>constE in cs
</input>
<output>False
</output>
</sage>



</sageadvice>
<p><acroref type="theorem" acro="CSCS" /> completes a collection of three theorems, and one definition, that deserve comment.  Many questions about spans, linear independence, null space, column spaces and similar objects can be converted to questions about systems of equations (homogeneous or not), which we understand well from our previous results, especially those in <acroref type="chapter" acro="SLE" />.  These previous results include theorems like <acroref type="theorem" acro="RCLS" /> which allows us to quickly decide consistency of a system, and <acroref type="theorem" acro="BNS" /> which allows us to describe solution sets for homogeneous systems compactly as the span of a linearly independent set of column vectors.</p>

<p>The table below lists these four definitions and theorems along with a brief reminder of the statement and an example of how the statement is used.

<table>
<latex>\begin{tabular}{|r|l|}\hline\hline
\multicolumn{1}{|l}{<acroref type="definition" acro="NSM" />}<![CDATA[&]]>\\\hline
Synopsis<![CDATA[&]]>Null space is solution set of homogeneous system\\\hline
Example<![CDATA[&]]>General solution sets described by <acroref type="theorem" acro="PSPHS" />\\\hline\hline
\multicolumn{1}{|l}{<acroref type="theorem" acro="SLSLC" />}<![CDATA[&]]>\\\hline
Synopsis<![CDATA[&]]>Solutions for linear combinations with unknown scalars\\\hline
Example<![CDATA[&]]>Deciding membership in spans\\\hline\hline
\multicolumn{1}{|l}{<acroref type="theorem" acro="SLEMM" />}<![CDATA[&]]>\\\hline
Synopsis<![CDATA[&]]>System of equations represented by matrix-vector product\\\hline
Example<![CDATA[&]]>Solution to $\linearsystem{A}{\vect{b}}$ is $\inverse{A}\vect{b}$ when $A$ is nonsingular\\\hline\hline
\multicolumn{1}{|l}{<acroref type="theorem" acro="CSCS" />}<![CDATA[&]]>\\\hline
Synopsis<![CDATA[&]]>Column space vectors create consistent systems\\\hline
Example<![CDATA[&]]>Deciding membership in column spaces\\\hline\hline
\end{tabular}</latex>
<html>
<![CDATA[<table border="1" cellpadding="2" style="margin:auto;">
  <tr><td>Definition NSM</td><td></td></tr>
  <tr><td>Synopsis</td><td>Null space is solution set of homogeneous system</td></tr>
  <tr><td>Example </td><td>General solution sets described by Theorem PSPHS</td></tr>
  <!--    -->
  <tr><td>Theorem SLSLC</td><td></td></tr>
  <tr><td>Synopsis</td><td>Solutions for linear combinations with unknown scalars</td></tr>
  <tr><td>Example </td><td>Deciding membership in spans</td></tr>
  <!--    -->
  <tr><td>Theorem SLEMM</td><td></td></tr>
  <tr><td>Synopsis</td><td>System of equations represented by matrix-vector product</td></tr>
  <tr><td>Example </td><td>Solution to $\linearsystem{A}{\vect{b}}$ is $\inverse{A}\vect{b}$ when $A$ is nonsingular</td></tr>
  <!--    -->
  <tr><td>Theorem CSCS</td><td></td></tr>
  <tr><td>Synopsis</td><td>Column space vectors create consistent systems</td></tr>
  <tr><td>Example </td><td>Deciding membership in column spaces</td></tr>
  <!--    -->
</table>]]>
</html>
</table>


</p>

</subsection>

<subsection acro="CSSOC">
<title>Column Space Spanned by Original Columns</title>

<p>So we have a foolproof, automated procedure for determining membership in $\csp{A}$.  While this works just fine a vector at a time, we would like to have a more useful description of the set $\csp{A}$ as a whole.  The next example will preview the first of two fundamental results about the column space of a matrix.</p>

<example acro="CSTW" index="column space!two computations">
<title>Column space, two ways</title>

<p>Consider the $5\times 7$ matrix $A$,
<equation>
\begin{bmatrix}
<![CDATA[ 2 & 4 & 1 & -1 & 1 & 4 & 4 \\]]>
<![CDATA[ 1 & 2 & 1 & 0 & 2 & 4 & 7 \\]]>
<![CDATA[ 0 & 0 & 1 & 4 & 1 & 8 & 7 \\]]>
<![CDATA[ 1 & 2 & -1 & 2 & 1 & 9 & 6 \\]]>
<![CDATA[ -2 & -4 & 1 & 3 & -1 & -2 & -2]]>
\end{bmatrix}
</equation></p>

<p>According to the definition (<acroref type="definition" acro="CSM" />), the column space of $A$ is
<equation>
\csp{A}=
\spn{\set{
\colvector{ 2 \\ 1 \\ 0 \\ 1 \\ -2 },\,
\colvector{ 4 \\ 2 \\ 0 \\ 2 \\ -4 },\,
\colvector{ 1 \\ 1 \\ 1 \\ -1 \\ 1 },\,
\colvector{ -1 \\ 0 \\ 4 \\ 2 \\ 3 },\,
\colvector{ 1 \\ 2 \\ 1 \\ 1 \\ -1 },\,
\colvector{ 4 \\ 4 \\ 8 \\ 9 \\ -2 },\,
\colvector{ 4 \\ 7 \\ 7 \\ 6 \\ -2 }
}}
</equation></p>

<p>While this is a concise description of an infinite set, we might be able to describe the span with fewer than seven vectors.  This is the substance of <acroref type="theorem" acro="BS" />.  So we take these seven vectors and make them the columns of matrix, which is simply the original matrix $A$ again.  Now we row-reduce,
<equation>
\begin{bmatrix}
<![CDATA[ 2 & 4 & 1 & -1 & 1 & 4 & 4 \\]]>
<![CDATA[ 1 & 2 & 1 & 0 & 2 & 4 & 7 \\]]>
<![CDATA[ 0 & 0 & 1 & 4 & 1 & 8 & 7 \\]]>
<![CDATA[ 1 & 2 & -1 & 2 & 1 & 9 & 6 \\]]>
<![CDATA[ -2 & -4 & 1 & 3 & -1 & -2 & -2]]>
\end{bmatrix}
\rref
\begin{bmatrix}
<![CDATA[ \leading{1} & 2 & 0 & 0 & 0 & 3 & 1 \\]]>
<![CDATA[ 0 & 0 & \leading{1} & 0 & 0 & -1 & 0 \\]]>
<![CDATA[ 0 & 0 & 0 & \leading{1} & 0 & 2 & 1 \\]]>
<![CDATA[ 0 & 0 & 0 & 0 & \leading{1} & 1 & 3 \\]]>
<![CDATA[ 0 & 0 & 0 & 0 & 0 & 0 & 0]]>
\end{bmatrix}
</equation>
</p>

<p>The pivot columns are $D=\set{1,\,3,\,4,\,5}$, so we can create the set
<equation>
T=\set{
\colvector{ 2 \\ 1 \\ 0 \\ 1 \\ -2 },\,
\colvector{ 1 \\ 1 \\ 1 \\ -1 \\ 1 },\,
\colvector{ -1 \\ 0 \\ 4 \\ 2 \\ 3 },\,
\colvector{ 1 \\ 2 \\ 1 \\ 1 \\ -1 }
}
</equation>
and know that $\csp{A}=\spn{T}$ and $T$ is a linearly independent set of columns from the set of columns of $A$.</p>

</example>

<p>We will now formalize the previous example, which will make it trivial to determine a linearly independent set of vectors that will span the column space of a matrix, and is constituted of just columns of $A$.</p>

<theorem acro="BCS" index="column space!basis">
<title>Basis of the Column Space</title>
<statement>
<p>Suppose that $A$ is an $m\times n$ matrix with columns $\vectorlist{A}{n}$, and $B$ is a row-equivalent matrix in reduced row-echelon form with $r$ nonzero rows.  Let $D=\{d_1,\,d_2,\,d_3,\,\ldots,\,d_r\}$ be the set of column indices where $B$ has leading 1's.  Let
$T=\set{\vect{A}_{d_1},\,\vect{A}_{d_2},\,\vect{A}_{d_3},\,\ldots,\,\vect{A}_{d_r}}$.  Then
<ol><li> $T$ is a linearly independent set.
</li><li> $\csp{A}=\spn{T}$.
</li></ol>
</p>

</statement>

<proof>
<p><acroref type="definition" acro="CSM" /> describes the column space as the span of the set of columns of $A$.  <acroref type="theorem" acro="BS" /> tells us that we can reduce the set of vectors used in a span.  If we apply <acroref type="theorem" acro="BS" /> to $\csp{A}$, we would collect the columns of $A$ into a matrix (which would just be $A$ again) and bring the matrix to reduced row-echelon form, which is the matrix $B$ in the statement of the theorem.  In this case, the conclusions of <acroref type="theorem" acro="BS" /> applied to $A$,  $B$ and $\csp{A}$ are exactly the conclusions we desire.</p>

</proof>
</theorem>

<p>This is a nice result since it gives us a handful of vectors that describe the entire column space (through the span), and we believe this set is as small as possible because we cannot create any more relations of linear dependence to trim it down further.  Furthermore, we defined the column space (<acroref type="definition" acro="CSM" />) as all linear combinations of the columns of the matrix, and the elements of the set $T$ are still columns of the matrix (we won't be so lucky in the next two constructions of the column space).</p>

<p>Procedurally this theorem is extremely easy to apply.  Row-reduce the original matrix, identify $r$ columns with leading 1's in this reduced matrix, and grab the corresponding columns of the original matrix.  But it is still important to study the proof of <acroref type="theorem" acro="BS" /> and its motivation in <acroref type="example" acro="COV" /> which lie at the root of this theorem.  We'll trot through an example all the same.</p>

<example acro="CSOCD" index="column space!original columns,  Archetype D">
<title>Column space, original columns, Archetype D</title>

<indexlocation index="Archetype D!column space, original columns" />
<p>Let's determine a compact expression for the entire column space of the coefficient matrix of the system of equations that is <acroref type="archetype" acro="D" />.  Notice that in <acroref type="example" acro="CSMCS" /> we were only determining if individual vectors were in the column space or not, now we are describing the entire column space.</p>

<p>To start with the application of <acroref type="theorem" acro="BCS" />, call the coefficient matrix $A$
<equation>
A=<archetypepart acro="D" part="purematrix" /></equation>
and row-reduce it to reduced row-echelon form,
<equation>
B=<archetypepart acro="D" part="matrixreduced" /></equation>
</p>

<p>There are leading 1's in columns 1 and 2, so $D=\{1,\,2\}$.  To construct a set that spans $\csp{A}$, just grab the columns of $A$ indicated by the set $D$, so
<equation>
\csp{A}=\spn{\set{\colvector{2\\-3\\1},\,\colvector{1\\4\\1}}}.
</equation>
That's it.</p>

<p>In <acroref type="example" acro="CSMCS" /> we determined that the vector
<equation>
\vect{c}=\colvector{2\\3\\2}
</equation>
<em>was not</em> in the column space of $A$.  Try to write $\vect{c}$ as a linear combination of the first two columns of $A$.  What happens?</p>

<p>Also in <acroref type="example" acro="CSMCS" /> we determined that the vector
<equation>
\vect{b}=\colvector{8\\-12\\4}
</equation>
<em>was</em> in the column space of $A$.  Try to write $\vect{b}$ as a linear combination of the first two columns of $A$.  What happens?  Did you find a unique solution to this question?  Hmmmm.</p>

</example>

<sageadvice acro="CSOC" index="column space!original columns">
<title>Column Space, Original Columns</title>
It might be worthwhile for Sage to create a column space using actual columns of the matrix as a spanning set.  But we can do it ourselves fairly easily.  A discussion follows the example.
<sage>
<input>A = matrix(QQ, [[-1, -1, 0,  1,  0,  1, -2, -3, 0],
                [-1,  0, 0,  5, -2,  6, -6,  3, 5],
                [ 0,  0, 1, -6, -1,  0, -5,  0, 5],
                [ 2,  2, 1, -8, -2,  0, -4,  8, 8],
                [ 2,  2, 0, -2, -1,  0,  1,  8, 3],
                [ 2,  1, 0, -6, -1, -1, -1,  6, 4]])
A.rref()
</input>
<output>[ 1  0  0 -5  0 -2  0  1  1]
[ 0  1  0  4  0  1  2  2 -1]
[ 0  0  1 -6  0 -2 -2 -2  2]
[ 0  0  0  0  1 -2  3 -2 -3]
[ 0  0  0  0  0  0  0  0  0]
[ 0  0  0  0  0  0  0  0  0]
</output>
</sage>

<sage>
<input>B = A.matrix_from_columns(A.pivots())
A.column_space() == B.column_space()
</input>
<output>True
</output>
</sage>

<sage>
<input>B.rref()
</input>
<output>[1 0 0 0]
[0 1 0 0]
[0 0 1 0]
[0 0 0 1]
[0 0 0 0]
[0 0 0 0]
</output>
</sage>

<sage>
<input>cs = (QQ^6).span_of_basis(B.columns())
cs
</input>
<output>Vector space of degree 6 and dimension 4 over Rational Field
User basis matrix:
[-1 -1  0  2  2  2]
[-1  0  0  2  2  1]
[ 0  0  1  1  0  0]
[ 0 -2 -1 -2 -1 -1]
</output>
</sage>

<sage>
<input>cs.basis()
</input>
<output>[
(-1, -1, 0, 2, 2, 2),
(-1, 0, 0, 2, 2, 1),
(0, 0, 1, 1, 0, 0),
(0, -2, -1, -2, -1, -1)
]
</output>
</sage>

<sage>
<input>cs.echelonized_basis()
</input>
<output>[
(1, 0, 0, 0, 0, 5),
(0, 1, 0, 0, 0, -1),
(0, 0, 1, 0, -1, -3),
(0, 0, 0, 1, 1, 3)
]
</output>
</sage>

<sage>
<input>cs == A.column_space()
</input>
<output>True
</output>
</sage>

<sage>
<input>cs2 = (QQ^6).span_of_basis([A.column(i) for i in A.pivots()])
cs2 == A.column_space()
</input>
<output>True
</output>
</sage>

We see that <code>A</code> has four pivot columns, numbered <code>0,1,2,4</code>.  The matrix <code>B</code> is just a convenience to hold the pivot columns of <code>A</code>.  However, the column spaces of <code>A</code> and <code>B</code> should be equal, as Sage verifies.  Also <code>B</code> will row-reduce to the same 0-1 pivot columns of the reduced row-echelon form of the full matrix <code>A</code>.  So it is no accident that the reduced row-echelon form of <code>B</code> is a full identity matrix, followed by sufficiently many zero rows to give the matrix the correct size.<br /><br />
The vector space method <code>.span_of_basis()</code> is new to us.  It creates a span of a set of vectors, as before, but we now are responsible for supplying a linearly independent set of vectors.  Which we have done.  We know this because <acroref type="theorem" acro="BCS" /> guarantees the set we provided is linearly independent (and spans the column space), while Sage would have given us an error if we had provided a linearly dependent set.  In return, Sage will carry this linearly independent spanning set along with the vector space, something Sage calls a <q>user basis.</q><br /><br />
Notice how <code>cs</code> has two linearly independent spanning sets now.  Our set of <q>original columns</q> is obtained via the standard vector space method <code>.basis()</code> and we can obtain a linearly independent spanning set that looks more familiar with the vector space method <code>.echelonized_basis()</code>.  For a vector space created with a simple <code>.span()</code> construction these two commands would yield identical results <mdash /> it is only when we supply a linearly idependent spanning set with the <code>.span_of_basis()</code> method that a <q>user basis</q> becomes relevant.
Finally, we check that <code>cs</code> is indeed the column space of <code>A</code> (we knew it would be) and then we provide a one-line, totally general construction of the column space using original columns.
This is an opportunity to make an interesting observation, which could be used to substantiate several theorems.  When we take the original columns that we recognize as pivot columns, and use them alone to form a matrix, this new matrix <em>will always</em> row-reduce to an identity matrix followed by zero rows.  This is basically a consequence of reduced row-echelon form.  Evaluate the compute cell below repeatedly.  The number of columns could in theory change, though this is unlikely since the columns of a random matrix are unlikely to be linearly dependent.  In any event, the form of the result will always be an identity matrix followed by some zero rows.
<sage>
<input>F = random_matrix(QQ, 5, 3)
F.matrix_from_columns(F.pivots()).rref()   # random
</input>
<output>[1 0 0]
[0 1 0]
[0 0 1]
[0 0 0]
[0 0 0]
</output>
</sage>

With more columns than rows, we know by <acroref type="theorem" acro="MVSLD" /> that we will have a reduced number of pivot columns.  Here, we will almost always see an identity matrix as the result, though we could get a smaller identity matrix followed by zero rows.
<sage>
<input>F = random_matrix(QQ, 3, 5)
F.matrix_from_columns(F.pivots()).rref()   # random
</input>
<output>[1 0 0]
[0 1 0]
[0 0 1]
</output>
</sage>



</sageadvice>
</subsection>

<subsection acro="CSNM">
<title>Column Space of a Nonsingular Matrix</title>

<p>Let's specialize to square matrices and contrast the column spaces of the coefficient matrices in <acroref type="archetype" acro="A" /> and <acroref type="archetype" acro="B" />.</p>

<example acro="CSAA" index="column space!Archetype A">
<title>Column space of Archetype A</title>

<indexlocation index="Archetype A!column space" />
<p>The coefficient matrix in <acroref type="archetype" acro="A" /> is
<equation>
A=<archetypepart acro="A" part="purematrix" /></equation>
which row-reduces to
<equation>
<archetypepart acro="A" part="matrixreduced" /></equation></p>

<p>Columns 1 and 2 have leading 1's, so by <acroref type="theorem" acro="BCS" /> we can write
<equation>
\csp{A}=\spn{\set{\vect{A}_1,\,\vect{A}_2}}=\spn{\set{\colvector{1\\2\\1},\,\colvector{-1\\1\\1}}}.
</equation>
</p>

<p>We want to show in this example that $\csp{A}\neq\complex{3}$.  So take, for example, the vector $\vect{b}=\colvector{1\\3\\2}$.  Then there is no solution to the system $\linearsystem{A}{\vect{b}}$, or equivalently, it is not possible to write $\vect{b}$ as a linear combination of $\vect{A}_1$ and $\vect{A}_2$.  Try  one of these two computations yourself.  (Or try both!).  Since $\vect{b}\not\in\csp{A}$, the column space of $A$ cannot be all of $\complex{3}$.  So by varying the vector of constants, it is possible to create inconsistent systems of equations with this coefficient matrix (the vector $\vect{b}$ being one such example).</p>

<p>In <acroref type="example" acro="MWIAA" /> we wished to show that the coefficient matrix from <acroref type="archetype" acro="A" /> was not invertible as a first example of a matrix without an inverse.  Our device there was to find an inconsistent linear system with $A$ as the coefficient matrix.  The vector of constants in that example was $\vect{b}$, deliberately chosen outside the column space of $A$.</p>

</example>

<example acro="CSAB" index="column space!Archetype B">
<title>Column space of Archetype B</title>

<indexlocation index="Archetype B!column space" />
<p>The coefficient matrix in <acroref type="archetype" acro="B" />, call it $B$ here,  is known to be nonsingular (see <acroref type="example" acro="NM" />).  By <acroref type="theorem" acro="NMUS" />, the linear system $\linearsystem{B}{\vect{b}}$ has a (unique) solution for every choice of $\vect{b}$.  <acroref type="theorem" acro="CSCS" /> then says that $\vect{b}\in\csp{B}$ for all $\vect{b}\in\complex{3}$.  Stated differently, there is no way to build an inconsistent system with the coefficient matrix $B$, but then we knew that already from <acroref type="theorem" acro="NMUS" />.</p>

</example>

<p><acroref type="example" acro="CSAA" /> and <acroref type="example" acro="CSAB" /> together motivate the following equivalence, which says that nonsingular matrices have column spaces that are as big as possible.</p>

<theorem acro="CSNM" index="column space!nonsingular matrix">
<title>Column Space of a Nonsingular Matrix</title>
<statement>
<indexlocation index="nonsingular matrix!column space" />
<p>Suppose $A$ is a square matrix of size $n$.  Then $A$ is nonsingular if and only if $\csp{A}=\complex{n}$.</p>

</statement>

<proof>
<p><implyforward />  Suppose $A$ is nonsingular.  We wish to establish the set equality $\csp{A}=\complex{n}$.  By <acroref type="definition" acro="CSM" />, $\csp{A}\subseteq\complex{n}$.
To show that  $\complex{n}\subseteq\csp{A}$ choose $\vect{b}\in\complex{n}$.  By <acroref type="theorem" acro="NMUS" />, we know the linear system $\linearsystem{A}{\vect{b}}$ has a (unique) solution and therefore is consistent.  <acroref type="theorem" acro="CSCS" /> then says that $\vect{b}\in\csp{A}$.  So  by <acroref type="definition" acro="SE" />, $\csp{A}=\complex{n}$.</p>

<p><implyreverse />  If $\vect{e}_i$ is column $i$ of the $n\times n$ identity matrix (<acroref type="definition" acro="SUV" />) and by hypothesis $\csp{A}=\complex{n}$, then $\vect{e}_i\in\csp{A}$ for $1\leq i\leq n$.  By <acroref type="theorem" acro="CSCS" />, the system $\linearsystem{A}{\vect{e}_i}$ is consistent for $1\leq i\leq n$.   Let $\vect{b}_i$ denote any one particular solution to $\linearsystem{A}{\vect{e}_i}$, $1\leq i\leq n$.</p>

<p>Define the $n\times n$ matrix $B=\matrixcolumns{b}{n}$.  Then
<alignmath>
AB
<![CDATA[&=A\matrixcolumns{b}{n}\\]]>
<![CDATA[&=[A\vect{b}_1|A\vect{b}_2|A\vect{b}_3|\ldots|A\vect{b}_n]&&]]>\text{<acroref type="definition" acro="MM" />}\\
<![CDATA[&=\matrixcolumns{e}{n}\\]]>
<![CDATA[&=I_n&&]]>\text{<acroref type="definition" acro="SUV" />}\\
</alignmath></p>

<p>So the matrix $B$ is a <q>right-inverse</q> for $A$.  By <acroref type="theorem" acro="NMRRI" />, $I_n$ is a nonsingular matrix, so by <acroref type="theorem" acro="NPNT" /> both $A$ and $B$ are nonsingular.  Thus, in particular, $A$ is nonsingular.  (<contributorname code="travisosborne" /> contributed to this proof.)</p>

</proof>
</theorem>

<p>With this equivalence for nonsingular matrices we can update our list, <acroref type="theorem" acro="NME3" />.</p>

<theorem acro="NME4" index="nonsingular matrix!equivalences">
<title>Nonsingular Matrix Equivalences, Round 4</title>
<statement>
<p>Suppose that $A$ is a square matrix of size $n$.  The following are equivalent.
<ol><li> $A$ is nonsingular.
</li><li> $A$ row-reduces to the identity matrix.
</li><li> The null space of $A$ contains only the zero vector, $\nsp{A}=\set{\zerovector}$.
</li><li> The linear system $\linearsystem{A}{\vect{b}}$ has a unique solution for every possible choice of $\vect{b}$.
</li><li> The columns of $A$ are a linearly independent set.
</li><li> $A$ is invertible.
</li><li> The column space of $A$ is $\complex{n}$, $\csp{A}=\complex{n}$.
</li></ol>
</p>

</statement>

<proof>
<p>Since <acroref type="theorem" acro="CSNM" /> is an equivalence, we can add it to the list in <acroref type="theorem" acro="NME3" />.</p>

</proof>
</theorem>

<sageadvice acro="NME4" index="nonsingular matrices!round 4">
<title>Nonsingular Matrices, Round 4</title>
<acroref type="archetype" acro="A" /> and <acroref type="archetype" acro="B" /> have square coefficient matrices that illustrate the dichotomy of singular and nonsingular matrices.  Here we illustrate the latest addition to our series of equivalences, <acroref type="theorem" acro="CSNM" />.
<sage>
<input>A = matrix(QQ, [[1, -1, 2],
                [2,  1, 1],
                [1,  1, 0]])
B = matrix(QQ, [[-7, -6, -12],
                [ 5,  5,   7],
                [ 1,  0,   4]])
A.is_singular()
</input>
<output>True
</output>
</sage>

<sage>
<input>A.column_space() == QQ^3
</input>
<output>False
</output>
</sage>

<sage>
<input>B.is_singular()
</input>
<output>False
</output>
</sage>

<sage>
<input>B.column_space() == QQ^3
</input>
<output>True
</output>
</sage>

We can even write <acroref type="theorem" acro="CSNM" /> as a one-line Sage statement that will return <code>True</code> for <em>any</em> square matrix.  Run the following repeatedly and it should always return <code>True</code>.  We have kept the size of the matrix relatively small to be sure that some of the random matrices produced are singular.
<sage>
<input>A = random_matrix(QQ, 4, 4)
A.is_singular() == (not A.column_space() == QQ^4)
</input>
<output>True
</output>
</sage>



</sageadvice>
</subsection>

<subsection acro="RSM">
<title>Row Space of a Matrix</title>

<p>The rows of a matrix can be viewed as vectors, since they are just lists of numbers, arranged horizontally.  So we will transpose a matrix, turning rows into columns, so we can then manipulate rows as column vectors.  As a result we will be able to make some new connections between row operations and solutions to systems of equations.  OK, here is the second primary definition of this section.</p>

<definition acro="RSM" index="matrix!row space">
<title>Row Space of a Matrix</title>
<indexlocation index="row space!matrix" />
<p>Suppose $A$ is an $m\times n$ matrix.  Then the <define>row space</define> of $A$, $\rsp{A}$, is the column space of $\transpose{A}$, <ie /> $\rsp{A}=\csp{\transpose{A}}$.</p>

<notation acro="RSM" index="row space">
<title>Row Space of a Matrix</title>
<usage>$\rsp{A}$</usage>
</notation>
</definition>

<p>Informally, the row space is the set of all linear combinations of the rows of $A$.  However, we write the rows as column vectors, thus the necessity of using the transpose to make the rows into columns.   Additionally, with the row space defined in terms of the column space, all of the previous results of this section can be applied to row spaces.</p>

<p>Notice that if $A$ is a rectangular $m\times n$ matrix, then $\csp{A}\subseteq\complex{m}$, while $\rsp{A}\subseteq\complex{n}$ and the two sets are not comparable since they do not even hold objects of the same type.  However, when $A$ is square of size $n$, both $\csp{A}$ and $\rsp{A}$ are subsets of $\complex{n}$, though usually the sets will not be equal (but see <acroref type="exercise" acro="CRS.M20" />).</p>

<example acro="RSAI" index="row space!Archetype I">
<title>Row space of Archetype I</title>

<indexlocation index="Archetype I!row space" />
<p>The coefficient matrix in <acroref type="archetype" acro="I" /> is
<equation>
I=<archetypepart acro="I" part="purematrix" /></equation>
</p>

<p>To build the row space, we transpose the matrix,
<equation>
\transpose{I}=
\begin{bmatrix}
<![CDATA[1 & 2 & 0 & -1\\]]>
<![CDATA[4 & 8 & 0 & -4\\]]>
<![CDATA[0 & -1 & 2 & 2\\]]>
<![CDATA[-1 & 3 & -3 & 4\\]]>
<![CDATA[0 & 9 & -4 & 8\\]]>
<![CDATA[7 & -13 & 12 & -31\\]]>
<![CDATA[-9 & 7 & -8 & 37]]>
\end{bmatrix}
</equation>
</p>

<p>Then the columns of this matrix are used in a span to build the row space,
<equation>
\rsp{I}=\csp{\transpose{I}}=
\spn{\set{
\colvector{1\\4\\0\\-1\\0\\7\\-9},\,
\colvector{2\\8\\-1\\3\\9\\-13\\7},\,
\colvector{0\\0\\2\\-3\\-4\\12\\-8},\,
\colvector{-1\\-4\\2\\4\\8\\-31\\37}
}}.
</equation>
</p>

<p>However, we can use <acroref type="theorem" acro="BCS" /> to get a slightly better description.  First, row-reduce $\transpose{I}$,
<equation>
\begin{bmatrix}
<![CDATA[\leading{1} & 0 & 0 & -\frac{31}{7}\\]]>
<![CDATA[0 & \leading{1} & 0 & \frac{12}{7}\\]]>
<![CDATA[0 & 0 & \leading{1} & \frac{13}{7}\\]]>
<![CDATA[0 & 0 & 0 & 0\\]]>
<![CDATA[0 & 0 & 0 & 0\\]]>
<![CDATA[0 & 0 & 0 & 0\\]]>
<![CDATA[0 & 0 & 0 & 0]]>
\end{bmatrix}.
</equation>
</p>

<p>Since there are leading 1's in columns with indices $D=\set{1,\,2,\,3}$, the column space of $\transpose{I}$ can be spanned by just the first three columns of $\transpose{I}$,
<equation>
\rsp{I}=\csp{\transpose{I}}=
\spn{\set{
\colvector{1\\4\\0\\-1\\0\\7\\-9},\,
\colvector{2\\8\\-1\\3\\9\\-13\\7},\,
\colvector{0\\0\\2\\-3\\-4\\12\\-8}
}}.
</equation>
</p>

</example>

<p>The row space would not be too interesting if it was simply the column space of the transpose.  However, when we do row operations on a matrix we have no effect on the many linear combinations that can be formed with the rows of the matrix.  This is stated more carefully in the following theorem.</p>

<theorem acro="REMRS" index="row space!row-equivalent matrices">
<title>Row-Equivalent Matrices have equal Row Spaces</title>
<statement>
<indexlocation index="row-equivalent matrices!row space" />
<p>Suppose $A$ and $B$ are row-equivalent matrices.  Then $\rsp{A}=\rsp{B}$.</p>

</statement>

<proof>
<p>Two matrices are row-equivalent (<acroref type="definition" acro="REM" />) if one can be obtained from another by a sequence of (possibly many) row operations.  We will prove the theorem for two matrices that differ by a single row operation, and then this result can be applied repeatedly to get the full statement of the theorem.  The row spaces of $A$ and $B$ are spans of the columns of their transposes.  For each row operation we perform on a matrix, we can define an analogous operation on the columns.  Perhaps we should call these <define>column operations</define>.  Instead, we will still call them row operations, but we will apply them to the columns of the transposes.</p>

<p>Refer to the columns of $\transpose{A}$ and $\transpose{B}$ as $\vect{A}_i$ and $\vect{B}_i$, $1\leq i\leq m$.  The row operation that switches rows will just switch columns of the transposed matrices.  This will have no effect on the possible linear combinations formed by the columns.</p>

<p>Suppose that $\transpose{B}$ is formed from $\transpose{A}$ by multiplying column $\vect{A}_t$ by $\alpha\neq 0$.  In other words, $\vect{B}_t=\alpha\vect{A}_t$, and $\vect{B}_i=\vect{A}_i$ for all $i\neq t$.  We need to establish that two sets are equal, $\csp{\transpose{A}}=\csp{\transpose{B}}$.  We will take a generic element of one and show that it is contained in the other.
<alignmath>
\beta_1\vect{B}_1+
<![CDATA[&]]>
\beta_2\vect{B}_2+
\beta_3\vect{B}_3+
\cdots+
\beta_t\vect{B}_t+
\cdots+
\beta_m\vect{B}_m\\
<![CDATA[&=]]>
\beta_1\vect{A}_1+
\beta_2\vect{A}_2+
\beta_3\vect{A}_3+
\cdots+
\beta_t\left(\alpha\vect{A}_t\right)+
\cdots+
\beta_m\vect{A}_m\\
<![CDATA[&=]]>
\beta_1\vect{A}_1+
\beta_2\vect{A}_2+
\beta_3\vect{A}_3+
\cdots+
\left(\alpha\beta_t\right)\vect{A}_t+
\cdots+
\beta_m\vect{A}_m
</alignmath>
says that $\csp{\transpose{B}}\subseteq\csp{\transpose{A}}$.  Similarly,
<alignmath>
\gamma_1\vect{A}_1+
<![CDATA[&]]>
\gamma_2\vect{A}_2+
\gamma_3\vect{A}_3+
\cdots+
\gamma_t\vect{A}_t+
\cdots+
\gamma_m\vect{A}_m\\
<![CDATA[&=]]>
\gamma_1\vect{A}_1+
\gamma_2\vect{A}_2+
\gamma_3\vect{A}_3+
\cdots+
\left(\frac{\gamma_t}{\alpha}\alpha\right)\vect{A}_t+
\cdots+
\gamma_m\vect{A}_m\\
<![CDATA[&=]]>
\gamma_1\vect{A}_1+
\gamma_2\vect{A}_2+
\gamma_3\vect{A}_3+
\cdots+
\frac{\gamma_t}{\alpha}\left(\alpha\vect{A}_t\right)+
\cdots+
\gamma_m\vect{A}_m\\
<![CDATA[&=]]>
\gamma_1\vect{B}_1+
\gamma_2\vect{B}_2+
\gamma_3\vect{B}_3+
\cdots+
\frac{\gamma_t}{\alpha}\vect{B}_t+
\cdots+
\gamma_m\vect{B}_m
</alignmath>
says that $\csp{\transpose{A}}\subseteq\csp{\transpose{B}}$.   So $\rsp{A}=\csp{\transpose{A}}=\csp{\transpose{B}}=\rsp{B}$ when a single row operation of the second type is performed.</p>

<p>Suppose now that $\transpose{B}$ is formed from $\transpose{A}$ by replacing $\vect{A}_t$ with $\alpha\vect{A}_s+\vect{A}_t$ for some $\alpha\in\complex{\null}$ and $s\neq t$.  In other words, $\vect{B}_t=\alpha\vect{A}_s+\vect{A}_t$, and $\vect{B}_i=\vect{A}_i$ for $i\neq t$.
 %
<alignmath>
\beta_1\vect{B}_1+
<![CDATA[&]]>
\beta_2\vect{B}_2+
\cdots+
\beta_s\vect{B}_s+
\cdots+
\beta_t\vect{B}_t+
\cdots+
\beta_m\vect{B}_m\\
<![CDATA[&=]]>
\beta_1\vect{A}_1+
\beta_2\vect{A}_2+
\cdots+
\beta_s\vect{A}_s+
\cdots+
\beta_t\left(\alpha\vect{A}_s+\vect{A}_t\right)+
\cdots+
\beta_m\vect{A}_m\\
<![CDATA[&=]]>
\beta_1\vect{A}_1+
\beta_2\vect{A}_2+
\cdots+
\beta_s\vect{A}_s+
\cdots+
\left(\beta_t\alpha\right)\vect{A}_s+\beta_t\vect{A}_t+
\cdots+
\beta_m\vect{A}_m\\
<![CDATA[&=]]>
\beta_1\vect{A}_1+
\beta_2\vect{A}_2+
\cdots+
\beta_s\vect{A}_s+\left(\beta_t\alpha\right)\vect{A}_s+
\cdots+
\beta_t\vect{A}_t+
\cdots+
\beta_m\vect{A}_m\\
<![CDATA[&=]]>
\beta_1\vect{A}_1+
\beta_2\vect{A}_2+
\cdots+
\left(\beta_s+\beta_t\alpha\right)\vect{A}_s+
\cdots+
\beta_t\vect{A}_t+
\cdots+
\beta_m\vect{A}_m
</alignmath>
says that $\csp{\transpose{B}}\subseteq\csp{\transpose{A}}$.  Similarly,
<!--  Hidden ampersand in first term to make spacing just fit -->
<alignmath>
<![CDATA[\gamma_1&\vect{A}_1+]]>
\gamma_2\vect{A}_2+
\cdots+
\gamma_s\vect{A}_s+
\cdots+
\gamma_t\vect{A}_t+
\cdots+
\gamma_m\vect{A}_m\\
<![CDATA[&=]]>
\gamma_1\vect{A}_1+
\gamma_2\vect{A}_2+
\cdots+
\gamma_s\vect{A}_s+
\cdots+
\left(-\alpha\gamma_t\vect{A}_s + \alpha\gamma_t\vect{A}_s\right)+\gamma_t\vect{A}_t+
\cdots+
\gamma_m\vect{A}_m\\
<![CDATA[&=]]>
\gamma_1\vect{A}_1+
\gamma_2\vect{A}_2+
\cdots+
\left(-\alpha\gamma_t+\gamma_s\right)\vect{A}_s+
\cdots+
\gamma_t\left(\alpha\vect{A}_s+\vect{A}_t\right)+
\cdots+
\gamma_m\vect{A}_m\\
<![CDATA[&=]]>
\gamma_1\vect{B}_1+
\gamma_2\vect{B}_2+
\cdots+
\left(-\alpha\gamma_t+\gamma_s\right)\vect{B}_s+
\cdots+
\gamma_t\vect{B}_t+
\cdots+
\gamma_m\vect{B}_m
</alignmath>
says that $\csp{\transpose{A}}\subseteq\csp{\transpose{B}}$.  So $\rsp{A}=\csp{\transpose{A}}=\csp{\transpose{B}}=\rsp{B}$ when a single row operation of the third type is performed.</p>

<p>So the row space of a matrix is preserved by each row operation, and hence row spaces of row-equivalent matrices are equal sets.</p>

</proof>
</theorem>

<example acro="RSREM" index="row-equivalent matrices!row spaces">
<title>Row spaces of two row-equivalent matrices</title>

<p>In <acroref type="example" acro="TREM" /> we saw that the matrices
<alignmath>
<![CDATA[A&=\begin{bmatrix}]]>
<![CDATA[2&-1&3&4\\]]>
<![CDATA[5&2&-2&3\\]]>
<![CDATA[1&1&0&6]]>
\end{bmatrix}
<![CDATA[&]]>
<![CDATA[B&=\begin{bmatrix}]]>
<![CDATA[1&1&0&6\\]]>
<![CDATA[3&0&-2&-9\\]]>
<![CDATA[2&-1&3&4]]>
\end{bmatrix}
</alignmath>
are row-equivalent by demonstrating a sequence of two row operations that converted $A$ into $B$.  Applying <acroref type="theorem" acro="REMRS" /> we can say
<equation>
\rsp{A}=
\spn{\set{\colvector{2\\-1\\3\\4},\,\colvector{5\\2\\-2\\3},\,\colvector{1\\1\\0\\6}}}=
\spn{\set{\colvector{1\\1\\0\\6},\,\colvector{3\\0\\-2\\-9},\,\colvector{2\\-1\\3\\4}}}
=\rsp{B}
</equation></p>

</example>

<p><acroref type="theorem" acro="REMRS" /> is at its best when one of the row-equivalent matrices is in reduced row-echelon form.  The vectors that correspond to the zero rows can be ignored. (Who needs the zero vector when building a span? See <acroref type="exercise" acro="LI.T10" />.)  The echelon pattern insures that the nonzero rows yield vectors that are linearly independent.  Here's the theorem.</p>

<theorem acro="BRS" index="row space!basis">
<title>Basis for the Row Space</title>
<statement>
<p>Suppose that $A$ is a matrix and $B$ is a row-equivalent matrix in reduced row-echelon form.  Let $S$ be the set of nonzero columns of $\transpose{B}$.  Then
<ol><li> $\rsp{A}=\spn{S}$.
</li><li> $S$ is a linearly independent set.
</li></ol>
</p>

</statement>

<proof>
<p>From <acroref type="theorem" acro="REMRS" /> we know that $\rsp{A}=\rsp{B}$.  If $B$ has any zero rows, these correspond to columns of $\transpose{B}$ that are the zero vector.  We can safely toss out the zero vector in the span construction, since it can be recreated from the nonzero vectors by a linear combination where all the scalars are zero.  So $\rsp{A}=\spn{S}$.</p>

<p>Suppose $B$ has $r$ nonzero rows and let $D=\set{d_1,\,d_2,\,d_3,\,\ldots,\,d_r}$ denote the column indices of $B$ that have a leading one in them.  Denote the $r$ column vectors of $\transpose{B}$, the vectors in $S$, as $\vectorlist{B}{r}$.  To show that $S$ is linearly independent, start with a relation of linear dependence
<equation>
\lincombo{\alpha}{B}{r}=\zerovector
</equation>
</p>

<p>Now consider this vector equality in location $d_i$.  Since $B$ is in reduced row-echelon form, the entries of column $d_i$ of $B$ are all zero, except for a (leading) 1 in row $i$.  Thus, in $\transpose{B}$, row $d_i$ is all zeros, excepting a 1 in column $i$.   So, for $1\leq i\leq r$,
<alignmath>
0
<![CDATA[&=\vectorentry{\zerovector}{d_i}&&]]>\text{<acroref type="definition" acro="ZCV" />}\\
<![CDATA[&=\vectorentry{\lincombo{\alpha}{B}{r}}{d_i}]]>
<![CDATA[&&]]>\text{<acroref type="definition" acro="RLDCV" />}\\
<![CDATA[&=]]>
\vectorentry{\alpha_1\vect{B}_1}{d_i}+
\vectorentry{\alpha_2\vect{B}_2}{d_i}+
\vectorentry{\alpha_3\vect{B}_3}{d_i}+
\cdots+
\vectorentry{\alpha_r\vect{B}_r}{d_i}+
<![CDATA[&&]]>\text{<acroref type="definition" acro="MA" />}\\
<![CDATA[&=]]>
\alpha_1\vectorentry{\vect{B}_1}{d_i}+
\alpha_2\vectorentry{\vect{B}_2}{d_i}+
\alpha_3\vectorentry{\vect{B}_3}{d_i}+
\cdots+
\alpha_r\vectorentry{\vect{B}_r}{d_i}+
<![CDATA[&&]]>\text{<acroref type="definition" acro="MSM" />}\\
<![CDATA[&=]]>
\alpha_1(0)+
\alpha_2(0)+
\alpha_3(0)+
\cdots+
\alpha_i(1)+
\cdots+
\alpha_r(0)
<![CDATA[&&]]>\text{<acroref type="definition" acro="RREF" />}\\
<![CDATA[&=\alpha_i]]>
</alignmath>
</p>

<p>So we conclude that $\alpha_i=0$ for all $1\leq i\leq r$, establishing the linear independence of $S$  (<acroref type="definition" acro="LICV" />).</p>

</proof>
</theorem>

<example acro="IAS" index="span!improved">
<title>Improving a span</title>

<p>Suppose in the course of analyzing a matrix (its column space, its null space, its <ellipsis />) we encounter the following set of vectors, described by a span
<equation>
X=\spn{\set{
\colvector{1\\2\\1\\6\\6},\,
\colvector{3\\-1\\2\\-1\\6},\,
\colvector{1\\-1\\0\\-1\\-2},\,
\colvector{-3\\2\\-3\\6\\-10}
}}
</equation></p>

<p>Let $A$ be the matrix whose rows are the vectors in $X$, so by design $X=\rsp{A}$,
<equation>
A=
\begin{bmatrix}
<![CDATA[1 & 2 & 1 & 6 & 6\\]]>
<![CDATA[3 & -1 & 2 & -1 & 6\\]]>
<![CDATA[1 & -1 & 0 & -1 & -2\\]]>
<![CDATA[-3 & 2 & -3 & 6 & -10]]>
\end{bmatrix}
</equation>
</p>

<p>Row-reduce $A$ to form a row-equivalent matrix in reduced row-echelon form,
<equation>
B=
\begin{bmatrix}
<![CDATA[\leading{1} & 0 & 0 & 2 & -1\\]]>
<![CDATA[0 & \leading{1} & 0 & 3 & 1\\]]>
<![CDATA[0 & 0 & \leading{1} & -2 & 5\\]]>
<![CDATA[0 & 0 & 0 & 0 & 0]]>
\end{bmatrix}
</equation>
</p>

<p>Then <acroref type="theorem" acro="BRS" /> says we can grab the nonzero columns of $\transpose{B}$ and write
<equation>
X=\rsp{A}=\rsp{B}=
\spn{\set{
\colvector{1\\0\\0\\2\\-1},\,
\colvector{0\\1\\0\\3\\1},\,
\colvector{0\\0\\1\\-2\\5}
}}
</equation>
</p>

<p>These three vectors provide a much-improved description of $X$.  There are fewer vectors, and the pattern of zeros and ones in the first three entries makes it easier to determine membership in $X$.  And all we had to do was row-reduce the right matrix and toss out a zero row.  Next to row operations themselves, <em>this is probably the most powerful computational technique at your disposal</em> as it quickly provides a much improved description of a span, any span.</p>

</example>

<p><acroref type="theorem" acro="BRS" /> and the techniques of <acroref type="example" acro="IAS" /> will provide yet another description of the column space of a matrix.  First we state a triviality as a theorem, so we can reference it later.</p>

<theorem acro="CSRST" index="column space!as row space">
<title>Column Space, Row Space, Transpose</title>
<statement>
<indexlocation index="row space!as column space" />
<p>Suppose $A$ is a matrix.  Then $\csp{A}=\rsp{\transpose{A}}$.</p>

</statement>

<proof>
<p><alignmath>
\csp{A}
<![CDATA[&=\csp{\transpose{\left(\transpose{A}\right)}}]]>
<![CDATA[&&]]>\text{<acroref type="theorem" acro="TT" />}\\
<![CDATA[&=\rsp{\transpose{A}}]]>
<![CDATA[&&]]>\text{<acroref type="definition" acro="RSM" />}
</alignmath>
</p>

</proof>
</theorem>

<p>So to find another expression for the column space of a matrix, build its transpose, row-reduce it, toss out the zero rows, and convert the nonzero rows to column vectors to yield an improved set for the span construction.  We'll do <acroref type="archetype" acro="I" />, then you do <acroref type="archetype" acro="J" />.</p>

<example acro="CSROI" index="column space!row operations, Archetype I">
<title>Column space from row operations, Archetype I</title>

<indexlocation index="Archetype I!column space from row operations" />
<p>To find the column space of the coefficient matrix of <acroref type="archetype" acro="I" />, we proceed as follows.  The matrix is
<equation>
I=<archetypepart acro="I" part="purematrix" /></equation>
The transpose is
<equation>
\begin{bmatrix}
<![CDATA[1 & 2 & 0 & -1\\]]>
<![CDATA[4 & 8 & 0 & -4\\]]>
<![CDATA[0 & -1 & 2 & 2\\]]>
<![CDATA[-1 & 3 & -3 & 4\\]]>
<![CDATA[0 & 9 & -4 & 8\\]]>
<![CDATA[7 & -13 & 12 & -31\\]]>
<![CDATA[-9 & 7 & -8 & 37]]>
\end{bmatrix}.
</equation></p>

<p>Row-reduced this becomes,
<equation>
\begin{bmatrix}
<![CDATA[\leading{1} & 0 & 0 & -\frac{31}{7}\\]]>
<![CDATA[0 & \leading{1} & 0 & \frac{12}{7}\\]]>
<![CDATA[0 & 0 & \leading{1} & \frac{13}{7}\\]]>
<![CDATA[0 & 0 & 0 & 0\\]]>
<![CDATA[0 & 0 & 0 & 0\\]]>
<![CDATA[0 & 0 & 0 & 0\\]]>
<![CDATA[0 & 0 & 0 & 0]]>
\end{bmatrix}.
</equation>
</p>

<p>Now, using <acroref type="theorem" acro="CSRST" /> and <acroref type="theorem" acro="BRS" />
<equation>
\csp{I}=\rsp{\transpose{I}}=
\spn{\set{
\colvector{1\\0\\0\\-\frac{31}{7}},\,
\colvector{0\\1\\0\\\frac{12}{7}},\,
\colvector{0\\0\\1\\\frac{13}{7}}
}}.
</equation>
</p>

<p>This is a very nice description of the column space.  Fewer vectors than the 7 involved in the definition, and the pattern of the zeros and ones in the first 3 slots can be used to advantage.  For example, <acroref type="archetype" acro="I" /> is presented as a consistent system of equations with a vector of constants
<equation>
\vect{b}=\colvector{3\\9\\1\\4}.
</equation>
</p>

<p>Since $\linearsystem{I}{\vect{b}}$ is consistent, <acroref type="theorem" acro="CSCS" /> tells us that $\vect{b}\in\csp{I}$.  But we could see this quickly with the following computation, which really only involves any work in the 4th entry of the vectors as the scalars in the linear combination are <em>dictated</em> by the first three entries of $\vect{b}$.
<equation>
\vect{b}=\colvector{3\\9\\1\\4}=
3\colvector{1\\0\\0\\-\frac{31}{7}}+
9\colvector{0\\1\\0\\\frac{12}{7}}+
1\colvector{0\\0\\1\\\frac{13}{7}}
</equation>
</p>

<p>Can you now rapidly construct several vectors, $\vect{b}$, so that $\linearsystem{I}{\vect{b}}$ is consistent, and several more so that the system is inconsistent?</p>

</example>

<sageadvice acro="RSM" index="row space">
<title>Row Space of a Matrix</title>
Not to be outdone, and not suprisingly, Sage can compute a row space with the matrix method <code>.row_space()</code>.  Indeed, given Sage's penchant for treating vectors as rows, much of Sage's infrastructure for vector spaces ultimately relies on <acroref type="theorem" acro="REMRS" />.  More on that in <acroref type="sage" acro="SUTH0" />.  For now, we reprise <acroref type="example" acro="IAS" /> as an illustration.
<sage>
<input>v1 = vector(QQ, [1,  2,  1,  6,   6])
v2 = vector(QQ, [3, -1,  2, -1,   6])
v3 = vector(QQ, [1, -1,  0, -1,  -2])
v4 = vector(QQ, [-3, 2, -3,  6, -10])
X = (QQ^5).span([v1, v2, v3, v4])
A = matrix([v1, v2, v3, v4])
rsA = A.row_space()
X == rsA
</input>
<output>True
</output>
</sage>

<sage>
<input>B = A.rref()
rsB = B.row_space()
X == rsB
</input>
<output>True
</output>
</sage>

<sage>
<input>X
</input>
<output>Vector space of degree 5 and dimension 3 over Rational Field
Basis matrix:
[ 1  0  0  2 -1]
[ 0  1  0  3  1]
[ 0  0  1 -2  5]
</output>
</sage>

<sage>
<input>X.basis()
</input>
<output>[
(1, 0, 0, 2, -1),
(0, 1, 0, 3, 1),
(0, 0, 1, -2, 5)
]
</output>
</sage>

<sage>
<input>B
</input>
<output>[ 1  0  0  2 -1]
[ 0  1  0  3  1]
[ 0  0  1 -2  5]
[ 0  0  0  0  0]
</output>
</sage>

We begin with the same four vectors in <acroref type="example" acro="IAS" /> and create their span, the vector space <code>X</code>.  The matrix <code>A</code> has these four vectors as rows and <code>B</code> is the reduced row-echelon form of <code>A</code>.  Then the row spaces of <code>A</code> and <code>B</code> are equal to the vector space <code>X</code> (and each other).  The way Sage describes this vector space is with a matrix whose rows <em>are the non-zero rows of the reduced row-echelon form of the matrix</em> <code>A</code>.  This is <acroref type="theorem" acro="BRS" /> in action where we go with Sage's penchant for rows and ignore the text's penchant for columns.<br /><br />
We can illustrate a few other results about row spaces with Sage.  Discussion follows.
<sage>
<input>A = matrix(QQ,[[1,  1, 0, -1,  1,  1, 0],
               [4,  5, 1, -6,  1,  6, 1],
               [5,  5, 1, -5,  4,  5, 2],
               [3, -1, 0,  5, 11, -5, 4]])
A.row_space() == A.transpose().column_space()
</input>
<output>True
</output>
</sage>

<sage>
<input>B = matrix(QQ,[[ 7,  9, 2, -11,   1, 11,  2],
               [-4, -3, 1,   2,  -7, -2,  1],
               [16,  8, 2,   0,  30,  0, 12],
               [ 2, 10, 2, -18, -16, 18, -4]])
B.column_space() == B.transpose().row_space()
</input>
<output>True
</output>
</sage>

<sage>
<input>A.rref() == B.rref()
</input>
<output>True
</output>
</sage>

<sage>
<input>A.row_space() == B.row_space()
</input>
<output>True
</output>
</sage>

We use the matrix <code>A</code> to illustrate <acroref type="definition" acro="RSM" />, and the matrix <code>B</code> to illustrate <acroref type="theorem" acro="CSRST" />.  <code>A</code> and <code>B</code> were designed to have the same reduced row-echelon form, and hence be row-equivalent, so this is not a consequence of any theorem or previous computation.  However, then <acroref type="theorem" acro="REMRS" /> guarantees that the row spaces of <code>A</code> and <code>B</code> are equal.


</sageadvice>
</subsection>

<!--   End  crs.tex -->
<readingquestions>
<ol>
<li>Write the column space of the matrix below as the span of a set of three
vectors and explain your choice of method.
<equation>
\begin{bmatrix}
<![CDATA[1 & 3 & 1 & 3\\]]>
<![CDATA[2 & 0 & 1 & 1\\]]>
<![CDATA[-1 & 2 & 1 & 0]]>
\end{bmatrix}
</equation>
</li>
<li>Suppose that $A$ is an $n\times n$ nonsingular matrix. What can you say about its column space?
</li>
<li> Is the vector $\colvector{0\\5\\2\\3}$ in the row space of the following matrix?  Why or why not?
<equation>
\begin{bmatrix}
<![CDATA[1 & 3 & 1 & 3\\]]>
<![CDATA[2 & 0 & 1 & 1\\]]>
<![CDATA[-1 & 2 & 1 & 0]]>
\end{bmatrix}
</equation>
</li></ol>
</readingquestions>

<exercisesubsection>

<exercise type="C" number="20" rough="Repeated calculations of C(A) and R(A);  lead to rank">
<problem contributor="chrisblack">For parts (1), (2) and (3), find a set of linearly independent vectors $X$ so that $\csp{A} = \spn{X}$, and a set of linearly independent vectors $Y$ so that $\rsp{A} = \spn{Y}$.
<ol>
<li>$A = <![CDATA[\begin{bmatrix} 1 & 2 & 3 & 1 \\ 0 & 1 & 1 & 2\\ 1 & -1 & 2 & 3 \\ 1 & 1 & 2 & -1 \end{bmatrix}]]>$</li>
<li>$A = <![CDATA[\begin{bmatrix}  1 & 2 & 1 & 1 & 1 \\ 3 & 2 & -1 & 4 & 5\\ 0 & 1 & 1 & 1 & 2 \end{bmatrix}]]>$</li>
<li>$A = <![CDATA[\begin{bmatrix}  2 & 1 & 0 \\ 3 & 0 & 3\\ 1 & 2 & -3 \\ 1 & 1 & -1 \\ 1 & 1 & -1\end{bmatrix}]]>$</li>
<li>From your results in parts (1) - (3), can you formulate a conjecture about the sets $X$ and $Y$?</li>
</ol>
</problem>
</exercise>

<exercise type="C" number="30" rough="Example ROCD details">
<problem contributor="robertbeezer"><acroref type="example" acro="CSOCD" /> expresses the column space of the coefficient matrix from <acroref type="archetype" acro="D" /> (call the matrix $A$ here) as the span of the first two columns of $A$.  In <acroref type="example" acro="CSMCS" /> we determined that the vector
<equation>
\vect{c}=\colvector{2\\3\\2}
</equation>
<em>was not</em> in the column space of $A$  and that the vector
<equation>
\vect{b}=\colvector{8\\-12\\4}
</equation>
<em>was</em> in the column space of $A$.   Attempt to write $\vect{c}$ and $\vect{b}$ as linear combinations of the two vectors in the span construction for the column space in <acroref type="example" acro="CSOCD" /> and record your observations.
</problem>
<solution contributor="robertbeezer">In each case, begin with a vector equation where one side contains a linear combination of the two vectors from the span construction that gives the column space of $A$ with unknowns for scalars, and then use <acroref type="theorem" acro="SLSLC" /> to set up a system of equations.  For $\vect{c}$, the corresponding system has no solution, as we would expect.<br /><br />
For $\vect{b}$ there is a solution, as we would expect.  What is interesting is that the solution is unique.  This is a consequence of the linear independence of the set of two vectors in the span construction.  If we wrote $\vect{b}$ as a linear combination of all four columns of $A$, then there would be infinitely many ways to do this.
</solution>
</exercise>

<exercise type="C" number="31" rough="BCSOC for 4x5 matrix, toss one column">
<problem contributor="robertbeezer">For the matrix $A$ below find a set of vectors $T$ meeting the following requirements:  (1) the span of $T$ is the column space of $A$, that is, $\spn{T}=\csp{A}$, (2) $T$ is linearly independent, and (3) the elements of $T$ are columns of $A$.
<equation>
A=
\begin{bmatrix}
<![CDATA[ 2 & 1 & 4 & -1 & 2 \\]]>
<![CDATA[ 1 & -1 & 5 & 1 & 1 \\]]>
<![CDATA[ -1 & 2 & -7 & 0 & 1 \\]]>
<![CDATA[ 2 & -1 & 8 & -1 & 2]]>
\end{bmatrix}
</equation>
</problem>
<solution contributor="robertbeezer"><acroref type="theorem" acro="BCS" /> is the right tool for this problem.  Row-reduce this matrix, identify the pivot columns and then grab the corresponding columns of $A$ for the set $T$.  The matrix $A$ row-reduces to
<equation>
\begin{bmatrix}
<![CDATA[ \leading{1} & 0 & 3 & 0 & 0 \\]]>
<![CDATA[ 0 & \leading{1} & -2 & 0 & 0 \\]]>
<![CDATA[ 0 & 0 & 0 & \leading{1} & 0 \\]]>
<![CDATA[ 0 & 0 & 0 & 0 & \leading{1}]]>
\end{bmatrix}
</equation>
So $D=\set{1,\,2,\,4,\,5}$ and then
<equation>
T=\set{\vect{A}_1,\,\vect{A}_2,\,\vect{A}_4,\,\vect{A}_5}=
\set{
\colvector{2 \\ 1 \\ -1 \\ 2},\,
\colvector{1 \\ -1 \\ 2 \\ -1},\,
\colvector{-1 \\ 1 \\ 0 \\ -1},\,
\colvector{2 \\ 1 \\ 1 \\ 2}
}
</equation>
has the requested properties.
</solution>
</exercise>

<exercise type="C" number="32" rough="Example RAA detail">
<problem contributor="robertbeezer">In <acroref type="example" acro="CSAA" />, verify that the vector $\vect{b}$ is not in the column space of the coefficient matrix.
</problem>
</exercise>

<exercise type="C" number="33" rough="Row space basis for 3x4 matrix">
<problem contributor="robertbeezer">Find a linearly independent set $S$ so that the span of $S$, $\spn{S}$, is row space of the matrix $B$, and $S$ is linearly independent.
<equation>
B=
\begin{bmatrix}
<![CDATA[2 & 3 & 1 & 1\\]]>
<![CDATA[1 & 1 & 0 & 1\\]]>
<![CDATA[-1 & 2 & 3 & -4]]>
\end{bmatrix}
</equation>
</problem>
<solution contributor="robertbeezer"><acroref type="theorem" acro="BRS" /> is the most direct route to a set with these properties.  Row-reduce, toss zero rows, keep the others.  You could also transpose the matrix, then look for the column space by row-reducing the transpose and applying <acroref type="theorem" acro="BCS" />.  We'll do the former,
<equation>
B\rref
\begin{bmatrix}
<![CDATA[\leading{1} & 0 & -1 & 2\\]]>
<![CDATA[0 & \leading{1} & 1 & -1\\]]>
<![CDATA[0 & 0 & 0 & 0]]>
\end{bmatrix}
</equation>
So the set $S$ is
<equation>
S=\set{
\colvector{1\\0\\-1\\2},\,
\colvector{0\\1\\1\\-1}
}
</equation>
</solution>
</exercise>

<exercise type="C" number="34" rough="Set membership in row space">
<problem contributor="robertbeezer">For the $3\times 4$ matrix $A$ and the column vector $\vect{y}\in\complex{4}$ given below, determine if $\vect{y}$ is in the row space of $A$. In other words, answer the question:  $\vect{y}\in\rsp{A}$?
<alignmath>
<![CDATA[A&=]]>
\begin{bmatrix}
<![CDATA[ -2 & 6 & 7 & -1 \\]]>
<![CDATA[ 7 & -3 & 0 & -3 \\]]>
<![CDATA[ 8 & 0 & 7 & 6]]>
\end{bmatrix}
<![CDATA[&]]>
<![CDATA[\vect{y}&=]]>
\colvector{2\\1\\3\\-2}
</alignmath>
</problem>
<solution contributor="robertbeezer"><alignmath>
\vect{y}\in\rsp{A}
<![CDATA[&\iff\vect{y}\in\csp{\transpose{A}}&&]]>\text{<acroref type="definition" acro="RSM" />}\\
<![CDATA[&\iff\linearsystem{\transpose{A}}{\vect{y}}\text{ is consistent}&&]]>\text{<acroref type="theorem" acro="CSCS" />}
</alignmath>
The augmented matrix $\augmented{\transpose{A}}{\vect{y}}$ row reduces to
<alignmath>
\begin{bmatrix}
<![CDATA[ \leading{1} & 0 & 0 & 0 \\]]>
<![CDATA[ 0 & \leading{1} & 0 & 0 \\]]>
<![CDATA[ 0 & 0 & \leading{1} & 0 \\]]>
<![CDATA[ 0 & 0 & 0 & \leading{1}]]>
\end{bmatrix}
</alignmath>
and with a leading 1 in the final column <acroref type="theorem" acro="RCLS" /> tells us the linear system is inconsistent and so $\vect{y}\not\in\rsp{A}$.
</solution>
</exercise>

<exercise type="C" number="35" rough="Row space two ways, 3x4 matrix">
<problem contributor="robertbeezer">For the matrix $A$ below, find two different linearly independent sets whose spans equal the column space of $A$, $\csp{A}$, such that
<ol>
<li>the elements are each columns of $A$.</li>
<li>the set is obtained by a procedure that is substantially different from the procedure you use in part (1).
</li>
</ol>
<alignmath>
<![CDATA[A&=]]>
\begin{bmatrix}
<![CDATA[ 3 & 5 & 1 & -2 \\]]>
<![CDATA[ 1 & 2 & 3 & 3 \\]]>
<![CDATA[ -3 & -4 & 7 & 13]]>
\end{bmatrix}
</alignmath>
</problem>
<solution contributor="robertbeezer">(a)\quad By <acroref type="theorem" acro="BCS" /> we can row-reduce $A$, identify pivot columns with the set $D$, and <q>keep</q> those columns of $A$ and we will have a set with the desired properties.
<alignmath>
A\rref
\begin{bmatrix}
<![CDATA[ \leading{1} & 0 & -13 & -19 \\]]>
<![CDATA[ 0 & \leading{1} & 8 & 11 \\]]>
<![CDATA[ 0 & 0 & 0 & 0]]>
\end{bmatrix}
</alignmath>
So we have the set of pivot columns $D=\set{1,\,2}$ and we <q>keep</q> the first two columns of $A$,
<alignmath>
\set{
\colvector{3\\1\\-3},\,
\colvector{5\\2\\-4}
}
</alignmath>
(b)\quad We can view the column space as the row space of the transpose (<acroref type="theorem" acro="CSRST" />).  We can get a basis of the row space of a matrix quickly by bringing the matrix to reduced row-echelon form and keeping the nonzero rows as column vectors (<acroref type="theorem" acro="BRS" />).  Here goes.
<alignmath>
\transpose{A}\rref
\begin{bmatrix}
<![CDATA[ \leading{1} & 0 & -2 \\]]>
<![CDATA[ 0 & \leading{1} & 3 \\]]>
<![CDATA[ 0 & 0 & 0 \\]]>
<![CDATA[ 0 & 0 & 0]]>
\end{bmatrix}
</alignmath>
Taking the nonzero rows and tilting them up as columns gives us
<alignmath>
\set{
\colvector{1\\0\\-2},\,
\colvector{0\\1\\3}
}
</alignmath>
An approach based on the matrix $L$ from extended echelon form (<acroref type="definition" acro="EEF" />) and <acroref type="theorem" acro="FS" /> will work as well as an alternative approach.
</solution>
</exercise>

<exercise type="C" number="40" rough="Archetype constant vectors as lin combo of BCSOC">
<problem contributor="robertbeezer">The following archetypes are systems of equations.  For each system, write the vector of constants as a linear combination of the vectors in the span construction for the column space provided by <acroref type="theorem" acro="BCS" /> (these vectors are listed for each of these archetypes).<br /><br />
<acroref type="archetype" acro="A" />,
<acroref type="archetype" acro="B" />,
<acroref type="archetype" acro="C" />,
<acroref type="archetype" acro="D" />,
<acroref type="archetype" acro="E" />,
<acroref type="archetype" acro="F" />,
<acroref type="archetype" acro="G" />,
<acroref type="archetype" acro="H" />,
<acroref type="archetype" acro="I" />,
<acroref type="archetype" acro="J" />
</problem>
</exercise>

<exercise type="C" number="42" rough="Theorem BCSOC to each archetype">
<problem contributor="robertbeezer">The following archetypes are either matrices or systems of equations with coefficient matrices.  For each matrix, compute a set of column vectors such that (1) the vectors are columns of the matrix, (2) the set is linearly independent, and (3) the span of the set is the column space of the matrix.  See <acroref type="theorem" acro="BCS" />.<br /><br />
<acroref type="archetype" acro="A" />,
<acroref type="archetype" acro="B" />,
<acroref type="archetype" acro="C" />,
<acroref type="archetype" acro="D" />/<acroref type="archetype" acro="E" />,
<acroref type="archetype" acro="F" />,
<acroref type="archetype" acro="G" />/<acroref type="archetype" acro="H" />,
<acroref type="archetype" acro="I" />,
<acroref type="archetype" acro="J" />,
<acroref type="archetype" acro="K" />,
<acroref type="archetype" acro="L" />
</problem>
</exercise>

<exercise type="C" number="50" rough="Archetypes, row space computations">
<problem contributor="robertbeezer">The following archetypes are either matrices or systems of equations with coefficient matrices.  For each matrix, compute a set of column vectors such that  (1) the set is linearly independent, and (2) the span of the set is the row space of the matrix.  See <acroref type="theorem" acro="BRS" />.<br /><br />
<acroref type="archetype" acro="A" />,
<acroref type="archetype" acro="B" />,
<acroref type="archetype" acro="C" />,
<acroref type="archetype" acro="D" />/<acroref type="archetype" acro="E" />,
<acroref type="archetype" acro="F" />,
<acroref type="archetype" acro="G" />/<acroref type="archetype" acro="H" />,
<acroref type="archetype" acro="I" />,
<acroref type="archetype" acro="J" />,
<acroref type="archetype" acro="K" />,
<acroref type="archetype" acro="L" />
</problem>
</exercise>

<exercise type="C" number="51" rough="Archetypes, column space as row space of transpose">
<problem contributor="robertbeezer">The following archetypes are either matrices or systems of equations with coefficient matrices.  For each matrix, compute the column space as the span of a linearly independent set as follows: transpose the matrix, row-reduce, toss out zero rows, convert rows into column vectors. See <acroref type="example" acro="CSROI" />.<br /><br />
<acroref type="archetype" acro="A" />,
<acroref type="archetype" acro="B" />,
<acroref type="archetype" acro="C" />,
<acroref type="archetype" acro="D" />/<acroref type="archetype" acro="E" />,
<acroref type="archetype" acro="F" />,
<acroref type="archetype" acro="G" />/<acroref type="archetype" acro="H" />,
<acroref type="archetype" acro="I" />,
<acroref type="archetype" acro="J" />,
<acroref type="archetype" acro="K" />,
<acroref type="archetype" acro="L" />
</problem>
</exercise>

<exercise type="C" number="52" rough="Archetypes, new consistent and inconsistent systems">
<problem contributor="robertbeezer">The following archetypes are systems of equations.  For each different coefficient matrix build two new vectors of constants.  The first should lead to a consistent system and the second should lead to an inconsistent system.  Descriptions of the column space as spans of linearly independent sets of vectors with <q>nice patterns</q> of zeros and ones might be most useful and instructive in connection with this exercise. (See the end of <acroref type="example" acro="CSROI" />.)<br /><br />
<acroref type="archetype" acro="A" />,
<acroref type="archetype" acro="B" />,
<acroref type="archetype" acro="C" />,
<acroref type="archetype" acro="D" />/<acroref type="archetype" acro="E" />,
<acroref type="archetype" acro="F" />,
<acroref type="archetype" acro="G" />/<acroref type="archetype" acro="H" />,
<acroref type="archetype" acro="I" />,
<acroref type="archetype" acro="J" />
</problem>
</exercise>

<exercise type="M" number="10" rough="Build consistent/inconsistent, latter impossible">
<problem contributor="robertbeezer">For the matrix $E$ below, find vectors $\vect{b}$ and $\vect{c}$ so that the system $\linearsystem{E}{\vect{b}}$ is consistent and $\linearsystem{E}{\vect{c}}$ is inconsistent.
<equation>
E=
\begin{bmatrix}
<![CDATA[-2 & 1 & 1 & 0\\]]>
<![CDATA[3 & -1 & 0 & 2\\]]>
<![CDATA[4 & 1 & 1 & 6]]>
\end{bmatrix}
</equation>
</problem>
<solution contributor="robertbeezer">Any vector from $\complex{3}$ will lead to a consistent system, and therefore there is no vector that will lead to an inconsistent system.<br /><br />
How do we convince ourselves of this?  First, row-reduce $E$,
<equation>
E\rref
\begin{bmatrix}
<![CDATA[\leading{1} & 0 & 0 & 1\\]]>
<![CDATA[0 & \leading{1} & 0 & 1\\]]>
<![CDATA[0 & 0 & \leading{1} & 1]]>
\end{bmatrix}
</equation>
If we augment $E$ with any vector of constants, and row-reduce the augmented matrix, we will never find a leading 1 in the final column, so by <acroref type="theorem" acro="RCLS" /> the system will always be consistent.<br /><br />
Said another way, the column space of $E$ is all of $\complex{3}$, $\csp{E}=\complex{3}$.  So by <acroref type="theorem" acro="CSCS" /> any vector of constants will create a consistent system (and none will create an inconsistent system).
</solution>
</exercise>

<exercise type="M" number="20" rough="Matrix with equal column space and null space?">
<problem contributor="robertbeezer">Usually the column space and null space of a matrix contain vectors of different sizes.  For a square matrix, though, the vectors in these two sets are the same size.  Usually the two sets will be different.  Construct an example of a square matrix where the column space and null space are equal.
</problem>
<solution contributor="robertbeezer">The $2\times 2$ matrix
<equation>
\begin{bmatrix}
<![CDATA[1&1\\]]>
<![CDATA[-1&-1]]>
\end{bmatrix}
</equation>
has $\csp{A}=\nsp{A}=\spn{\set{\colvector{1\\-1}}}$.
</solution>
</exercise>

<exercise type="M" number="21" rough="Can't get column space with just a row-reduce">
<problem contributor="robertbeezer">We have a variety of theorems about how to create column spaces and row spaces and they frequently involve row-reducing a matrix.  Here is a procedure that some try to use to get a column space.  Begin with an $m\times n$ matrix $A$ and row-reduce to a matrix $B$ with columns $\vectorlist{B}{n}$.  Then form the column space of $A$ as
<equation>
\csp{A}=
\spn{\set{\vectorlist{B}{n}}}
=\csp{B}
</equation>
This is <em>not</em> not a legitimate procedure, and therefore is <em>not</em> a theorem.  Construct an example to show that the procedure will not in general create the column space of $A$.
</problem>
<solution contributor="robertbeezer">Begin with a matrix $A$ (of any size) that does not have any zero rows, but which when row-reduced to $B$ yields at least one row of zeros.  Such a matrix should be easy to construct (or find, like say from <acroref type="archetype" acro="A" />).<br /><br />
$\csp{A}$ will contain some vectors whose final slot (entry $m$) is non-zero, however, every column vector from the matrix $B$ will have a zero in slot $m$ and so every vector in $\csp{B}$ will also contain a zero in the final slot.  This means that $\csp{A}\neq\csp{B}$, since we have vectors in $\csp{A}$ that cannot be elements of $\csp{B}$.
</solution>
</exercise>

<exercise type="T" number="40" rough="Col space AB contained in col space A">
<problem contributor="robertbeezer">Suppose that $A$ is an $m\times n$ matrix and $B$ is an $n\times p$ matrix.  Prove that the column space of $AB$ is a subset of the column space of $A$, that is $\csp{AB}\subseteq\csp{A}$.  Provide an example where the opposite is false, in other words give an example where $\csp{A}\not\subseteq\csp{AB}$.   (Compare with <acroref type="exercise" acro="MM.T40" />.)
</problem>
<solution contributor="robertbeezer">Choose $\vect{x}\in\csp{AB}$.  Then by <acroref type="theorem" acro="CSCS" /> there is a vector $\vect{w}$ that is a solution to $\linearsystem{AB}{\vect{x}}$.  Define the vector $\vect{y}$ by $\vect{y}=B\vect{w}$.  We're set,
<alignmath>
A\vect{y}
<![CDATA[&=A\left(B\vect{w}\right)&&\text{Definition of $\vect{y}$}\\]]>
<![CDATA[&=\left(AB\right)\vect{w}&&]]>\text{<acroref type="theorem" acro="MMA" />}\\
<![CDATA[&=\vect{x}&&\text{$\vect{w}$ solution to $\linearsystem{AB}{\vect{x}}$}\\]]>
</alignmath>
This says that $\linearsystem{A}{\vect{x}}$ is a consistent system, and by <acroref type="theorem" acro="CSCS" />, we see that $\vect{x}\in\csp{A}$ and therefore $\csp{AB}\subseteq\csp{A}$.<br /><br />
For an example where $\csp{A}\not\subseteq\csp{AB}$ choose $A$ to be any nonzero matrix and choose $B$ to be a zero matrix.  Then $\csp{A}\neq\set{\zerovector}$ and $\csp{AB}=\csp{\zeromatrix}=\set{\zerovector}$.
</solution>
</exercise>

<exercise type="T" number="41" rough="Converse for B nonsingular">
<problem contributor="robertbeezer">Suppose that $A$ is an $m\times n$ matrix and $B$ is an $n\times n$ nonsingular matrix.  Prove that the column space of $A$ is equal to the column space of $AB$, that is $\csp{A}=\csp{AB}$.  (Compare with <acroref type="exercise" acro="MM.T41" /> and <acroref type="exercise" acro="CRS.T40" />.)
</problem>
<solution contributor="robertbeezer">From the solution to <acroref type="exercise" acro="CRS.T40" /> we know that $\csp{AB}\subseteq\csp{A}$.  So to establish the set equality (<acroref type="definition" acro="SE" />) we need to show that $\csp{A}\subseteq\csp{AB}$.<br /><br />
Choose $\vect{x}\in\csp{A}$.  By <acroref type="theorem" acro="CSCS" /> the linear system $\linearsystem{A}{\vect{x}}$ is consistent, so let $\vect{y}$ be one such solution.  Because $B$ is nonsingular, and linear system using $B$ as a coefficient matrix will have a solution (<acroref type="theorem" acro="NMUS" />).  Let $\vect{w}$ be the unique solution to the linear system $\linearsystem{B}{\vect{y}}$.  All set, here we go,
<alignmath>
\left(AB\right)\vect{w}
<![CDATA[&=A\left(B\vect{w}\right)&&]]>\text{<acroref type="theorem" acro="MMA" />}\\
<![CDATA[&=A\vect{y}&&\text{$\vect{w}$ solution to $\linearsystem{B}{\vect{y}}$}\\]]>
<![CDATA[&=\vect{x}&&\text{$\vect{y}$ solution to $\linearsystem{A}{\vect{x}}$}\\]]>
</alignmath>
This says that the linear system $\linearsystem{AB}{\vect{x}}$ is consistent, so by <acroref type="theorem" acro="CSCS" />, $\vect{x}\in\csp{AB}$.  So $\csp{A}\subseteq\csp{AB}$.
</solution>
</exercise>

<exercise type="T" number="45" rough="Generalization of theorem NPNT">
<problem contributor="robertbeezer">Suppose that $A$ is an $m\times n$ matrix and $B$ is an $n\times m$ matrix where $AB$ is a nonsingular matrix.  Prove that
<ol>
<li>$\nsp{B}=\set{\zerovector}$</li>
<li>$\csp{B}\cap\nsp{A}=\set{\zerovector}$</li>
</ol>
Discuss the case when $m=n$ in connection with <acroref type="theorem" acro="NPNT" />.
</problem>
<solution contributor="robertbeezer">First, $\zerovector\in\nsp{B}$ trivially.  Now suppose that $\vect{x}\in\nsp{B}$.  Then
<alignmath>
AB\vect{x}
<![CDATA[&=A(B\vect{x})&&]]>\text{<acroref type="theorem" acro="MMA" />}\\
<![CDATA[&=A\zerovector&&\vect{x}\in\nsp{B}\\]]>
<![CDATA[&=\zerovector&&]]>\text{<acroref type="theorem" acro="MMZM" />}
</alignmath>
Since we have assumed $AB$ is nonsingular, <acroref type="definition" acro="NM" /> implies that $\vect{x}=\zerovector$.<br /><br />
Second, $\zerovector\in\csp{B}$ and $\zerovector\in\nsp{A}$ trivially, and so the zero vector is in the intersection as well (<acroref type="definition" acro="SI" />).  Now suppose that $\vect{y}\in\csp{B}\cap\nsp{A}$.  Because $\vect{y}\in\csp{B}$, <acroref type="theorem" acro="CSCS" /> says the system $\linearsystem{B}{\vect{y}}$ is consistent.  Let $\vect{x}\in\complex{n}$ be one solution to this system.  Then
<alignmath>
AB\vect{x}
<![CDATA[&=A(B\vect{x})&&]]>\text{<acroref type="theorem" acro="MMA" />}\\
<![CDATA[&=A\vect{y}&&\text{$\vect{x}$ solution to $\linearsystem{B}{\vect{y}}$}\\]]>
<![CDATA[&=\zerovector&&\vect{y}\in\nsp{A}]]>
</alignmath>
Since we have assumed $AB$ is nonsingular, <acroref type="definition" acro="NM" /> implies that $\vect{x}=\zerovector$.  Then $\vect{y}=B\vect{x}=B\zerovector=\zerovector$.<br /><br />
When $AB$ is nonsingular and $m=n$ we know that the first condition, $\nsp{B}=\set{\zerovector}$, means that $B$ is nonsingular (<acroref type="theorem" acro="NMTNS" />).  Because $B$ is nonsingular <acroref type="theorem" acro="CSNM" /> implies that $\csp{B}=\complex{m}$.  In order to have the second condition fulfilled, $\csp{B}\cap\nsp{A}=\set{\zerovector}$, we must realize that $\nsp{A}=\set{\zerovector}$.  However, a second application of <acroref type="theorem" acro="NMTNS" /> shows that $A$ must be nonsingular.  This reproduces <acroref type="theorem" acro="NPNT" />.
</solution>
</exercise>

</exercisesubsection>

</section>