Multiply a row vector by a matrix, v * M. Equal to transpose M * v; the
j-th entry is ∑ i, M[i][j] * v[i], the combination of the rows of M with
coefficients v.
2.4. Span and nullspace
From the reduced form we compute the linear combination of the rows, row-span membership with an explicit witness, the Boolean span test, and a nullspace basis. Each has a soundness theorem. The nullspace basis also has a completeness theorem.
Hex.Matrix.vecMul.{u} {R : Type u} {n m : ℕ} [Mul R] [Add R] [OfNat R 0] (v : Vector R n) (M : Hex.Matrix R n m) : Vector R mHex.Matrix.vecMul.{u} {R : Type u} {n m : ℕ} [Mul R] [Add R] [OfNat R 0] (v : Vector R n) (M : Hex.Matrix R n m) : Vector R m
Hex.Matrix.spanCoeffs.{u} {R : Type u} {n m : ℕ} [Lean.Grind.Field R] [DecidableEq R] (M : Hex.Matrix R n m) (v : Vector R m) : Option (Vector R n)Hex.Matrix.spanCoeffs.{u} {R : Type u} {n m : ℕ} [Lean.Grind.Field R] [DecidableEq R] (M : Hex.Matrix R n m) (v : Vector R m) : Option (Vector R n)
Convenience wrapper: compute row-span coefficients using rowReduce internally.
Hex.Matrix.spanCoeffs_sound.{u} {R : Type u} {n m : ℕ} [Lean.Grind.Field R] [DecidableEq R] (M : Hex.Matrix R n m) (v : Vector R m) (c : Vector R n) : M.spanCoeffs v = some c → Hex.Matrix.vecMul c M = vHex.Matrix.spanCoeffs_sound.{u} {R : Type u} {n m : ℕ} [Lean.Grind.Field R] [DecidableEq R] (M : Hex.Matrix R n m) (v : Vector R m) (c : Vector R n) : M.spanCoeffs v = some c → Hex.Matrix.vecMul c M = v
Wrapper-layer soundness contract for Matrix.spanCoeffs.
Hex.Matrix.spanCoeffs_eq_none_iff.{u} {R : Type u} {n m : ℕ} [Lean.Grind.Field R] [DecidableEq R] (M : Hex.Matrix R n m) (v : Vector R m) : M.spanCoeffs v = none ↔ ¬∃ c, Hex.Matrix.vecMul c M = vHex.Matrix.spanCoeffs_eq_none_iff.{u} {R : Type u} {n m : ℕ} [Lean.Grind.Field R] [DecidableEq R] (M : Hex.Matrix R n m) (v : Vector R m) : M.spanCoeffs v = none ↔ ¬∃ c, Hex.Matrix.vecMul c M = v
spanCoeffs returns none exactly when v is in no row combination of M,
so a none result certifies that v is not in the row span.
Hex.Matrix.spanContains.{u} {R : Type u} {n m : ℕ} [Lean.Grind.Field R] [DecidableEq R] (M : Hex.Matrix R n m) (v : Vector R m) : BoolHex.Matrix.spanContains.{u} {R : Type u} {n m : ℕ} [Lean.Grind.Field R] [DecidableEq R] (M : Hex.Matrix R n m) (v : Vector R m) : Bool
Convenience wrapper: decide row-span membership using rowReduce internally.
Hex.Matrix.spanContains_iff.{u} {R : Type u} {n m : ℕ} [Lean.Grind.Field R] [DecidableEq R] (M : Hex.Matrix R n m) (v : Vector R m) : M.spanContains v = true ↔ ∃ c, Hex.Matrix.vecMul c M = vHex.Matrix.spanContains_iff.{u} {R : Type u} {n m : ℕ} [Lean.Grind.Field R] [DecidableEq R] (M : Hex.Matrix R n m) (v : Vector R m) : M.spanContains v = true ↔ ∃ c, Hex.Matrix.vecMul c M = v
The public spanContains wrapper is exactly row-span membership.
Hex.Matrix.nullspace.{u} {R : Type u} {n m : ℕ} [Lean.Grind.Field R] [DecidableEq R] (M : Hex.Matrix R n m) : Vector (Vector R m) (m - M.rowReduce_rank)Hex.Matrix.nullspace.{u} {R : Type u} {n m : ℕ} [Lean.Grind.Field R] [DecidableEq R] (M : Hex.Matrix R n m) : Vector (Vector R m) (m - M.rowReduce_rank)
Convenience wrapper: compute the nullspace basis using rowReduce internally.
Hex.Matrix.nullspaceBasisMatrix.{u} {R : Type u} {n m : ℕ} [Lean.Grind.Field R] [DecidableEq R] (M : Hex.Matrix R n m) : Hex.Matrix R m (m - M.rowReduce_rank)Hex.Matrix.nullspaceBasisMatrix.{u} {R : Type u} {n m : ℕ} [Lean.Grind.Field R] [DecidableEq R] (M : Hex.Matrix R n m) : Hex.Matrix R m (m - M.rowReduce_rank)
The public nullspace basis assembled as a matrix of basis columns.
Hex.Matrix.nullspace_sound.{u} {R : Type u} {n m : ℕ} [Lean.Grind.Field R] [DecidableEq R] (M : Hex.Matrix R n m) (k : Fin (m - M.rowReduce_rank)) : M * M.nullspace.get k = 0Hex.Matrix.nullspace_sound.{u} {R : Type u} {n m : ℕ} [Lean.Grind.Field R] [DecidableEq R] (M : Hex.Matrix R n m) (k : Fin (m - M.rowReduce_rank)) : M * M.nullspace.get k = 0
Every vector returned by the public nullspace wrapper is annihilated by M.
Hex.Matrix.nullspace_complete.{u} {R : Type u} {n m : ℕ} [Lean.Grind.Field R] [DecidableEq R] (M : Hex.Matrix R n m) (v : Vector R m) : M * v = 0 → ∃ c, M.nullspaceBasisMatrix * c = vHex.Matrix.nullspace_complete.{u} {R : Type u} {n m : ℕ} [Lean.Grind.Field R] [DecidableEq R] (M : Hex.Matrix R n m) (v : Vector R m) : M * v = 0 → ∃ c, M.nullspaceBasisMatrix * c = v
Every vector annihilated by M is generated by the public nullspace basis matrix.