Every point in the affine search space is uniquely , since the columns of form a basis. Its linear-system residual is , so minimizing the residual is exactly the linear least-squares problem .
Use the standard starting choice and an orthonormal extended basis . If , then and orthonormality givesThe starting-vector choice is needed for this particular representation; an arbitrary orthonormal basis need not have those initial coordinates.
The Arnoldi iteration constructs the basis. At column , orthogonalize against , recording coefficients ; normalize the remaining vector with to get . This makes an upper Hessenberg matrix of size . The resulting GMRES algorithm starts from , grows this Arnoldi basis, solves the small least-squares problem, and sets . Its small residual norm provides the stopping test. Incremental Givens rotations efficiently update the small QR decomposition instead of solving it anew. Zero initial residual means the system is already solved; Arnoldi breakdown gives an invariant subspace and, for nonsingular , permits exact solution within it.
The elementary elimination step replaces row by row minus a multiple of an earlier pivot row . With coordinate vectors , its premultiplication matrix isand its inverse is , since . Choose as the current entry below the pivot divided by the current pivot. Required pivots are assumed nonzero, consistently with elimination without row interchanges.
For dimension 4, first eliminate positions , then , then . ThusThe rightmost operation acts first, and every multiplier is computed from the matrix at its own stage. For general , the numbers of eliminations in successive columns are , totaling ; a zero multiplier simply gives an identity operation.
The product is unit lower triangular and is upper triangular. Its inverse is unit lower triangular, soThe stored multiplier in position is the corresponding subdiagonal entry of , as follows by reversing the pivot-row subtractions column by column.
If is upper Hessenberg, only the first subdiagonal can be nonzero below the diagonal. At stage only position needs elimination. Subtracting row cannot create lower entries further down because its entries before its pivot are already zero. Hence only operations are needed. The inverse factors occur in increasing column order, and their cross products vanish, givingwhich is lower bidiagonal; is upper triangular, possibly dense above its diagonal.
If the Hessenberg matrix is also symmetric, it is tridiagonal. At each elimination step the pivot row has no entries past its immediate superdiagonal, so the updated matrix retains that upper bandwidth. Thus is lower bidiagonal and is upper bidiagonal, with at most two nonzero entries in each row, as required.