In every inner product space each point has a unique point on each finite-dimensional subspace that is nearest to . The unique point is the orthogonal projection of on . These results are also valid in the more general case where is an affine subspace.
Let be a finite-dimensional affine subspace of an inner product space and a vector of . Then there exists a unique vector in such that is perpendicular to .
This vector is called the orthogonal projection of on , and is denoted by .
The statement that is perpendicular to the subspace means that for all in , where is the direction space of .
The concept of orthogonal projection has been visualized in the picture below. In this particular case, we are looking at a -dimensional linear subspace of represented by the shaded area. The vectors and are as in the definition.
3d picture
Here is the dotted vector, which is perpendicular to .
We first prove the theorem for the case where is a linear subspace of . According to the Gram-Schmidt Theorem each finite-dimensional subspace has an orthonormal basis. Let be such a basis for . Because an orthogonal projection is a vector in , we can write such a projection as a linear combination for some scalars . The requirement that be perpendicular to means that, for each with ,
Using the orthonormality of the basis and the linearity of the inner product we can rewrite the equation in to . As a consequence, the vector is uniquely determined by the requirement that be perpendicular to . In addition, this vector belongs to and lies in . Therefore, there is exactly one orthogonal projection of on . This proves the theorem in the case where is a linear subspace.
Now suppose that is an affine subspace of . Then there are a support vector and a direction space such that . The vector is an orthogonal projection of on for
- belongs to , so the vector belongs to ;
- the vector is equal to and is thus perpendicular to due to the contention for the linear subspace applied to the vector .
It remains to show that is unique. Suppose that is an orthogonal projection of on . Then is the orthogonal projection of on and (by the theorem for a linear subspace ) equal to . The latter vector is equal to , and so . We conclude that , which proves that is the unique orthogonal projection of on .
In many optimization problems calculating the minimum distance of a vector to an affine subspace of plays an important role.
If the affine subspace has infinite dimension, there need not be an orthogonal projection. In order to see this, we let be the inner product space of all polynomials in with the inner product having as an orthonormal basis (so with if and otherwise). Take to be the constant polynomial and to be the linear subspace of consisting of all polynomials having value at . The subspace has basis Thus, if is an orthogonal projection of onto , then there is a polynomial where is a natural number and are real numbers satisfying
Since , the vector is not perpendicular to . In particular, . We can therefore assume that .
We work out the left-hand side of the above equation for where :
Now first consider values of with . Because then and because the above inner product should be equal to , we find . This implies that the equation for can be rewritten to which contradicts the assumption . This shows that there is no vector for which is perpendicular to . We conclude that there is no orthogonal projection of on .
Here are some useful properties of the orthogonal projection on an affine subspace.
Let be an inner product space with affine subspace for a vector and a linear subspace of . Suppose that is an orthonormal basis of for a natural number . The orthogonal projection of a vector of on satisfies the following properties:
- is orthogonal to each vector from .
- The orthogonal projection is given by
- The distance from to a vector from is minimal for the orthogonal projection on :
- The orthogonal projection is the unique vector for which this minimum occurs.
- with equality if and only if .
- The equallity holds if and only if lies in .
The distance between and is defined by as in statement 3.
If is a linear subspace, then we can take and . For a first reading of the statement it is useful to keep this special case in mind. The general case follows simply after subtraction of from the affine subspace and the vector .
1. The first statement is merely a repetition of the definition.
2. The second statement follows from the proof of the previous theorem.
3. For a good intuition of the proof of the third statement, the following figure is useful.
3d picture
Let be a vector in . We compare to . To this end we write . Because and belong to the affine subspace , the difference lies in . This vector is perpendicular to , by definition of the orthogonal projection. We can therefore apply the Pythagorean theorem:
Rewriting this gives
so . Since lengths are non-negative, we conclude that
Equality occurs if and only if , which means that must equal .
4. The last sentence of the proof of the third statement immediately proves the fourth statement.
5. The fifth statement follows, just like the third, from the Pythagorean theorem: We know that belongs to , and that, as a consequence, it is perpendicular to . Therefore we have
from which the statement follows immediately.
6. The implication from left to right in the sixth statement follows from the fact that the projection lies in by definition, and so is a vector in if .
The implication from right to left can be seen by using the fourth statement and observing that the distance between and equals , and the fact that this is the unique vector in for which this holds.
According to statement 3, the distance between a vector and an affine subspace is equal to the minimum distance between and a point in .
In we will calculate the orthogonal projection of the vector on the subspace spanned by the vector . First, we normalize the vector to get an orthonormal basis. Because , this provides the vector
The orthogonal projection is now given by
Therefore, the distance from to the subspace spanned by is equal to the length of the difference vector:
When performing the Gram-Schmidt procedure, we actually make use of the orthogonal projection. In this procedure, vectors are sometimes normalized, but the essential step is
where is an orthonormal basis. The vector is the difference of and the projection of on the linear subspace . That is why this vector lies in the orthogonal complement of .
Let be a finite-dimensional inner product space. An affine subspace of dimension of is called a hyperplane. For such a hyperplane , there exists, up to scaling by a nonzero factor, a unique vector perpendicular to . If is equal to or , then is known as a normal vector of . The coordinates of the vector are the coefficients of the coordinate variables in a linear equation for . The projection of a vector can then be determined by calculating the point of intersection of and the line with parametric representation .
In determine the orthogonal projection of the vector onto the subspace spanned by the vector .
First, we normalize the vector to get an orthonormal basis for . Because we find the normalized basis vector
Now, the orthogonal projection is given by
The distance from to the subspace is equal to the length of the difference vector of and the projection :