Gauss's method preserves the solution set
ProvedHefferonLinAlg.gauss_row_operations_preserve_solutionsLet be an matrix over a field , let , and let be an matrix whose determinant is a unit, so that is invertible. Then a vector satisfies if and only if it satisfies . Each of Gauss's three elementary row operations — swapping two rows, scaling a row by a nonzero constant, and adding a multiple of one row to another — is left multiplication by such an invertible , so this is the statement that row reduction carries a linear system to an equivalent one.
import Mathlib open Matrix
namespace HefferonLinAlg
theorem gauss_row_operations_preserve_solutions
{K : Type*} [Field K] {m n : ℕ}
(A : Matrix (Fin m) (Fin n) K) (b : Fin m → K)
(M : Matrix (Fin m) (Fin m) K) (hM : IsUnit M.det) (x : Fin n → K) :
A *ᵥ x = b ↔ (M * A) *ᵥ x = M *ᵥ b := by
sorry
end HefferonLinAlgRead-back
What the Lean code literally says, in plain math · claude-opus-5
The declaration HefferonLinAlg.gauss_row_operations_preserve_solutions asserts the following. Let be an arbitrary field (commutative, with ; no further assumptions — no characteristic, ordering, algebraic-closure, or finiteness assumption), and let be arbitrary natural numbers, including . Let be an matrix over (rows indexed by , columns by ), let be a column vector, let be a square matrix over , and let be a column vector; all five of , , , , together with , , , are universally quantified, so the claim is made for every such choice. The single hypothesis is that is a unit of — since is a field this is exactly , i.e. is invertible; this hypothesis is satisfiable for every (e.g. , and for the empty determinant is ), so the statement is not vacuous. Under these assumptions the conclusion is the two-directional equivalence (if and only if) of the two vector equations
where all products are the usual ones over : for , is the matrix with entries , , and ; equality of vectors means componentwise equality in every coordinate . Note that the equivalence is asserted about one fixed vector at a time rather than being phrased as an equality of solution sets (though, being universally quantified, the claim ranges over all ), that the statement says nothing about being an elementary matrix, a product of elementary matrices, or arising from any specific row operation — only that its determinant is invertible — and that it says nothing about the existence of any solution. Degenerate cases are silently included: when there are no coordinates and both sides of the equivalence hold trivially for all data; when the vector is empty, is the zero vector of , and the assertion reduces to " if and only if ". Finally, the declaration is stated with its proof omitted (left as sorry), so nothing here is established by the file itself.
Confirmed by the mission captain (proposal self-audit).