Matrix products describe how quantities are combined; row operations then solve simultaneous balances, before we examine applications and practice.
Here a linear map preserves vector addition and multiplication by real scalars, so it sends the zero vector to zero; see linear-map preparation.
Matrix notation and products
Definition
When a matrix product is defined
If is an matrix and is an matrix, then the product is defined and is an matrix.
If the number of columns of does not equal the number of rows of , then the product is undefined.
Definition
Matrix multiplication
Suppose is an matrix and is an matrix.
Then the entry of is
So each output entry is the dot-product-style combination of row of with column of .
Identity matrices do nothing, on purpose
Definition
Identity matrix
For each positive integer , the identity matrix is the square matrix with on the main diagonal and everywhere else.
For example,
The identity matrix matters because it preserves any compatible matrix:
whenever the sizes match.
Worked example
Why multiplying by the identity changes nothing
Let
Then
The first column of reproduces the first column of , and the second column reproduces the second column of .
Counterexample mode
Matching dimensions do not guarantee commutativity
The claim “two square matrices of the same size always satisfy ” is false even though both products exist and have the same size. Take
Both are real matrices, so the hypothesis is satisfied. Direct row-by-column multiplication gives
For example, , whereas . One unequal corresponding entry is enough to prove . The failure has a structural explanation: multiplying this on the right keeps the second column and zeros the first, while multiplying it on the left keeps the second row and zeros the first.
A valid replacement is: a square matrix commutes with every scalar multiple of the identity of the same size. Indeed, if , then . For arbitrary square matrices, commutativity needs its own justification; matching dimensions guarantees that multiplication is defined, not that factors can be interchanged.
Matrix multiplication represents composition
The multiplication rule is not arbitrary. It is the rule that makes matrices encode linear transformations in sequence.
If a vector is first sent to , and then that result is sent to , the combined effect is
That is why the inner dimensions must match. The output of the first map must be a valid input for the second one.
Theorem
Associativity matches repeated composition
Whenever the products are defined,
So we may regroup a chain of matrix products without changing the final linear transformation.
This does not mean that order may be changed. Associativity lets us change parentheses, not the order of the factors themselves.
Definition
Transpose
If is an matrix, then its transpose is the matrix whose entry is .
Equivalently,
So every row of becomes a column of , and every column of becomes a row.
Theorem
Basic properties of transpose
Let and have the same size when they are added, let be a scalar, and suppose is and is when they are multiplied. Then:
Proof
Entrywise proof of the product rule
Let be and be . Then is , so both and are . For and , the entry of the first matrix is
On the other hand, the entry of is
The last equality uses commutativity of scalar multiplication, not commutativity of matrix multiplication. Corresponding entries therefore agree, so . The dimensions also explain the reversed order: is and is , whereas would generally not even be defined.
Compatible matrix identities and linearity
Work with real matrices of positive finite sizes. Addition and scalar multiplication are entrywise. A map is linear if for all inputs and real scalars. The row-column formula proves is linear by distributing each finite scalar sum; taking gives . For of size , of size and of size ,
Only finite sums were regrouped. The same entrywise distributive law proves matrix distributivity, and the Kronecker entries of prove in compatible sizes. The definition of transpose directly gives , , and . If , multiplying and in either order gives ; division by proves the stated two-by-two inverse formula.
Definition
Standard inner product
Let and be column vectors in , with the same dimension . Their inner product is the real number
It is also called the dot product. We deliberately identify a matrix with its single real entry, so the matrix product is read as a number.
Linear systems and their solution sets
Definition
Coefficient matrix, constant vector, and augmented matrix
For a system :
- is the coefficient matrix;
- is the vector of constants;
- is the augmented matrix, formed by placing the constant column beside the coefficient matrix.
The vertical bar is bookkeeping. It reminds you which column came from the right-hand side, but it does not create a new kind of matrix operation.
Definition
Elementary row operations
The allowed operations on an augmented matrix are:
- , where
- , where
- , where and
These are called elementary row operations.
Theorem
Row-equivalent augmented matrices represent equivalent systems
If one augmented matrix is obtained from another by a sequence of elementary row operations, then the two corresponding systems are equivalent: they have exactly the same solution set.
Proof
Why each elementary row operation is safe
Each operation is just an equation operation written in matrix form.
- Swapping two rows only changes the order in which the equations are listed. A number tuple solves all equations before the swap if and only if it solves all equations after the swap.
- Multiplying a row by a nonzero scalar multiplies both sides of one equation by the same nonzero number. That produces an equivalent equation, and the move is reversible by multiplying by .
- Replacing by means replacing equation by “ equation plus equation .” Any solution of the original system still satisfies the new equation, and the move is reversible by adding times row back to row .
So every elementary row operation preserves the solution set, and therefore any finite sequence of them does the same.
Definition
REF and RREF
A matrix is in row echelon form (REF) when:
- all zero rows are at the bottom, and
- each nonzero row starts farther to the right than the row above it.
A matrix is in reduced row echelon form (RREF) when, in addition:
- each pivot is , and
- each pivot is the only nonzero entry in its column.
One full elimination path
Consider the system
Its augmented matrix is
Worked example
Read every row operation as a purpose
The entry in the top-left corner is already a convenient pivot because it is . So the first goal is simple:
make everything below that pivot become .
Use
Then the matrix becomes
Now column 1 is finished. The next pivot lives in row 2, column 2. So we use it to clear the below it:
This gives
This matrix is in REF. Read the equations from bottom to top:
The system is already solved. Continuing to RREF records these substitutions in the matrix itself, so that each variable's value can be read directly.
First make the last pivot equal to :
Then clear the entries above that pivot:
so the matrix becomes
Finally clear the above the second pivot:
which gives the RREF
Now the solution can be read immediately:
Worked example
Read structure before you compute
Suppose you arrive at
Here columns 1 and 2 are pivot columns, but column 3 is not. That means the third variable is free.
So this system does not have one unique solution. Instead, it has infinitely many solutions, because you may choose the free variable first and then solve for the pivot variables.
Theorem
What a contradiction row means
If row reduction produces a row such as
then the corresponding equation is . That is impossible, so the system is inconsistent and has no solution.
Definition
Homogeneous system
A homogeneous linear system is a linear system of the form
Its trivial solution is the zero vector .
Definition
Null space
For a real matrix , the null space of is
So is exactly the solution set of the homogeneous system .
Theorem
Every solution is a particular solution plus a null-space vector
Suppose is one particular solution of .
Then a vector solves if and only if
for some .
Proof
Why the full solution set has the form
First suppose is any solution of . Then
Subtracting gives
So , which means for some .
Conversely, if , then . Hence
So every vector of the form is also a solution.
Real square inverses and the two-by-two formula
Definition
Invertible matrix
Let be a square matrix. We say that is invertible if there exists a matrix such that
The matrix is called the inverse of , and we write .
Theorem
The inverse is unique
Let be and let be . If is a left inverse of and is a right inverse, then . In particular, an invertible square matrix has exactly one inverse.
Proof
Why the inverse is unique
The assumptions are and . Associativity gives
No factors were interchanged. For an invertible square matrix, any two inverses satisfy these hypotheses, so they coincide.
Let
The uniqueness proof is in invertible matrices.
Real square determinants and invertibility
The following statements concern finite real square matrices; the first statement additionally requires the matrix to be upper or lower triangular.
Theorem
Triangular determinant theorem
If is upper triangular or lower triangular, then
Theorem
Determinant criterion for invertibility
For a square matrix ,
Build the determinant from smaller matrices
Definition
Submatrix, minor, and cofactor
Let be an matrix with . For indices , delete row and column simultaneously. The resulting matrix is the submatrix .
The minor belonging to is the scalar
The cofactor belonging to is the signed scalar
The signs form a checkerboard whose upper-left sign is positive:
The notation names a matrix, is a determinant of that matrix, and is that scalar after the sign has been attached. Keeping these three objects distinct prevents a common double-sign error.
Definition
Recursive definition of the determinant
For a matrix , define
For an matrix with , define its determinant by expansion along the first row:
This is a definition, not yet a theorem about other rows or columns. Each minor in the sum has size , so repeated use of the definition eventually reaches the base case. No determinant convention is needed: the submatrix and minor definitions are used only for .
Follow cofactor expansion turn one determinant into smaller signed branches, then see how zeros prune the tree and triangular matrices collapse to diagonal products.
Minor, sign, cofactor
Delete row i and column j and take the remaining determinant to obtain the minor. Multiplying that scalar by (-1)^{i+j} gives the cofactor.
Expansion branches
For B=[[3,2,-1],[4,1,6],[-3,-1,2]], expansion along the first row has coefficients 3, -2, and -1 multiplying the three minors.
Combine branch values
The three minors are 8, 26, and -1. Including the entries and checkerboard signs gives 3(8)-2(26)+(-1)(-1)=-27.
Zeros prune work
A zero entry contributes a zero cofactor term, so choosing a sparse row or column removes branches immediately.
One nonzero entry
If a row or column has only one nonzero entry, the determinant collapses to one signed smaller determinant.
Triangular read-off
For a triangular matrix, repeated one-branch expansion leaves the product of the diagonal entries.
Cofactor expansion is both a recursive definition and a computation strategy: choose sparse rows or columns so zero branches disappear before they cost work.
Arbitrary cofactor expansion from the recursive determinant
Let be real , , with determinant defined by the one-by-one base case and first-row recursion. Let be the permutations of . Define the inversion number as the number of pairs with , and put .
Suppose and delete position and value , keeping the relative orders of the remaining positions and values; the resulting permutation is . If entries before position are smaller than , the inversions removed are . Consequently
Define . For , it is the recursive determinant. For , grouping by and using the sign identity gives . Induction therefore proves .
Now fix any row and group the same finite permutation sum by . Deletion is a bijection to all permutations of the corresponding minor, so
For a fixed column , each permutation has a unique position with . Grouping by that position gives
Both expansion formulas concern , so no empty determinant convention was introduced. This proves the general expansion theorem without assuming alternating row rules or the determinant product theorem.
Why the structural rules follow
Zero rows and zero columns
Theorem
A zero row or zero column gives determinant zero
If every entry in one row or one column of a square matrix is zero, then its determinant is zero.
Theorem
A row or column with one possible nonzero entry
For a square matrix of size , suppose all entries in row are zero except possibly . Then
The same formula holds when all entries in column are zero except possibly . The formula includes the case .
For , a matrix with a zero row is , whose determinant is by the base definition. For , expand along that row using the arbitrary-row theorem. Every term has a zero entry as its factor, so every term is zero and hence .
The zero-column statement can be proved directly by induction, which makes the inheritance of the zero column explicit. For , the only matrix with a zero column is , and its determinant is . Assume the statement for . Let be a matrix with zero column . Expand along the first row. The term from column is zero. In every other term, delete row and a column ; the original zero column survives as a zero column of the resulting submatrix (with its index shifted when ). By the induction hypothesis each such submatrix has determinant zero. Hence every term is zero, proving .
For the one-support theorem, the row case follows by expanding along row : all terms except the -term vanish. For the column case, expand along row . The -term remains. For each , the submatrix inherits a zero column from column of , so its determinant is zero by the zero-column result. Therefore only remains. This is the precise reason that a sparse row or column collapses the calculation to one minor.
Triangular matrices
Theorem
Triangular determinant theorem
If is upper triangular or lower triangular, then
We prove the upper-triangular statement by induction on . For , it is the determinant definition. Suppose it holds for upper-triangular matrices, and let be upper triangular of size . Its last row has zero entries except possibly . Expanding along that last row gives
because the sign is . The retained submatrix is still upper triangular, with diagonal . By induction its determinant is , giving the required product through . For a lower-triangular matrix, expand along the first row, whose only possible nonzero entry is ; the retained submatrix is lower triangular with diagonal , and the same induction proves the result.
Multilinearity in one fixed row
Theorem
Multilinearity in one fixed row
Fix every row except row . If the new row is , then
For , the base definition gives
For , fix every row except row . Let matrices agree in all those fixed rows, and suppose their th rows satisfy . For each column , deleting row gives the same submatrix:
Expanding along row and using the entrywise relation gives
The equality works precisely because every other row is held fixed; changing two rows at once is a different statement.
Adjacent swaps and repeated rows
Theorem
Repeated rows force determinant zero
If a square matrix has two identical rows, then its determinant is .
Let have adjacent rows , and let be obtained by swapping those two physical rows. Expand along row . Expand along row , where the row has moved. For each column , the retained submatrix in the two expansions is the same matrix: deleting the position occupied by leaves the other row in the same order. However, the signs differ:
The entries and minors therefore match term by term with the opposite sign, so . Swapping rows in positions can be realised by adjacent swaps, an odd number, and hence also changes the sign.
If rows and of are identical, the matrix obtained by swapping them is still . The swap result then gives . Since the entries are real, this implies and therefore . This proof does not rely on a later row-replacement rule.
Indexing and strategy
For each term, keep three objects visible: the selected entry, its submatrix after deleting one row and one column, and the minor obtained by taking that submatrix determinant. Write the checkerboard sign from the original row and column positions before evaluating the minor. When a minor is expanded again, its local indices guide the inner sign; they do not replace the outer sign.
The arbitrary-row and arbitrary-column theorem makes the choice of expansion line strategic. Choose a line with many zeros or simple surviving minors, and state that choice before calculating. A zero entry removes a branch immediately, whereas a zero minor must be established by its own calculation. The recursive first-row formula defines the determinant; arbitrary-line expansion is the theorem that permits this computational choice.
Reversible operations and their matrices
Definition
Elementary row operations and elementary matrices
Work over the real numbers. Let be an matrix. An elementary row operation is one of the following, with the indicated row indices distinct when two rows occur:
- : interchange rows and ;
- , where ;
- .
The corresponding elementary matrix is obtained by applying that operation to . Left multiplication gives the same operation on every matrix : the transformed matrix is . The restriction is essential for an elementary operation because it makes the operation reversible.
The determinant scaling rule itself still holds for : a zero row gives determinant zero. However, zero scaling is not reversible and therefore is not an elementary factor in a product that is being undone. Keeping these two facts separate prevents a zero factor from being cancelled later.
Finite elimination and elementary inverses
For a real matrix, scan columns from left to right in the rows below the last chosen pivot. If an available column has a nonzero entry, move it to the next pivot position by a swap, scale by its nonzero reciprocal, and subtract multiples of this row to clear entries below. If no entry is available in that column, move to the next column. There are at most pivots and finitely many arithmetic operations, so this constructs REF. Clearing pivot columns above from the last pivot upward constructs RREF and does not disturb earlier pivot columns. In a homogeneous RREF system, any free variable can be assigned, and back substitution uniquely determines pivot variables. Setting one free variable to one and the others to zero therefore gives a nonzero homogeneous solution. With no free variable the only homogeneous solution is zero.
An elementary matrix is the result of applying one legal row operation to . Its row-column product with any matrix performs that same operation. The reverse operation is respectively the same swap, scaling by for , or adding times the source row. Its elementary matrix satisfies , because the two compositions restore every row of . A finite product of elementary matrices is invertible by applying their inverses in reverse order; associativity verifies both inverse identities. These facts supply the elimination and reversible-factor hypotheses in the following square-matrix equivalence proof.
Equivalent formulations
Theorem
Equivalent ways to recognize invertibility
Let be a real matrix. The following conditions are equivalent:
- is invertible.
- is row-equivalent to .
- is a product of elementary row-operation matrices of order .
- has a left inverse.
- has a right inverse.
- is nonsingular: has only the zero solution.
- For every , the system is consistent.
- For every , the system has exactly one solution.
Equivalently, the columns of are linearly independent, or they span . When these conditions hold, the unique solution is .
Proof
Where the square hypothesis enters the equivalence proof
A left inverse forces the homogeneous solution to be zero: if , then . Conversely, suppose the homogeneous system has only the zero solution. In any RREF of , a free variable would produce a nonzero homogeneous solution. Thus every column has a pivot. Because is square, there are also exactly pivot rows, and the RREF is .
If a row-operation product satisfies , the reverse chain shows that is invertible and . Hence is invertible and is itself a product of elementary matrices. Conversely, any such product is invertible, and an inverse is in particular a left inverse. This connects conditions 1–4 and 6 without assuming uniqueness of RREF.
Now suppose . Then is a left inverse of the square matrix . The already proved left-inverse criterion makes invertible, and is invertible. This proves the right-inverse criterion without silently reversing a product.
If every is consistent, choose solutions of , where is column of . Their matrix satisfies , so the right-inverse criterion applies. Finally, when is invertible, proves existence, and any solution satisfies , proving uniqueness. Uniqueness for every right-hand side implies consistency for every right-hand side.
The column statements are translations: independence means that has only the zero coefficient vector, and spanning means that every has a representation . Thus no additional assumption about the columns is being introduced.
The multiplier for each row operation
Theorem
The three row-operation determinant rules
For an matrix , with and whenever two row indices occur:
- If results from by , then .
- If results from by , then , including the identity at .
- If results from by with , then .
The first rule is the alternating property of the determinant. For the second, hold every row except row fixed and use linearity in that row. If is replaced by , the determinant is multiplied by .
For a replacement, the row indices must be distinct. If , the new row is , so the determinant is multiplied by .
Proof
Derive the row-replacement rule from multilinearity
Write the rows of as , and let be obtained by replacing row by , where . Construct by replacing row of by . The th row of is
All other rows of , , and agree. Therefore multilinearity in row gives
Rows and of are identical, so the alternating property gives . Hence . This proof also shows exactly which distinct-row assumption makes the extra term vanish.
Theorem
The mixed-operation ledger
Suppose a sequence of elementary operations changes into . If the sequence contains swaps and scales rows by nonzero factors , then
Consequently,
Row replacements do not appear in the product because their multiplier is .
If is a square row-echelon matrix, it is upper triangular and is the product of its diagonal entries. A zero row makes this product zero, so the ledger immediately gives because its denominator contains only nonzero factors. If this row-echelon matrix has no zero row, each of its diagonal positions is a pivot, so the diagonal product is nonzero. An arbitrary upper triangular matrix need not have this property: for example, is upper triangular but has zero determinant. The row-echelon qualification is therefore essential.
A disciplined row-reduction algorithm
Before starting, write the matrix size and mark the roles of the rows. At each stage, use only a legal elementary operation: the two row indices in a swap or replacement must be distinct, and every scaling factor recorded in the ledger must be nonzero. Then follow this sequence:
- Reduce the entries below each pivot, using row replacements whenever they suffice. Record a swap immediately when a pivot must be moved.
- If a pivot row is normalized, record its factor with its sign and position in the sequence. The final diagonal product belongs to the scaled matrix, so this factor will be divided out.
- Stop at an upper triangular matrix. If a zero row appears, stop there: no later division by a supposed pivot is justified, and the determinant is already certified to be zero.
- Multiply the diagonal entries of the final triangular matrix. Finally apply , rather than trying to remember the corrections mentally.
This algorithm permits different valid elimination choices. Two reduction paths may produce different triangular matrices and different intermediate pivots, but their ledgers must return the same determinant. That agreement is a useful check on arithmetic, while the theorem explains why it is guaranteed. The same discipline also applies to an augmented matrix: when solving , an elementary operation acts on as a whole, whereas determinant bookkeeping concerns the square coefficient matrix .
From elementary factors to a product theorem
For one elementary operation, let be its matrix. When is also square of the same size, is square. Since is the result of applying the operation to , the row rules say is respectively , , or . Applying the same rule to gives
If is a sequence, induction on the number of factors gives
Now suppose is invertible. The earlier row-reduction theorem supplies a factorization . Applying the last formula first to and then to yields
Thus in the invertible case.
For the singular case, row-reduce to an echelon form . The invertibility dictionary from the earlier notes says that a singular square matrix has a zero row in . Let and set . Every factor is nonzero because every operation is reversible. The zero row of remains a zero row in , so
Since , cancellation gives and . The equality again follows, now with both sides zero.
The notation also records the order of operations. The rightmost factor acts first, then , and so on. No commutativity of matrices is being used in this argument. The factors are all , while is an matrix, so each intermediate product is defined. This dimensional condition is part of the theorem, not a cosmetic convention.
Theorem
Determinant of a product
If and are square matrices of the same size, then
This statement was proved by the two cases above. It is stronger than a calculation trick: although and can be different matrices, scalar multiplication commutes, so
Determinant and invertibility
Theorem
Determinant criterion for invertibility
For a square matrix ,
The proof of the product theorem already establishes both directions: an invertible matrix factors into elementary matrices with nonzero determinants, while a singular matrix reduces to an echelon matrix with a zero row. The nonzero reduction multiplier transfers that zero determinant to the original matrix.
The adjugate identity and continuity of inversion
For , let and define . The entry of is . If , row expansion makes this . If , it is the row- expansion of the matrix obtained by replacing row by row : its row- cofactors are unchanged, and its repeated rows make its determinant zero. Hence .
The permutation formula also gives : replace a permutation by its inverse. Their inversion numbers agree, since an inversion corresponds to the inversion of the inverse, and their entry products agree after reindexing. This applies to every minor too, so . Applying the first identity to and transposing yields . For , define and both identities are immediate.
When , the two identities prove . Each determinant and cofactor is a finite polynomial in matrix entries; thus this inverse formula is continuous wherever the determinant is nonzero. This supplies the continuity assertion used in the local inverse-function proof.
Proofs are given in triangular determinants and the determinant criterion.
Simultaneous Models: Valuation and Production Balances
Fixed weights give a linear valuation
Assign the fixed weights to two future payments. For the payment vector , the weighted value is
With the weights fixed, combining payment vectors combines their weighted values. If the weights depend on the payments or another changing input, that larger model need not be linear.
Three balances, one simultaneous solution
Suppose three quantities satisfy
Subtract twice the first equation from the second, and subtract the first from the third. The lower equations become and . Add the former to three times the latter: . Thus , , and . Substituting gives , , and in the three original left sides. The nonzero pivots determine every variable, so the solution is unique.
Gross output is not the same as final demand
Let be gross output, the internal use of those outputs, and final demand. A fixed-coefficient balance is
Take
Then has determinant . The vector solves the balance: internal use is , and adding final demand gives . Nonsingularity proves uniqueness, while nonnegativity and the direct balance verify feasibility for this demand.
A positive determinant alone is not a nonnegative-output guarantee. For example, and give , but the unique algebraic solution is . That solution is not feasible when outputs must be nonnegative. Solvability and model feasibility are different checks.
Order changes a matrix action
Let scale the first coordinate and exchange coordinates. Then
Scaling after the exchange differs from exchanging after the scale. For square matrices, ; the middle terms combine as only if .
A parameter can change the number of solutions
For , , elimination gives . If , there is one solution: and . If , every solves it. If , there is no solution. Dividing by before separating these cases would discard both singular possibilities.
Verify an inverse by substitution
For , the determinant is , so . Applied to , this gives . The original equations check as and .
Practice with full solutions
P01. Compute for and .
Solution. .
P02. Compute and for and .
Solution. and . Their off-diagonal entries differ, so the order matters.
P03. Is linear on ? Give a decisive test.
Solution. . Every linear map sends zero to zero, so this map is not linear.
P04. Solve , , and by elimination.
Solution. Subtract the second equation from the first: , so . The remaining equations give and . Adding gives , hence and . Substitution into the original equations verifies all three right sides.
P05. Find all solutions of and .
Solution. The second equation is twice the first. Set ; then . Thus every solution is , where . Substituting this expression verifies both equations for every parameter pair.
P06. Classify , for all real .
Solution. Subtract twice the first equation from the second: . If , then and , the unique solution. If , all solve it. If , the reduced equation is contradictory and there is no solution.
P07. Find the inverse of and use it to solve .
Solution. The determinant is , so . Multiplication gives . The check is .
P08. Find the determinant of and decide invertibility.
Solution. The matrix is triangular, so its determinant is . Therefore it is invertible.
P09. In , let and . Find gross output and verify internal use plus final demand.
Full solution. The equations are and , so . Internal use is ; adding demand gives . Every quantity is nonnegative, so the algebraic solution also satisfies the stated output constraint.
P10. Prove the particular-plus-null description of a consistent real linear system in both directions. Explain why its entire solution set cannot contain exactly two distinct vectors.
Solution. If and , then . Conversely, implies , so for a null vector. If two distinct solutions exist, their difference is null. Then solves the system for every real . These vectors are distinct for distinct , giving infinitely many solutions rather than exactly two.