The size-reduce row operation leaves every leading Gram determinant
unchanged: sizeReduce b j k r adds -r times the earlier row j to the
later row k (j < k), a unimodular operation. Specialises
gramDet_rowAdd_earlier.
Size-reduce update at the pivot column j: the scaled coefficient at
(k, j) decreases by r * gramDet b (j+1), reflecting that subtracting
r times row j cancels exactly that multiple of the j-leading Gram
determinant from the (k, j) Cramer numerator.
Size-reduce update at a column l below the pivot (l < j < k): the
scaled coefficient at (k, l) decreases by r times the (j, l)
coefficient, since row k inherits -r times row j's contribution in
that column.
Size-reduce leaves the scaled coefficient at (k, l) unchanged for any
column l strictly between the pivot j and k (j < l < k): row j's
contribution there is already orthogonalised away, so adding a multiple of
it has no effect.
Swapping the adjacent rows k-1 and k leaves the t-leading Gram
determinant unchanged for every t ≠ k. For t > k both swapped rows lie
inside the leading block, so the Gram matrix is conjugated by a row-and-column
swap (determinant invariant); for t < k neither row is involved. Only the
t = k prefix, which separates the two swapped rows, can change.
Adjacent-swap update for a column j strictly below the swapped block
(j + 1 < k): the new scaled coefficient at row k-1 equals the old one at
row k, because the swap moves the original row k into position k-1
while leaving the j-leading Gram determinant fixed.
Adjacent-swap companion to scaledCoeffs_adjacentSwap_lower_prev: for a
column j strictly below the swapped block (j + 1 < k), the new scaled
coefficient at row k equals the old one at row k-1, since the swap moves
the original row k-1 into position k.
The pivot scaled coefficient (k, k-1) is invariant under the adjacent
swap of rows k-1 and k: the swap transposes the Cramer minor
scaledCoeffMatrix, and a transpose preserves its determinant.
The adjacent swap of rows k-1, k leaves the scaled coefficient at
(i, j) unchanged whenever the whole entry lies strictly below the swapped
block (i + 1 < k, so both row i and its columns j < i are untouched).
For a row i above the swapped block (i > k) and a column j strictly
below it (j + 1 < k), the adjacent swap of rows k-1, k leaves the scaled
coefficient at (i, j) unchanged: the j-leading Gram determinant and the
relevant Cramer numerator are both unaffected.
For a row i and column j both strictly above the swapped block
(k < j < i), the adjacent swap of rows k-1, k leaves the scaled
coefficient at (i, j) unchanged.
The single k-leading Gram determinant that the adjacent swap of rows
k-1, k can change, expressed as an exact integer quotient: writing
B = scaledCoeffs b k (k-1), the new value is
(d_{k+1} · d_{k-1} + B²) / d_k, where d_t = gramDet b t. Exactness of the
division is supplied by adjacentSwap_gramDetNumerator_dvd; the hypothesis
d_k ≠ 0 makes the quotient well-defined.
Exactness witness for gramDet_adjacentSwap_pivot: the pre-swap pivot
adjacentSwapDenom b k = d_k divides the numerator
adjacentSwapGramDetNumerator b k = d_{k+1} · d_{k-1} + B², because that
numerator equals d_k times the post-swap k-leading Gram determinant.
Bordered-minor identity for the swapped prev (km1) column at a row
i > k: the executable Bareiss determinant of the Cramer minor times the
pre-swap pivot d_k equals the integer numerator
adjacentSwapScaledCoeffAbovePrevNumerator. Feeds the exact division in
scaledCoeffs_adjacentSwap_above_prev.
Bordered-minor identity for the swapped curr (k) column at a row
i > k: the executable Bareiss determinant of the Cramer minor times the
pre-swap pivot d_k equals the integer numerator
adjacentSwapScaledCoeffAboveCurrNumerator. Feeds the exact division in
scaledCoeffs_adjacentSwap_above_curr.
Exactness witness for scaledCoeffs_adjacentSwap_above_prev: the pre-swap
pivot adjacentSwapDenom b k = d_k divides
adjacentSwapScaledCoeffAbovePrevNumerator, immediate from the bordered-minor
identity bareiss_scaledCoeffMatrix_rowSwap_above_prev.
Exactness witness for scaledCoeffs_adjacentSwap_above_curr: the pre-swap
pivot adjacentSwapDenom b k = d_k divides
adjacentSwapScaledCoeffAboveCurrNumerator, immediate from the bordered-minor
identity bareiss_scaledCoeffMatrix_rowSwap_above_curr.
Adjacent-swap quotient formula at the prev (km1) column for a row
i > k: the new scaled coefficient equals
adjacentSwapScaledCoeffAbovePrevNumerator / adjacentSwapDenom, an exact
integer division by the divisibility witness
adjacentSwap_scaledCoeffAbovePrevNumerator_dvd.
Adjacent-swap quotient formula at the curr (k) column for a row
i > k: the new scaled coefficient equals
adjacentSwapScaledCoeffAboveCurrNumerator / adjacentSwapDenom, an exact
integer division by the divisibility witness
adjacentSwap_scaledCoeffAboveCurrNumerator_dvd.