Cramer's Rule
Statement
Let be an invertible matrix over a commutative ring (so is a unit), and let . The unique solution to satisfies:
where is the matrix with its -th column replaced by .
In the non-invertible / commutative ring setting, the adjugate form of the rule states:
where , without requiring to be a unit.
Visualization
Solve the system:
which corresponds to with:
Compute :
Since , the system has a unique solution.
Compute — replace column 1 with :
Compute — replace column 2 with :
Apply Cramer's rule:
Verify:
Proof Sketch
The adjugate satisfies by definition (cofactor expansion). Setting , one computes:
The -th component of is , which is precisely the cofactor expansion of along column . When is a unit, dividing through gives the classical formula .
Connections
- Rank–Nullity TheoremRank–Nullity TheoremThe dimensions of image and kernel of a linear map sum to the domain dimensionRead more → — Cramer's rule applies when ; otherwise the system has no unique solution.
- Determinant MultiplicativityDeterminant MultiplicativityThe determinant of a product equals the product of determinantsRead more → — the adjugate identity is a consequence of cofactor expansion and the multiplicativity of .
- Cayley–Hamilton TheoremCayley–Hamilton TheoremEvery square matrix satisfies its own characteristic polynomialRead more → — the adjugate appears in the Cayley–Hamilton proof; is assembled from the identity .
- Spectral TheoremSpectral TheoremEvery real symmetric matrix is orthogonally diagonalizableRead more → — in an orthogonal basis of eigenvectors, the linear system decouples and each component's solution is , a spectral analogue of Cramer's formula.
- Quadratic FormulaQuadratic FormulaSolve any quadratic equation using the discriminantRead more → — for , Cramer's rule recovers ; the quadratic formula solves the eigenvalue equation.
Lean4 Proof
/-- Cramer's rule in adjugate form: A *ᵥ (cramer A b) = det(A) • b.
This holds over any commutative ring without requiring det(A) to be
a unit. Mathlib locates this in LinearAlgebra.Matrix.Adjugate. -/
theorem cramers_rule {n R : Type*}
[Fintype n] [DecidableEq n] [CommRing R]
(A : Matrix n n R) (b : n → R) :
A *ᵥ (Matrix.cramer A b) = A.det • b :=
Matrix.mulVec_cramer A bReferenced by
- WronskianDifferential Equations
- Variation of ParametersDifferential Equations
- Determinant MultiplicativityLinear Algebra
- Rank–Nullity TheoremLinear Algebra
- LU DecompositionLinear Algebra