If a matrix stretches, rotates, or shears space, can you undo that transformation? Yes, and the inverse matrix is the tool that reverses any linear transformation, paired with the identity matrix as the neutral state. This is essential for anyone working with linear algebra, machine learning, or computer graphics.
Before undoing anything, you need a reference point. That reference is the identity matrix, the matrix equivalent of the number one in regular multiplication.
What is the identity matrix and why does it matter?
The identity matrix, written as I, has ones along its main diagonal and zeros everywhere else. In a 2x2 case, it looks like a clean diagonal of ones with zeros filling the rest.
Its defining property is simple: any matrix A multiplied by I gives you back A, unchanged. Geometrically, the identity matrix is the transformation that does absolutely nothing. It leaves every vector exactly where it was.
What does the identity matrix do? It acts as the neutral element of matrix multiplication. Multiplying any matrix by I returns the same matrix, just like multiplying a number by 1.
Think of it as the starting line. If you want to reverse a transformation, you need to know what state you are returning to, and that state is the identity.
How does the inverse matrix reverse a transformation?
The inverse matrix, written as A⁻¹, is the transformation that cancels out the effect of A. Its defining property is that multiplying A by A⁻¹ gives you the identity matrix.
In plain language: doing a transformation and then undoing it is the same as doing nothing at all. That is exactly what the identity represents.
This matters because it gives you the most elegant solution to the system Ax = b. If you know A⁻¹, you can solve for x directly without resolving any system of equations.
Why is the inverse the cleanest solution to Ax = b?
Starting from Ax = b, multiply both sides by A⁻¹:
- A⁻¹ · A · x = A⁻¹ · b.
- A⁻¹ · A simplifies to the identity I.
- I · x = A⁻¹ · b, which leaves x = A⁻¹ · b.
You apply the inverse on both sides because in algebra, whatever you do to one side, you must do to the other to keep the equation balanced. The result is beautiful: a single dot product gives you x.
Visually, imagine a vector x alongside the standard basis vectors i and j. Apply A and everything shifts: x becomes b, and the basis vectors rotate and stretch. Apply A⁻¹ and everything snaps back to its original position.
When is a matrix invertible?
Here is the catch: not every matrix has an inverse. For a matrix to be invertible, it must meet two conditions.
- It must be square, meaning it has the same number of rows and columns. The inverse needs to work in both directions, A · A⁻¹ and A⁻¹ · A, and only square matrices produce the same identity in both cases.
- Its transformation must not collapse the space by losing dimensions. If a transformation flattens 2D into a line, there is no way to recover the lost information.
Why are not all matrices invertible? Because some transformations destroy information by collapsing dimensions, and you cannot rebuild what no longer exists. Only square matrices that preserve dimensionality can be reversed.
In the next lesson, you will see a specific number, the determinant, that tells you whether a matrix is invertible at a glance.
How do you verify that one matrix is the inverse of another?
Finding an inverse from scratch is a process you will learn later in the course. For now, you can verify whether a candidate matrix B is the inverse of A by computing the dot product A · B. If the result is the identity matrix, then yes, B is the inverse of A.
Take A = [[3, 2], [1, 1]] and B = [[1, -2], [-1, 3]]. Using linear combinations to compute A · B:
- First column: 1 · [3, 1] + (-1) · [2, 1] = [3 - 2, 1 - 1] = [1, 0].
- Second column: (-2) · [3, 1] + 3 · [2, 1] = [-6 + 6, -2 + 3] = [0, 1].
The result is [[1, 0], [0, 1]], the identity matrix. Confirmed: B is the inverse of A.
What properties does the inverse matrix have?
Three properties are worth keeping in your toolkit because they show up constantly in proofs and computations.
- The inverse of the inverse is the original matrix: (A⁻¹)⁻¹ = A. If you undo an undo, you are back to the start.
- The inverse of a product reverses the order: (A · B)⁻¹ = B⁻¹ · A⁻¹. Matrix multiplication reads right to left, so to undo a sequence, you reverse from the end.
- The inverse of the transpose equals the transpose of the inverse: (Aᵀ)⁻¹ = (A⁻¹)ᵀ. Order does not matter between these two operations.
The second property feels counterintuitive at first, but the logic is the same as taking off your shoes and socks. You put socks on first, then shoes; to undo, you remove shoes first, then socks.
A quick exercise to test your understanding
Given A = [[2, 5], [1, 3]] and B = [[3, -5], [-1, 2]], check whether B is the inverse of A, or the other way around. You already know the method: compute the dot product and see if it lands on the identity. Drop your answer in the comments.