Algorithm Search⌘K

Proofs: Structured Gaussian elimination

These are the human proofs of Structured Gaussian elimination, at full length.

Correctness of structured Gaussian elimination full

This proof shows: correctness, termination.

We prove that STRUCTURED-GE returns a solution of Ax=cA x = c when one exists and reports "inconsistent" otherwise, and that it terminates. Notation is as on the main page: during the loop each column is in exactly one of LL (light), HH (heavy), EE (eliminated by a pivot) or FF (free, removed on line L3), and each row is active or set aside as a pivot row. We write rows together with their right-hand sides, so a row operation also acts on cc.

Termination. Each pass of the loop removes one column from LL, on line L3, L4, L5 or L6, and moves it to FF, EE, EE or HH. So the loop runs at most nn times, and every pass, the dense solve and the back-substitution are finite.

Invariant. At the start of each pass of the loop:

  1. (Equivalence) The system SS made of the active rows and the pivot rows set aside has the same solutions as Ax=cA x = c.
  2. (Cleared columns) No active row has a nonzero entry in a column of E∪FE \cup F.
  3. (Shape of pivot rows) Each pivot (r,j)(r, j) in PP has arj≠0a_{rj} \ne 0 in the stored row rr, and every other column kk with ark≠0a_{rk} \ne 0 in that stored row is in HH or FF, or is in EE through a pivot appended to PP after (r,j)(r, j), or is still in LL.

Initialization. At the start, SS is Ax=cA x = c, E=F=∅E = F = \emptyset and PP is empty.

Maintenance. Consider one pass.

  • Line L3: column jj has weight 00, so no active row meets it, and part 2 holds with j∈Fj \in F. Part 3 still holds, since FF is allowed in pivot rows. Nothing else changes.
  • Line L4: column jj has weight 11, with its only active entry in row rr. Setting row rr aside changes neither SS nor any active row, so part 1 holds. No active row meets jj any more, so part 2 holds. For part 3, the new pivot (r,j)(r, j) has arj≠0a_{rj} \ne 0; the other entries of row rr are not in E∪FE \cup F by part 2 (row rr was active), so they are in HH or in LL. Older pivots are unaffected, except that a column of LL appearing in an older pivot row has now moved to EE through a pivot appended after it, which is allowed.
  • Line L5: row rr has exactly one entry in LL, in column jj, and by part 2 none in E∪FE \cup F, so its nonzero entries are arja_{rj} and entries in HH. Each active row ii with aij≠0a_{ij} \ne 0 is replaced by row ii minus (aij/arj)(a_{ij} / a_{rj}) times row rr. This is an invertible operation on SS, since row rr stays in SS as a pivot row, so part 1 holds. The new row ii has a zero in column jj, and its other entries change only in columns of HH, so it still has no entry in E∪FE \cup F: part 2 holds with j∈Ej \in E. Part 3 holds for (r,j)(r, j) because its other entries are in HH, and for older pivots as in the case of line L4.
  • Line L6: a column moves from LL to HH. Parts 1 and 2 are unchanged, and part 3 still holds because HH only grows.

After the loop. L=∅L = \emptyset, so by part 2 every active row has its nonzero entries in HH only. By part 3, each stored pivot row (r,j)(r, j) has its other nonzero entries in HH, in FF, or in columns pivoted after (r,j)(r, j).

Inconsistent systems. If line L7 finds the active rows, restricted to HH, inconsistent, then no assignment of the heavy unknowns satisfies them. Since these rows involve no other unknowns, no xx satisfies them, so SS has no solution, and by part 1 neither has Ax=cA x = c. The report is correct.

Consistent case. Otherwise line L7 gives values xkx_k for k∈Hk \in H satisfying all active rows. Free unknowns keep the value 00 and appear in no active row. Line L8 processes the pivots from the last to the first. When (r,j)(r, j) is processed, every unknown k≠jk \ne j with ark≠0a_{rk} \ne 0 in row rr is in HH or FF, whose values are fixed, or was pivoted after (r,j)(r, j) and has therefore already received its value; its value does not change later, because each unknown is the column of exactly one pivot. Since arj≠0a_{rj} \ne 0, setting xj=(cr−∑k≠jarkxk)/arjx_j = (c_r - \sum_{k \ne j} a_{rk} x_k) / a_{rj} makes row rr hold, and it stays true because none of its unknowns changes afterwards. Unknowns in HH and FF are never assigned on line L8, because the columns of pivots are in EE. So at the end every active row and every pivot row holds: xx solves SS, and by part 1 it solves Ax=cA x = c. ■\blacksquare

Back to Structured Gaussian elimination