Matrix Multiplication and Inverses: Five Views and Gauss-Jordan
Matrix multiplication has five equivalent views — entries, columns, rows, column-times-row, and blocks. A square matrix is invertible exactly when no nonzero vector maps to zero, and Gauss-Jordan computes the inverse in one pass.
这一讲把乘法与逆讲成了结构。下一讲把消元写成 A=LU,其中 L 记录乘数、U 是上三角;再往后,可逆性会被翻译成「主元个数」「行列式非零」「零空间只有零向量」等互相等价的条件。
Two topics
What matrix multiplication actually does. There are five equivalent algorithms, and all of them matter.
Inverses of square matrices: when one exists, when it does not, and how to compute it.
The previous lecture used multiplication mechanically. This one opens it up, because column spaces, rank, and LU factorization all depend on these views.
Timeline
Time
Topic
0:08
The rules for matrix multiplication
1:24
The (i,j) entry as a row times a column
4:57
Rectangular matrices
7:09
Second view: A times the columns of B
9:57
Columns of AB are combinations of columns of A
11:27
Rows of AB are combinations of rows of B
18:28
Block multiplication
24:20
Invertible versus singular
29:05
A nonzero x with Ax=0 rules out an inverse
30:02
Columns that combine to zero rule out an inverse
36:07
Gauss-Jordan: n right-hand sides at once
38:32
Reducing A to the identity
42:01
Checking the answer the old way
46:12
The full algorithm for the inverse
Five ways to multiply
Let A be m×n, B be n×p, and C=AB be m×p. The number of columns of A must equal the number of rows of B.
1. By entries: row dot column
The entry in row i, column j of C is
Cij=k=1∑nAikBkj.
That is the dot product of row i of A with column j of B. For example,
C34=A31B14+A32B24+⋯+A3nBn4.
This is the textbook algorithm and the one used in computation.
2. By columns: each column of C is a combination of columns of A
Write B as p columns side by side:
B=[b1b2⋯bp].
Then
C=[Ab1Ab2⋯Abp].
Since Abj is a linear combination of the columns of A, every column of C is a combination of the columns of A, with coefficients taken from the corresponding column of B.
3. By rows: each row of C is a combination of rows of B
Similarly, writing A by rows,
A=a1T⋮amT,C=a1TB⋮amTB.
Each aiTB is a combination of the rows of B, with coefficients from row i of A.
4. Column times row: a sum of rank-one matrices
This view is the easiest to overlook and the most structural. If ak are the columns of A and bkT the rows of B, then
AB=k=1∑nakbkT.
Each term is a full m×p matrix. For example,
234[16]=234121824.
Every column is a multiple of [2,3,4]T; every row is a multiple of [1,6]. Its row space is a line and its column space is a line — the prototype of a rank-one matrix.
The rule is the usual one with scalars replaced by blocks. All five routes agree.
Inverses: the central question for square matrices
For an n×n matrix A, the important question is: is it invertible?
If there is a matrix A−1 with
A−1A=I,
then A is invertible, or nonsingular. For square matrices there is a non-obvious fact: a left inverse is also a right inverse, so A−1A=I implies AA−1=I. For rectangular matrices this fails, simply because the shapes do not allow it.
Singular matrices: columns that combine to zero
Consider
A=[1236].
The columns [1,2]T and [3,6]T lie on the same line; the second is three times the first.
Reason one (column picture).A times any matrix has columns that are combinations of the columns of A, so they all lie on that one line. But the columns of I, [1,0]T and [0,1]T, do not. So A cannot produce I.
Reason two (nullspace). There is a nonzero vector
x=[3−1],Ax=[1236][3−1]=[3−36−6]=[00].
If A−1 existed, multiply both sides on the left:
A−1Ax=A−10⟹x=0.
But x=[3,−1]T is not zero. Contradiction: A−1 does not exist.
One-sentence summary: A square matrix is singular exactly when some nonzero vector is crushed to zero; once information is destroyed, no matrix can restore it.
This criterion later becomes "the nullspace contains only the zero vector" and "the determinant is zero".
Gauss-Jordan: solving n systems at once
Assume A is invertible. The key observation is that column j of A−1 satisfies
A(column j of A−1)=ej,
where ej is column j of the identity. Finding the inverse is therefore solving n systems with different right-hand sides.
Gauss stops after forward elimination. Jordan continues upward until the left side is the identity.
Example
Take
A=[1237].
Form the augmented matrix [A∣I]:
[12371001].
Step one: subtract twice row one from row two.
[10311−201].
The lower-left entry is gone; this is upper triangular. Gauss would stop here.
Step two: subtract three times row two from row one, clearing the upper-right entry.
Write each elimination step as a matrix E1,E2,…, and let
E=Ek⋯E2E1.
Applying E to the augmented matrix:
E[A∣I]=[EA∣E].
When elimination finishes, EA=I. By definition of the inverse, E=A−1. Therefore the right side is
EI=E=A−1.
That is the whole idea: the row operations that turn A into I turn I into A−1.
Takeaways
AB has five algorithms: entry dot products, by columns, by rows, sum of column-times-row, and blocks. They agree.
Columns of C are combinations of columns of A; rows of C are combinations of rows of B.
A column times a row is a rank-one matrix; AB is a sum of such matrices.
A square matrix is invertible exactly when no nonzero x satisfies Ax=0.
A singular matrix has linearly dependent columns, which cannot combine to produce the identity's columns.
Gauss-Jordan reduces [A∣I]; when the left half becomes I, the right half is A−1.
Check your understanding
1. Write C23 with the summation formula and state the shape constraints on A and B.
Reference answer:
C23=k=1∑nA2kBk3=A21B13+A22B23+⋯+A2nBn3,
the dot product of row two of A with column three of B. If A is m×n and B is n×p, then C is m×p; writing C23 requires m≥2 and p≥3. The only compatibility condition is that the number of columns of A equals the number of rows of B.
2. Why must every column of C be a combination of columns of A? Use the definition of matrix times vector.
Reference answer: Split B into columns b1,…,bp; then column j of C is Abj. By definition,
Abj=k=1∑nbkjak,
a linear combination of the columns ak of A with weights taken from column j of B. Hence every column of C lies in the span of the columns of A, and there are as many columns in C as in B.
3. Show that [2,3,4]T[1,6] has a one-dimensional row space and a one-dimensional column space.
Reference answer: The product is
234[16]=234121824.
Columns: the second is 6 times the first, so the column space is span{[2,3,4]T}, a line. Rows: they are 2[1,6], 3[1,6], 4[1,6], so the row space is span{[1,6]}, also a line. Both dimensions are 1 — the signature of a rank-one matrix, which collapses the whole plane onto a single line.
4. Use the nullspace argument to show that [1236] is singular.
Reference answer: Take x=[3,−1]T=0. Then
[1236][3−1]=[3−36−6]=[00].
If A−1 existed, left multiplication would give
A−1Ax=A−10⟹x=0,
a contradiction. Two different inputs (0 and [3,−1]T) map to the same output, so the information is lost and cannot be recovered.
5. Run Gauss-Jordan on A=[1237] and verify the result.
Reference answer: Starting from the augmented matrix,
The reason it works: with E the product of the row operations, E[A∣I]=[EA∣E]=[I∣A−1], so whatever happens to the right block is exactly A−1.
How it connects
This lecture turns multiplication and inversion into structure. The next one writes elimination as A=LU, with L storing the multipliers and U upper triangular. Later, invertibility is translated into equivalent conditions: nonzero pivots, a nonzero determinant, and a nullspace containing only zero.