Orthogonal projection is an operation in linear algebra that separates a vector into a component belonging to a specified linear subspace and a component perpendicular to it. The first component is the projection; it is also the closest vector in that subspace, with distance measured by the norm induced by an inner product. The construction applies to finite-dimensional inner-product spaces and, more generally, to closed subspaces of a Hilbert space. (terrytao.wordpress.com)
Definition and geometric meaning
Let be a finite-dimensional inner-product vector space, and let be a subspace. The orthogonal projection of onto , written , is the unique vector satisfying
Thus,
The residual belongs to the orthogonal complement , the set of vectors perpendicular to every vector in . Projection preserves vectors already in and sends vectors in to zero. (ocw.mit.edu)
In Euclidean geometry, projection onto a line or plane is the foot of the perpendicular drawn from the original point. Its nearest-point property follows from the Pythagorean theorem: for any ,
The second term is nonnegative and vanishes only when , establishing both optimality and uniqueness. (terrytao.wordpress.com)
Explicit formulas
For a nonzero real vector , projection onto its linear span is
For example, projecting onto the line spanned by gives . The residual has zero inner product with . Rescaling by any nonzero real number leaves the projection unchanged because the target line is unchanged. (ocw.mit.edu)
If form an orthonormal basis of , then
using the convention that the inner product is linear in its first argument. Writing these basis vectors as columns of a matrix gives
Here denotes conjugate transpose; for real matrices it is the ordinary transpose. Projection therefore consists of finding coordinates along orthonormal directions and reconstructing the corresponding vector in . (ocw.mit.edu)
Operator and matrix properties
An orthogonal projector, regarded as a linear map from the ambient space to itself, satisfies
The first identity expresses idempotence: projecting twice has the same effect as projecting once. The second expresses self-adjointness. Together, these properties characterize orthogonal projectors among bounded operators on a Hilbert space. Their image is the target subspace, and their kernel is its orthogonal complement. (mathweb.ucsd.edu)
Consequently, in finite dimensions the only possible eigenvalues are and : vectors in the target subspace have eigenvalue , while vectors in its orthogonal complement have eigenvalue . The rank equals the target subspace’s dimension. Also, , with the identity matrix, projects onto the orthogonal complement. These statements follow directly from the decomposition into the two subspaces. (mathweb.ucsd.edu)
Projection does not increase length:
It should not be confused with an orthogonal matrix, which preserves lengths and is invertible. Projection onto a proper subspace discards information. An idempotent operator lacking self-adjointness may instead be an oblique projection, whose discarded component need not be perpendicular to its image. (terrytao.wordpress.com)
Least squares and computation
Suppose the columns of a real matrix are linearly independent and span . Then
The matrix is a Gram matrix. To project a vector , solve the normal equations
and set . These equations express the condition that is perpendicular to every column of . (ocw.mit.edu)
This is the geometry underlying ordinary least squares and linear regression: the fitted response vector is the projection of the observed response onto the design matrix’s column space. If the columns are dependent, the fitted vector remains unique even when the coefficient vector is not. For any finite matrix,
where is the Moore–Penrose pseudoinverse. (ocw.mit.edu)
In numerical linear algebra, a QR decomposition supplies orthonormal columns , allowing projection as without explicitly constructing the full projector. QR methods also avoid the increased numerical sensitivity associated with forming , whose condition number is squared relative to when has full column rank. (ocw.mit.edu)
Infinite-dimensional extension and related projections
The Hilbert-space projection theorem states that every vector has a unique orthogonal decomposition relative to a closed subspace . Closedness matters: if is not closed, a vector in its closure but outside has distance zero from , yet no nearest point in . Projection onto the closure still exists. (terrytao.wordpress.com)
A broader nearest-point theorem applies to every nonempty closed convex set in a Hilbert space. Such a projection is unique and nonexpansive, but generally is not linear. Projection onto an affine subspace , for example, is
which is an affine rather than necessarily linear map. This distinguishes nearest-point projection onto general sets from orthogonal projection onto linear subspaces. (math.ucla.edu)