Gaussian elimination: multi-row forward sweep (refinement) #
GaussPivotStep.lean treats a single forward-elimination pivot step and
proves it preserves the solution set of A · x = b. This file iterates that
step across a list of target rows — the forward sweep that
eliminates one fixed pivot column from each of a batch of rows — and proves the
whole sweep preserves the solution set, by induction over the row list using the
single-step lemma.
A sweep is parameterized by a fixed pivot row p and a list targets of
(row, coefficient) pairs: it folds the single pivot step pivotStepMat … r c
across the list, in order. The matrix transform is gaussSweepMat and the
target-vector transform is gaussSweepRhs. As long as every target row in the
list is distinct from the pivot row p (hp : ∀ rc ∈ targets, p ≠ rc.1), the
single-step invariance composes:
gaussSweep_preserves_solution :
(gaussSweepMat A p targets).mulVec x = gaussSweepRhs b p targets ↔
A.mulVec x = b
This is the forward-elimination-preserves-solutions result. The remaining Gaussian-elimination tail — pivot selection (search for a nonzero pivot, row swaps), back-substitution, and the termination argument — is the suite's frontier.
API #
gaussSweepMat— coefficient matrix after sweeping the pivot step acrosstargets.gaussSweepRhs— target vector after the same sweep.gaussSweep_preserves_solution—xsolves the swept system iff it solves the original one (solution-set invariance of the whole forward sweep).
The coefficient matrix after a forward sweep: fold the single pivot step
(against the fixed pivot row p) across the list targets of
(target row, coefficient) pairs, in order.
Equations
- One or more equations did not get rendered due to their size.
- Transfer.Examples.CoqEAL.GaussSweep.gaussSweepMat A p [] = A
Instances For
The target vector after the same forward sweep.
Equations
- One or more equations did not get rendered due to their size.
- Transfer.Examples.CoqEAL.GaussSweep.gaussSweepRhs b p [] = b
Instances For
The forward sweep preserves the solution set. A vector x satisfies the
swept system gaussSweepMat A p targets · x = gaussSweepRhs b p targets iff
it satisfies the original system A · x = b, provided every target row in
the sweep is distinct from the pivot row p. Proof: induction over the row
list, peeling one pivot step at a time via
pivotStep_preserves_solution.