Row equivalence is sameness of row space
ProvedHefferonLinAlg.row_equivalent_iff_same_row_spaceTwo matrices and over a field are row equivalent — that is, for some invertible — if and only if the span of the rows of equals the span of the rows of . This is where Chapter One's Linear Combination Lemma arrives: row reduction changes the rows but never the subspace they span, and that invariant is complete, which is what makes reduced echelon form a genuine canonical form for row equivalence.
import Mathlib open Matrix
namespace HefferonLinAlg
theorem row_equivalent_iff_same_row_space
{K : Type*} [Field K] {m n : ℕ} (A B : Matrix (Fin m) (Fin n) K) :
(∃ M : Matrix (Fin m) (Fin m) K, IsUnit M.det ∧ B = M * A) ↔
Submodule.span K (Set.range A) = Submodule.span K (Set.range B) := by
sorry
end HefferonLinAlgRead-back
What the Lean code literally says, in plain math · claude-opus-5
For every field (an arbitrary type carrying a field structure), every pair of natural numbers (both allowed to be ), and every two matrices of the same shape with entries in — indexed by — the following two statements are asserted to be equivalent (a genuine two-directional "if and only if", not an implication in one direction):
Here the left-hand side quantifies existentially over square matrices of size over the same field, requires that be an invertible element of (over a field this is exactly ; note that for the determinant of the unique empty matrix is , which is a unit, so the condition is satisfiable there), and requires the exact matrix identity with multiplied on the left of (ordinary matrix product, so each row of is the corresponding -linear combination of the rows of with coefficients from that row of ); no condition whatsoever is imposed on or themselves (they may be zero, may be equal, may have repeated rows). On the right-hand side, for a matrix of shape the set is literally the range of viewed as a function of its first index, i.e. the set of its rows
a subset of the -vector space of functions from to — a set, so repeated rows are counted once and no multiplicity or ordering information is retained — and is the smallest -linear subspace of containing that set; the asserted relation between the two spans is equality of subspaces (mutual inclusion), not merely one inclusion. Degenerate cases are included silently by the quantifiers: when both row sets are empty and both spans are the zero subspace, and the unique matrix has unit determinant, so both sides hold; when the space is the zero space, every row is the zero vector, both spans are again the zero subspace, and the identity matrix witnesses the left side, so both sides hold as well. The statement says nothing about uniqueness of , nothing about and having any particular rank, and nothing about column spaces or about matrices of differing row counts.
Confirmed by the mission captain (proposal self-audit).