Module 1 of 1 · Lesson 10 of 14

Matrix Inverses and Elementary Matrices

Computing an inverse, and seeing elimination itself as a product of matrices.

What you will be able to do

Given a square matrix, the learner can decide whether it is invertible, compute the inverse by Gauss–Jordan elimination, verify it, express the reduction as a product of elementary matrices, apply the order-reversal rule to a product, and produce an LU factorisation.

Orientation

The inverse is usually defined by what it does, A A − 1 = A − 1 A = I , and that says nothing about how to find one, or how to tell whether one exists.

Both answers come from the same place. Reducing A to the identity is a sequence of reversible row operations, and each operation is itself a matrix. So a reduction is a product, the product is the inverse, and running the same operations on I accumulates it. If the reduction stalls, the matrix has dependent columns and no inverse. The method reports failure as informatively as success.

Seeing row operations as matrices pays twice more: it gives the LU factorisation, which is what implementations actually store, and it explains why the inverse of a product reverses the order of its factors.

Figure

A square carried by A and returned by its inverse

A⁻¹A returns every point to where it began

A = ( 2 1 1 1 ) applied to the unit square, then A − 1 = ( 1 − 1 − 1 2 ) applied to the result.

The marked corner ( 1 , 1 ) travels to ( 3 , 2 ) and comes back to ( 1 , 1 ) . So does every other point, which is what the equation A − 1 A = I says: not a fact about arrays of numbers, but the statement that the round trip is the identity.

Invertibility is therefore a property of the transformation. A is invertible exactly when distinct points stay distinct and the image still fills the plane, so there is enough information left to find the way back. The singular case in the determinant figure is the contrast: once the square is flattened onto a line, every point of that line is the image of many starting points, and no map can choose among them.

Row reduction is how A − 1 is computed, and that remains algebra. What it computes is this journey run backwards.

Definition

Elementary matrices, and why one-sided is enough

Building an elementary matrix. Perform the row operation on I ; the result is the matrix that performs it. To add − 5 × row 1 to row 2 in a 2 × 2 system,

E = ( 1 0 − 5 1 ) ,

and E A is A with that operation applied. The rule matters because it is easy to build the transpose by mistake: the multiplier − 5 sits at position ( 2 , 1 ) , row 2, the row being changed, and column 1, the row being used.

Left multiplication acts on rows. E A combines rows of A ; A E combines its columns. Elimination is a row process, so its matrices act from the left, and the order of a reduction is read right to left: E k ⋯ E 1 A applies E 1 first.

Every elementary matrix is invertible. Each operation is undone by another of the same type, swap again, scale by the reciprocal, subtract what was added, so the inverse is elementary too. That is what makes a reduction a product of invertible factors and therefore invertible itself.

Why one-sided invertibility suffices. For square A , if B A = I then A has trivial kernel: A x = 0 gives x = B A x = 0 . By rank–nullity the rank is full, so A is onto, and a right inverse exists; the uniqueness argument then forces it to equal B . So checking one side is enough, and the two-sided definition is stated for clarity rather than necessity.

This fails outside the square finite-dimensional case. The shift on infinite sequences has a left inverse and no right inverse, which is the same phenomenon that breaks rank–nullity there.

Uniqueness. If B A = I = A C then B = B ( A C ) = ( B A ) C = C , so the inverse is justified. The argument uses only associativity, which is why it holds in any setting where products associate.

Procedure

Gauss–Jordan, and the LU bookkeeping

Computing A − 1 .

  1. Write the augmented array [ A ∣ I ] .
  2. Reduce the left block to I by row operations, applying each to the whole row.
  3. The right block is A − 1 .
  4. Verify by computing A A − 1 .

If at any point the left block acquires a zero row, stop: A is singular and has no inverse. That is a proof, not a failure of the method.

Why step 3 works. The operations that reduce A to I multiply to A − 1 , and applying them to I accumulates exactly that product. The augmented array runs both reductions in parallel.

For 2 × 2 , a formula.

( a b c d ) − 1 = 1 a d − b c ( d − b − c a ) ,

swap the diagonal, negate the off-diagonal, divide by the determinant. Worth memorising at this size and not worth generalising: the adjugate version for n × n needs n 2 cofactors and is impractical beyond 3 × 3 .

LU factorisation.

  1. Eliminate downward using only "add a multiple of a row to a lower row".
  2. Record each multiplier m j i . The factor used to clear position ( j , i ) .
  3. U is the resulting upper triangular matrix.
  4. L is unit lower triangular with m j i at position ( j , i ) .

The multipliers go into L with their own sign, not negated: if the step was R j → R j − 2 R i , then L j i = 2 . This is the step most often reversed, and multiplying L U back out catches it immediately.

What LU is for. Solving A x = b becomes L y = b by forward substitution then U x = y by back substitution, each O ( n 2 ) . With several right-hand sides the factorisation is computed once and reused. And det A is the product of U 's diagonal, since L has unit diagonal and both are triangular.

When a swap is needed. If a pivot position holds zero, rows must be exchanged, and the factorisation becomes P A = L U with P a permutation. Implementations swap even for a small pivot, because dividing by it magnifies error.

Cost, and why inverses are rarely formed. Elimination to solve one system is about n 3 / 3 operations. Computing A − 1 is about n 3 , and then A − 1 b is a further n 2 , three times the work for a worse-conditioned result. Form an inverse when the matrix itself is the object of interest; otherwise factor.

Worked example

An inverse, and the same reduction as a product

A = ( 2 1 5 3 ) .

Gauss–Jordan. Start from [ A ∣ I ] and record each operation.

[ 2 1 1 0 5 3 0 1 ] → R 1 → 1 2 R 1 [ 1 1 2 1 2 0 5 3 0 1 ]
→ R 2 → R 2 − 5 R 1 [ 1 1 2 1 2 0 0 1 2 − 5 2 1 ] → R 2 → 2 R 2 [ 1 1 2 1 2 0 0 1 − 5 2 ]
→ R 1 → R 1 − 1 2 R 2 [ 1 0 3 − 1 0 1 − 5 2 ]

So

A − 1 = ( 3 − 1 − 5 2 ) .

Verify. A A − 1 = ( 2 1 5 3 ) ( 3 − 1 − 5 2 ) = ( 6 − 5 − 2 + 2 15 − 15 − 5 + 6 ) = I , and A − 1 A = I likewise.

Cross-check by formula. det A = 6 − 5 = 1 , so the inverse is 1 1 ( 3 − 1 − 5 2 ) . The determinant being 1 is why the entries came out as integers.

---

The same reduction as elementary matrices. Each step was multiplication on the left:

E 1 = ( 1 2 0 0 1 ) , E 2 = ( 1 0 − 5 1 ) , E 3 = ( 1 0 0 2 ) , E 4 = ( 1 − 1 2 0 1 ) .

Since E 4 E 3 E 2 E 1 A = I , the product is the inverse. Multiplying out:

E 4 E 3 E 2 E 1 = ( 3 − 1 − 5 2 ) = A − 1

Note the order: E 1 was applied first and stands rightmost. Reading the product left to right runs the reduction backwards.

And therefore A is a product of elementary matrices, namely A = E 1 − 1 E 2 − 1 E 3 − 1 E 4 − 1 . The inverses in reversed order, each itself elementary. That is the general statement: a matrix is invertible exactly when it is such a product.

---

LU for a 3 × 3 .

C = ( 2 1 1 4 − 6 0 − 2 7 2 ) .

Eliminate downward. R 2 → R 2 − 2 R 1 with multiplier 2 ; R 3 → R 3 − ( − 1 ) R 1 with multiplier − 1 ; then R 3 → R 3 − ( − 1 ) R 2 with multiplier − 1 . The result is

L = ( 1 0 0 2 1 0 − 1 − 1 1 ) , U = ( 2 1 1 0 − 8 − 2 0 0 1 ) .

Check. L U reproduces C exactly, row 2 of L U is 2 ( 2 , 1 , 1 ) + ( 0 , − 8 , − 2 ) = ( 4 , − 6 , 0 ) , and row 3 is − ( 2 , 1 , 1 ) − ( 0 , − 8 , − 2 ) + ( 0 , 0 , 1 ) = ( − 2 , 7 , 2 ) .

A free determinant. det C = det L ⋅ det U = 1 × ( 2 ) ( − 8 ) ( 1 ) = − 16 , since both are triangular and L has unit diagonal. No cofactor expansion was needed.

Theorem

The equivalences, and the order reversal

Theorem (invertible matrix equivalences). For a square A of size n , the following are equivalent:

  1. A is invertible;
  2. A reduces to I by row operations;
  3. A is a product of elementary matrices;
  4. rank ⁡ A = n ;
  5. the columns of A are independent;
  6. A x = 0 has only the solution x = 0 ;
  7. A x = b has exactly one solution for every b ;
  8. det A ≠ 0 ;
  9. 0 is not an eigenvalue of A .

A circuit of implications. ( 1 ) ⇒ ( 6 ) : A x = 0 gives x = A − 1 A x = 0 . ( 6 ) ⇒ ( 5 ) is the definition of independence applied to the columns. ( 5 ) ⇒ ( 4 ) is the definition of rank. ( 4 ) ⇒ ( 2 ) : full rank means a pivot in every column, and back-substitution clears above them. ( 2 ) ⇒ ( 3 ) : the reduction is E k ⋯ E 1 A = I , so A = E 1 − 1 ⋯ E k − 1 , a product of elementary matrices. ( 3 ) ⇒ ( 1 ) : each factor is invertible, so the product is.

The remaining three attach to the circuit: ( 8 ) by multiplicativity, since det A ⋅ det A − 1 = 1 forces det A ≠ 0 , and conversely a zero determinant means dependent columns; ( 9 ) because 0 being an eigenvalue means a nonzero kernel vector, which is ( 6 ) failing; and ( 7 ) because uniqueness for one b is ( 6 ) and existence for all b is ( 4 ) . ◼

The list functions as a whole. Each entry is cheap to check in some situations and expensive in others, and the theorem says any one settles all the rest. A determinant for a small matrix, a rank for a reduced one, an eigenvalue when the spectrum is already known.

Theorem (order reversal). If A and B are invertible then so is A B , with

( A B ) − 1 = B − 1 A − 1 .

Proof. ( A B ) ( B − 1 A − 1 ) = A ( B B − 1 ) A − 1 = A A − 1 = I , and the other side is the same computation. Uniqueness of inverses does the rest. ◼

The order must reverse because the inner factors have to meet: in ( A B ) ( B − 1 A − 1 ) it is B and B − 1 that are adjacent. Writing A − 1 B − 1 instead leaves B next to A − 1 , which cancels nothing.

Corollary. ( A 1 A 2 ⋯ A k ) − 1 = A k − 1 ⋯ A 2 − 1 A 1 − 1 , by induction, which is what turns a reduction E k ⋯ E 1 A = I into the factorisation A = E 1 − 1 ⋯ E k − 1 .

The analogous rules. ( A T ) − 1 = ( A − 1 ) T , and ( A B ) T = B T A T . The transpose reverses order too. Both reversals have the same cause: these operations turn a composition around.

Example

Inverses read off structure

Diagonal. diag ⁡ ( d 1 , … , d n ) − 1 = diag ⁡ ( 1 / d 1 , … , 1 / d n ) , provided every d i ≠ 0 . A single zero on the diagonal makes the matrix singular, since that column is zero.

Elementary. Each is inverted by undoing its operation: ( 1 0 − 5 1 ) − 1 = ( 1 0 5 1 ) , and a swap matrix is its own inverse.

Orthogonal. Q − 1 = Q T , by definition of orthogonality. The cheapest inverse available, and the reason U and V in a singular value decomposition are convenient to work with.

Triangular. The inverse of an invertible triangular matrix is triangular of the same kind, and its diagonal entries are the reciprocals. For

( 2 3 0 4 ) − 1 = 1 8 ( 4 − 3 0 2 ) = ( 1 2 − 3 8 0 1 4 ) ,

the diagonal holds 1 / 2 and 1 / 4 as promised, and the matrix is still upper triangular.

A 2 × 2 with determinant 1. ( 2 1 5 3 ) − 1 = ( 3 − 1 − 5 2 ) , integer entries throughout, because dividing by det = 1 introduces no fractions. Any integer matrix with determinant ± 1 inverts to an integer matrix, which is why such matrices are the invertible ones over the integers.

Singular cases. ( 1 2 2 4 ) has determinant 0 and its second row is twice the first, so reduction produces a zero row. ( 1 2 3 0 0 0 4 5 6 ) has a zero row already, and ( 1 1 1 1 ) has equal rows. Each fails every entry of the equivalence list at once, rank below n , zero determinant, nontrivial kernel, 0 an eigenvalue.

What the pattern shows. For a structured matrix the inverse is usually structured the same way and readable without elimination. Recognising the structure first is what saves the computation, and it is also what tells you the answer is wrong when a triangular matrix produces a full inverse.

Non-example

Five errors with inverses

Preserving the order. Writing ( A B ) − 1 = A − 1 B − 1 . With A = ( 2 1 5 3 ) and B = ( 1 2 0 1 ) , the product is A B = ( 2 5 5 13 ) with inverse ( 13 − 5 − 5 2 ) . Computing B − 1 A − 1 gives exactly that; computing A − 1 B − 1 gives ( 3 − 7 − 5 12 ) , a different matrix. The inner factors must be adjacent to cancel.

Inverting entrywise. Replacing each entry by its reciprocal. For ( 2 1 5 3 ) that would give ( 1 / 2 1 1 / 5 1 / 3 ) , whose product with A is nothing like I . The inverse inverts the map, not the numbers; the entrywise reciprocal has no algebraic meaning here, and a zero entry makes it undefined for matrices that are perfectly invertible.

Negating the LU multipliers. After R 2 → R 2 − 2 R 1 , recording − 2 in L rather than 2 . Multiplying L U back out then fails to reproduce A . The check exists precisely because this slip is silent otherwise. L holds the multipliers used, with their own signs.

Treating a stalled reduction as a dead end. Reaching a zero row on the left of [ A ∣ I ] and concluding the arithmetic went wrong. It is a proof: a zero row means the rows are dependent, so the rank is below n and no inverse exists. The correct response is to report singularity, not to restart.

Cancelling a singular matrix. From A B = A C , concluding B = C . That step multiplies by A − 1 and needs A invertible. With A = ( 1 1 1 1 ) , taking B = I and C = ( 0 2 2 0 ) gives A B = A C = ( 1 1 1 1 ) ⋅ , both products equal ( 2 2 2 2 ) , while B ≠ C . Cancellation is a theorem about invertible matrices, not a rule of algebra.

What unites them. The first and last forget that matrix multiplication is neither commutative nor cancellative without invertibility. The middle three treat a matrix as a container of numbers rather than as a map, which is the habit the elementary-matrix reading is meant to displace.

Optional enrichment (1)

Application

Why implementations factor instead of inverting

The cost comparison. Solving A x = b by elimination takes about n 3 / 3 multiplications. Computing A − 1 takes about n 3 , three reductions' worth, and then A − 1 b costs a further n 2 . For a single system the inverse is three times the work for the same answer.

With k right-hand sides the comparison changes but the conclusion does not: factor once into L U at n 3 / 3 , then each solve is 2 n 2 by forward and back substitution. The factorisation is reused exactly as an inverse would be, at a third of the cost to obtain.

The accuracy comparison. Forming A − 1 and multiplying is less accurate than solving directly, because the explicit inverse accumulates rounding across every entry, and the subsequent multiplication adds more. The error in A − 1 b can exceed that of the elimination answer by a factor related to the condition number σ 1 / σ n from the SVD unit.

Where the revised simplex method sits. That method maintains A B − 1 across iterations and updates it by a single elementary matrix per pivot, exactly the E of this unit, built from the entering column's direction. Practical implementations store the elementary factors, or an L U of the basis, rather than an explicit inverse, and refactorise periodically as the accumulated product drifts. The algorithm is unchanged; only what is stored differs.

Where an explicit inverse is right. When the inverse is the object of interest rather than a means to a solution: a covariance matrix's inverse is the precision matrix and its entries carry meaning, and in small symbolic derivations the closed form is what is wanted. The rule is that A − 1 appearing in a formula rarely means "compute this"; it usually means "solve the corresponding system".

Reading A − 1 b as a solve. The habit worth forming is to translate: x = A − 1 b means " x solves A x = b ", and A − 1 B means "solve A X = B column by column". Every numerical library exposes this distinction, and choosing the solve is almost always right.

Next step

Practice Matrix Inverses and Elementary Matrices

Practice records what support you used, so the evidence reflects how you actually performed.

Practice this lessonSkip to Cross Products and Geometry in Space

Results update as you type. Use the up and down arrow keys to move between results, Enter to open one, and Escape to close.

Type to search.

Settings

Appearance

Interface density

Your record

Your progress is stored in this browser and nowhere else: an identifier, the answers you have given, the mastery states and review schedule derived from them, and the lesson you last opened. Clearing it makes you a new learner on this device. It cannot be undone, and it will not affect your appearance or density settings.

Focus timer

Focus--minutes remaining

Phase

Kept in this browser only, and used to label the session in your own history.

Today

Nothing recorded yet. Finish a focus session and it will appear here.

Settings

Focus sessions between long breaks.

Sessions you are aiming for in a day.

Notifications

Your history

Sessions are stored in this browser and nowhere else. They are not evidence and never reach your mastery record.