INDEX: LINEAR-ALGEBRA-FOR-ML / MATH-LA-12READING_TIME: 15 mins

4.3 Matrix Inverse & Invertibility

In algebra, we divide numbers to solve equations. For example, if 5x=205x = 20, we multiply both sides by the reciprocal (the inverse) of 55, which is 15\frac{1}{5} or 515^{-1}, to get x=4x = 4.

In matrix algebra, we cannot divide matrices. Instead, we multiply by the Matrix Inverse, denoted as A1A^{-1}. Let's learn how to "undo" transformations and understand when a matrix can be inverted.


1. What is a Matrix Inverse?

The inverse of a square matrix AA is a new matrix A1A^{-1} that satisfies the following property:

AA1=IA \cdot A^{-1} = I A1A=IA^{-1} \cdot A = I

Where II is the Identity matrix (which does nothing). Multiplying a matrix by its inverse is the matrix equivalent of dividing a number by itself to get 11.


2. Geometric Intuition: Undoing a Transformation

Think of a matrix AA as a physical action that moves basis vectors. The inverse matrix A1A^{-1} is the action that reverses or undoes it:

  • If matrix AA rotates the grid 3030^\circ counter-clockwise, then A1A^{-1} rotates the grid 3030^\circ clockwise.
  • If matrix AA stretches the grid by a factor of 22, then A1A^{-1} shrinks the grid by a factor of 0.50.5.

Applying AA followed by A1A^{-1} returns every vector in space to its original starting position.


3. Invertibility Conditions (When does an inverse exist?)

Only square matrices can have an inverse. However, not all square matrices are invertible! A matrix is invertible only if:

det(A)0\det(A) \neq 0

If det(A)=0\det(A) = 0, the matrix is singular (non-invertible).

Why Singular Matrices Cannot Be Inverted

Geometrically, a determinant of 00 means the matrix collapses the entire 2D space down onto a flat 1D line or point.

Imagine you take a 3D coordinate model of a teapot and squish it completely flat onto a 2D shadow. If I give you the flat shadow, you cannot reconstruct the original 3D coordinates because information about depth is lost forever.

Because space is collapsed and information is lost, it is physically impossible to undo the transformation. Therefore, singular matrices have no inverse.


4. Interactive Transformation Workspace

Use the sliders to experiment. Load the Collapse (Singular) preset. Notice how the space collapses to a single diagonal line and the determinant becomes 00. Read the analysis panel showing why it is non-invertible.

Interactive 2D Linear Transformation Visualizer

-4-4-2-22244î' [1.5, 0.5]ĵ' [0.5, 1.5]
Quick Presets
Matrix Entries: M = [[a, b], [c, d]]
a (î_x): 1.5
b (ĵ_x): 0.5
c (î_y): 0.5
d (ĵ_y): 1.5
Determinant Analysis
det(M) = ad - bc
det(M) = (1.50 × 1.50) - (0.50 × 0.50)
det(M) = 2.00
✅ Non-Singular: Area of the unit square scales by a factor of 2.00. Space is not collapsed, so the transformation is **fully invertible**!

5. Solving Systems of Equations using Inverses

If we have a system of equations Ax=bA\mathbf{x} = \mathbf{b}, and AA is non-singular, we can solve it algebraically by multiplying both sides by A1A^{-1}:

Ax=bA\mathbf{x} = \mathbf{b} A1Ax=A1bA^{-1} A \mathbf{x} = A^{-1} \mathbf{b} Ix=A1bI \mathbf{x} = A^{-1} \mathbf{b} x=A1b\mathbf{x} = A^{-1} \mathbf{b}

This is the standard algebraic formulation for finding solutions in machine learning models!


6. Check Your Understanding

Quiz / Test Your Knowledge

Why can we not solve the system Ax = b by computing x = A⁻¹b if the determinant of A is exactly 0?