The linear least-squares problem is to choose minimizing the Euclidean norm of the residual:
For a QR decomposition , orthogonality of gives . If has full column rank and is in standard form with invertible upper-triangular , the minimizer solves .
Applying the Gram-Schmidt process to the columns of the given matrix yields
Indeed, is an orthogonal matrix and . Moreover,
Back substitution in the leading triangular system gives
so the unique least-squares solution is
The unused final transformed residual component is , so the minimum residual norm is .
For , define by . If , then in particular
so . Thus is injective. Since a finite-dimensional vector space and its dual space have the same dimension, is also surjective and hence an isomorphism. This is the finite-dimensional real case of the Riesz representation theorem.
The adjoint operator of is the unique linear map satisfying
for every and . In the stated orthonormal bases, if and denote coordinate columns, then
Therefore the matrix of is the matrix transpose .
For ,
Hence . Taking orthogonal complements in the finite-dimensional space proves the image-kernel orthogonality for an adjoint
Put . For any ,
This is minimized at exactly when , equivalently when . Thus the normal equation for a linear inverse problem is
For the given linear least-squares problem,
The normal equations and have the unique solution