Linear system solving and prescribed-entry kernel vectors by elimination #
Building on the spanning kernel family Cslib.LinearAlgebra.kernelBasis from
CslibFrontier.Foundations.LinearAlgebra.KernelVector, this module defines two total elimination
functions over any field with decidable equality:
Cslib.LinearAlgebra.kernelVecAt A j: selects the first member ofkernelBasis Awhose entryjis nonzero and scales it so entryjis1, returning0when every kernel vector ofAhas entryjequal to0(Cslib.LinearAlgebra.mulVec_kernelVecAt,Cslib.LinearAlgebra.kernelVecAt_apply_self_eq_one_iff,Cslib.LinearAlgebra.kernelVecAt_eq_zero).Cslib.LinearAlgebra.vecMulSolve M b: solvesw ᵥ* M = bwhenever a solution exists (Cslib.LinearAlgebra.vecMul_vecMulSolve,Cslib.LinearAlgebra.vecMul_vecMulSolve_iff) and returns0otherwise (Cslib.LinearAlgebra.vecMulSolve_eq_zero), by runningkernelVecAt (vecMulSolveMatrix M b) 0on(b ‖ Mᵀ)so a kernel vector with first coordinate1solvesb + w ᵥ* M = 0.
Related and distinct: Matrix.solveVec in CslibFrontier.Foundations.LinearAlgebra.Matrix.Bareiss
is noncomputable and takes explicit pivot row and column lists as arguments (with its only certified
algorithm, ratSolve, specialized to ℚ). Here no pivot selections are supplied, and every
operation unfolds to a fixed arithmetic expression over the field matching the circuit bounds in
CslibFrontier.Computability.Circuit.LinearSolve.
Main definitions #
Cslib.LinearAlgebra.kernelPivotAt: first member ofkernelBasis Awith nonzero entryj.Cslib.LinearAlgebra.kernelVecAt: kernel vector normalized to1at entryj, or0.Cslib.LinearAlgebra.vecMulSolveMatrix: augmented matrix whose kernel encodesx₀ • b + w ᵥ* M = 0.Cslib.LinearAlgebra.vecMulSolve: straight-line solver forw ᵥ* M = b.
Main results #
Cslib.LinearAlgebra.mulVec_kernelVecAt:kernelVecAt A jlies in the kernel ofA.Cslib.LinearAlgebra.kernelVecAt_apply_self_eq_one_iff: entryjis1iff some kernel vector has nonzero entryj.Cslib.LinearAlgebra.kernelVecAt_eq_zero:kernelVecAt A j = 0when every kernel vector vanishes at entryj.Cslib.LinearAlgebra.vecMul_vecMulSolve:vecMulSolve M b ᵥ* M = bwhenever a solution exists.Cslib.LinearAlgebra.vecMul_vecMulSolve_iff:vecMulSolve M b ᵥ* M = b ↔ ∃ w, w ᵥ* M = b.Cslib.LinearAlgebra.vecMulSolve_eq_zero:vecMulSolve M b = 0when no solution exists.
A kernel vector with a prescribed entry equal to one. The first member of kernelBasis A
whose entry j is nonzero, scaled so that this entry is one; zero if every kernel vector has
entry j equal to zero.
kernelVecAt A j lies in the kernel of A.
Entry j of kernelVecAt A j is one exactly when some kernel vector of A has a nonzero
entry j.
When every kernel vector of A has entry j equal to zero, kernelVecAt A j is zero.
Solving w ᵥ* M = b by elimination. The output is a solution whenever there is one
(vecMul_vecMulSolve) and 0 otherwise (vecMulSolve_eq_zero).
vecMulSolve M b solves w ᵥ* M = b whenever a solution exists.
vecMulSolve M b solves w ᵥ* M = b if and only if a solution exists.
When w ᵥ* M = b has no solution, vecMulSolve M b is zero.