# Projection (linear algebra)

(Redirected from Orthogonal projection)

In linear algebra and functional analysis, a projection is a linear transformation $P$ from a vector space to itself such that $P^{2}=P$ . That is, whenever $P$ is applied twice to any value, it gives the same result as if it were applied once (idempotent). It leaves its image unchanged. Though abstract, this definition of "projection" formalizes and generalizes the idea of graphical projection. One can also consider the effect of a projection on a geometrical object by examining the effect of the projection on points in the object.

## Definitions

A projection on a vector space $V$  is a linear operator $P:V\mapsto V$  such that $P^{2}=P$ .

When $V$  has an inner product and is complete (i.e. when $V$  is a Hilbert space) the concept of orthogonality can be used. A projection $P$  on a Hilbert space $V$  is called an orthogonal projection if it satisfies $\langle Px,y\rangle =\langle x,Py\rangle$  for all $x,y\in V$ . A projection on a Hilbert space that is not orthogonal is called an oblique projection.

### Projection matrix

• In the finite-dimensional case, a square matrix $P$  is called a projection matrix if it is equal to its square, i.e. if $P^{2}=P$ .:p. 38
• A square matrix $P$  is called an orthogonal projection matrix if $P^{2}=P=P^{\mathrm {T} }$  for a real matrix, and respectively $P^{2}=P=P^{\mathrm {H} }$  for a complex matrix, where $P^{\mathrm {T} }$  denotes the transpose of $P$  and $P^{\mathrm {H} }$  denotes the Hermitian transpose of $P$ .:p. 223
• A projection matrix that is not an orthogonal projection matrix is called an oblique projection matrix.

The eigenvalues of a projection matrix must be 0 or 1.

## Examples

### Orthogonal projection

For example, the function which maps the point $(x,y,z)$  in three-dimensional space $\mathbb {R} ^{3}$  to the point $(x,y,0)$  is an orthogonal projection onto the xy plane. This function is represented by the matrix

$P={\begin{bmatrix}1&0&0\\0&1&0\\0&0&0\end{bmatrix}}.$

The action of this matrix on an arbitrary vector is

$P{\begin{pmatrix}x\\y\\z\end{pmatrix}}={\begin{pmatrix}x\\y\\0\end{pmatrix}}.$

To see that $P$  is indeed a projection, i.e., $P=P^{2}$ , we compute

$P^{2}{\begin{pmatrix}x\\y\\z\end{pmatrix}}=P{\begin{pmatrix}x\\y\\0\end{pmatrix}}={\begin{pmatrix}x\\y\\0\end{pmatrix}}=P{\begin{pmatrix}x\\y\\z\end{pmatrix}}$ .

Observing that $P^{\mathrm {T} }=P$  shows that the projection is an orthogonal projection.

### Oblique projection

A simple example of a non-orthogonal (oblique) projection (for definition see below) is

$P={\begin{bmatrix}0&0\\\alpha &1\end{bmatrix}}.$

Via matrix multiplication, one sees that

$P^{2}={\begin{bmatrix}0&0\\\alpha &1\end{bmatrix}}{\begin{bmatrix}0&0\\\alpha &1\end{bmatrix}}={\begin{bmatrix}0&0\\\alpha &1\end{bmatrix}}=P.$

proving that $P$  is indeed a projection.

The projection $P$  is orthogonal if and only if $\alpha =0$  because only then $P^{\mathrm {T} }=P$ .

## Properties and classification

The transformation T is the projection along k onto m. The range of T is m and the null space is k.

### Idempotence

By definition, a projection $P$  is idempotent (i.e. $P^{2}=P$ ).

### Complementarity of range and kernel

Let $W$  be a finite dimensional vector space and $P$  be a projection on $W$ . Suppose the subspaces $U$  and $V$  are the range and kernel of $P$  respectively. Then $P$  has the following properties:

1. $P$  is the identity operator $I$  on $U$
$\forall x\in U:Px=x$ .
2. We have a direct sum $W=U\oplus V$ . Every vector $x\in W$  may be decomposed uniquely as $x=u+v$  with $u=Px$  and $v=x-Px=(I-P)x$ , and where $u\in U,v\in V$ .

The range and kernel of a projection are complementary, as are $P$  and $Q=I-P$ . The operator $Q$  is also a projection as the range and kernel of $P$  become the kernel and range of $Q$  and vice versa. We say $P$  is a projection along $V$  onto $U$  (kernel/range) and $Q$  is a projection along $U$  onto $V$ .

### Spectrum

In infinite dimensional vector spaces, the spectrum of a projection is contained in $\{0,1\}$  as

$(\lambda I-P)^{-1}={\frac {1}{\lambda }}I+{\frac {1}{\lambda (\lambda -1)}}P$ .

Only 0 or 1 can be an eigenvalue of a projection, implying that $P$  is always a positive semi-definite matrix. The corresponding eigenspaces are (respectively) the kernel and range of the projection. Decomposition of a vector space into direct sums is not unique in general. Therefore, given a subspace $V$ , there may be many projections whose range (or kernel) is $V$ .

If a projection is nontrivial it has minimal polynomial $x^{2}-x=x(x-1)$ , which factors into distinct roots, and thus $P$  is diagonalizable.

### Product of projections

The product of projections is not, in general, a projection, even if they are orthogonal. If projections commute, then their product is a projection.

### Orthogonal projections

When the vector space $W$  has an inner product and is complete (is a Hilbert space) the concept of orthogonality can be used. An orthogonal projection is a projection for which the range $U$  and the null space $V$  are orthogonal subspaces. Thus, for every $x$  and $y$  in $W$ , $\langle Px,(y-Py)\rangle =\langle (x-Px),Py\rangle =0$ . Equivalently:

$\langle x,Py\rangle =\langle Px,Py\rangle =\langle Px,y\rangle$ .

A projection is orthogonal if and only if it is self-adjoint. Using the self-adjoint and idempotent properties of $P$ , for any $x$  and $y$  in $W$  we have $Px\in U$ , $y-Py\in V$ , and

$\langle Px,y-Py\rangle =\langle P^{2}x,y-Py\rangle =\langle Px,P(I-P)y\rangle =\langle Px,(P-P^{2})y\rangle =0\,$

where $\langle \cdot ,\cdot \rangle$  is the inner product associated with $W$ . Therefore, $Px$  and $y-Py$  are orthogonal projections. The other direction, namely that if $P$  is orthogonal then it is self-adjoint, follows from

$\langle x,Py\rangle =\langle Px,y\rangle =\langle x,P^{*}y\rangle$

for every $x$  and $y$  in $W$ ; thus $P=P^{*}$ .

#### Properties and special cases

An orthogonal projection is a bounded operator. This is because for every $v$  in the vector space we have, by Cauchy–Schwarz inequality:

$\|Pv\|^{2}=\langle Pv,Pv\rangle =\langle Pv,v\rangle \leq \|Pv\|\cdot \|v\|$

Thus $\|Pv\|\leq \|v\|$ .

For finite dimensional complex or real vector spaces, the standard inner product can be substituted for $\langle \cdot ,\cdot \rangle$ .

##### Formulas

A simple case occurs when the orthogonal projection is onto a line. If $u$  is a unit vector on the line, then the projection is given by the outer product

$P_{u}=uu^{\mathrm {T} }.$

(If $u$  is complex-valued, the transpose in the above equation is replaced by a Hermitian transpose). This operator leaves u invariant, and it annihilates all vectors orthogonal to $u$ , proving that it is indeed the orthogonal projection onto the line containing u. A simple way to see this is to consider an arbitrary vector $x$  as the sum of a component on the line (i.e. the projected vector we seek) and another perpendicular to it, $x=x_{\parallel }+x_{\perp }$ . Applying projection, we get

$P_{u}x=uu^{\mathrm {T} }x_{\parallel }+uu^{\mathrm {T} }x_{\perp }=u\left(\mathrm {sign} (u^{\mathrm {T} }x_{\parallel })\|x_{\parallel }\|\right)+u\cdot 0=x_{\parallel }$

by the properties of the dot product of parallel and perpendicular vectors.

This formula can be generalized to orthogonal projections on a subspace of arbitrary dimension. Let $u_{1},\ldots ,u_{k}$  be an orthonormal basis of the subspace $U$ , and let $A$  denote the $n\times k$  matrix whose columns are $u_{1},\ldots ,u_{k}$ , i.e $A={\begin{bmatrix}u_{1}&\ldots &u_{k}\end{bmatrix}}$ . Then the projection is given by:

$P_{A}=AA^{\mathrm {T} }$

which can be rewritten as

$P_{A}=\sum _{i}\langle u_{i},\cdot \rangle u_{i}.$

The matrix $A^{\mathrm {T} }$  is the partial isometry that vanishes on the orthogonal complement of $U$  and $A$  is the isometry that embeds $U$  into the underlying vector space. The range of $P_{A}$  is therefore the final space of $A$ . It is also clear that $AA^{\mathrm {T} }$  is the identity operator on $U$ .

The orthonormality condition can also be dropped. If $u_{1},\ldots ,u_{k}$  is a (not necessarily orthonormal) basis, and $A$  is the matrix with these vectors as columns, then the projection is:

$P_{A}=A(A^{\mathrm {T} }A)^{-1}A^{\mathrm {T} }.$

The matrix $A$  still embeds $U$  into the underlying vector space but is no longer an isometry in general. The matrix $(A^{\mathrm {T} }A)^{-1}$  is a "normalizing factor" that recovers the norm. For example, the rank-1 operator $uu^{\mathrm {T} }$  is not a projection if $\|u\|\neq 1.$  After dividing by $u^{\mathrm {T} }u=\|u\|^{2},$  we obtain the projection $u(u^{\mathrm {T} }u)^{-1}u^{\mathrm {T} }$  onto the subspace spanned by $u$ .

In the general case, we can have an arbitrary positive definite matrix $D$  defining an inner product $\langle x,y\rangle _{D}=y^{\dagger }Dx$ , and the projection $P_{A}$  is given by $P_{A}x=\mathrm {argmin} _{y\in \mathrm {range} (A)}\|x-y\|_{D}^{2}$ . Then

$P_{A}=A(A^{\mathrm {T} }DA)^{-1}A^{\mathrm {T} }D.$

When the range space of the projection is generated by a frame (i.e. the number of generators is greater than its dimension), the formula for the projection takes the form: $P_{A}=AA^{+}$ . Here $A^{+}$  stands for the Moore–Penrose pseudoinverse. This is just one of many ways to construct the projection operator.

If ${\begin{bmatrix}A&B\end{bmatrix}}$  is a non-singular matrix and $A^{\mathrm {T} }B=0$  (i.e., $B$  is the null space matrix of $A$ ), the following holds:

{\begin{aligned}I&={\begin{bmatrix}A&B\end{bmatrix}}{\begin{bmatrix}A&B\end{bmatrix}}^{-1}{\begin{bmatrix}A^{\mathrm {T} }\\B^{\mathrm {T} }\end{bmatrix}}^{-1}{\begin{bmatrix}A^{\mathrm {T} }\\B^{\mathrm {T} }\end{bmatrix}}\\&={\begin{bmatrix}A&B\end{bmatrix}}\left({\begin{bmatrix}A^{\mathrm {T} }\\B^{\mathrm {T} }\end{bmatrix}}{\begin{bmatrix}A&B\end{bmatrix}}\right)^{-1}{\begin{bmatrix}A^{\mathrm {T} }\\B^{\mathrm {T} }\end{bmatrix}}\\&={\begin{bmatrix}A&B\end{bmatrix}}{\begin{bmatrix}A^{\mathrm {T} }A&O\\O&B^{\mathrm {T} }B\end{bmatrix}}^{-1}{\begin{bmatrix}A^{\mathrm {T} }\\B^{\mathrm {T} }\end{bmatrix}}\\[4pt]&=A(A^{\mathrm {T} }A)^{-1}A^{\mathrm {T} }+B(B^{\mathrm {T} }B)^{-1}B^{\mathrm {T} }\end{aligned}}

If the orthogonal condition is enhanced to $A^{\mathrm {T} }WB=A^{\mathrm {T} }W^{\mathrm {T} }B=0$  with $W$  non-singular, the following holds:

$I={\begin{bmatrix}A&B\end{bmatrix}}{\begin{bmatrix}(A^{\mathrm {T} }WA)^{-1}A^{\mathrm {T} }\\(B^{\mathrm {T} }WB)^{-1}B^{\mathrm {T} }\end{bmatrix}}W.$

All these formulas also hold for complex inner product spaces, provided that the conjugate transpose is used instead of the transpose. Further details on sums of projectors can be found in Banerjee and Roy (2014). Also see Banerjee (2004) for application of sums of projectors in basic spherical trigonometry.

### Oblique projections

The term oblique projections is sometimes used to refer to non-orthogonal projections. These projections are also used to represent spatial figures in two-dimensional drawings (see oblique projection), though not as frequently as orthogonal projections. Whereas calculating the fitted value of an ordinary least squares regression requires an orthogonal projection, calculating the fitted value of an instrumental variables regression requires an oblique projection.

Projections are defined by their null space and the basis vectors used to characterize their range (which is the complement of the null space). When these basis vectors are orthogonal to the null space, then the projection is an orthogonal projection. When these basis vectors are not orthogonal to the null space, the projection is an oblique projection. Let the vectors $u_{1},\ldots ,u_{k}$  form a basis for the range of the projection, and assemble these vectors in the $n\times k$  matrix $A$ . The range and the null space are complementary spaces, so the null space has dimension $n-k$ . It follows that the orthogonal complement of the null space has dimension $k$ . Let $v_{1},\ldots ,v_{k}$  form a basis for the orthogonal complement of the null space of the projection, and assemble these vectors in the matrix $B$ . Then the projection is defined by

$P=A(B^{\mathrm {T} }A)^{-1}B^{\mathrm {T} }.$

This expression generalizes the formula for orthogonal projections given above.

### Finding projection with an inner product

Let $V$  be a vector space (in this case a plane) spanned by orthogonal vectors $u_{1},u_{2},\cdots ,u_{p}$ . Let $y$  be a vector. One can define a projection of $y$  onto $V$  as

$\operatorname {proj} _{V}y={\frac {y\cdot u^{i}}{u^{j}\cdot u^{j}}}u^{i}$

where the $i$  's and $j$  's imply Einstein sum notation. The vector $y$  can be written as an orthogonal sum such that $y=\operatorname {proj} _{V}y+z$ . $\operatorname {proj} _{V}y$  is sometimes denoted as ${\hat {y}}$ . There is a theorem in Linear Algebra that states that this $z$  is the shortest distance from $y$  to $V$  and is commonly used in areas such as machine learning.

## Canonical forms

Any projection $P=P^{2}$  on a vector space of dimension $d$  over a field is a diagonalizable matrix, since its minimal polynomial divides $x^{2}-x$ , which splits into distinct linear factors. Thus there exists a basis in which $P$  has the form

$P=I_{r}\oplus 0_{d-r}$

where $r$  is the rank of $P$ . Here $I_{r}$  is the identity matrix of size $r$ , and $0_{d-r}$  is the zero matrix of size $d-r$ . If the vector space is complex and equipped with an inner product, then there is an orthonormal basis in which the matrix of P is

$P={\begin{bmatrix}1&\sigma _{1}\\0&0\end{bmatrix}}\oplus \cdots \oplus {\begin{bmatrix}1&\sigma _{k}\\0&0\end{bmatrix}}\oplus I_{m}\oplus 0_{s}$  .

where $\sigma _{1}\geq \sigma _{2}\geq \ldots \geq \sigma _{k}>0$ . The integers $k,s,m$  and the real numbers $\sigma _{i}$  are uniquely determined. Note that $k+s+m=d$ . The factor $I_{m}\oplus 0_{s}$  corresponds to the maximal invariant subspace on which $P$  acts as an orthogonal projection (so that P itself is orthogonal if and only if $k=0$ ) and the $\sigma _{i}$ -blocks correspond to the oblique components.

## Projections on normed vector spaces

When the underlying vector space $X$  is a (not necessarily finite-dimensional) normed vector space, analytic questions, irrelevant in the finite-dimensional case, need to be considered. Assume now $X$  is a Banach space.

Many of the algebraic notions discussed above survive the passage to this context. A given direct sum decomposition of $X$  into complementary subspaces still specifies a projection, and vice versa. If $X$  is the direct sum $X=U\oplus V$ , then the operator defined by $P(u+v)=u$  is still a projection with range $U$  and kernel $V$ . It is also clear that $P^{2}=P$ . Conversely, if $P$  is projection on $X$ , i.e. $P^{2}=P$ , then it is easily verified that $(1-P)^{2}=(1-P)$ . In other words, $1-P$  is also a projection. The relation $P^{2}=P$  implies $1=P+(1-P)$  and $X$  is the direct sum $\mathrm {ran} (P)\oplus \mathrm {ran} (1-P)$ .

However, in contrast to the finite-dimensional case, projections need not be continuous in general. If a subspace $U$  of $X$  is not closed in the norm topology, then projection onto $U$  is not continuous. In other words, the range of a continuous projection $P$  must be a closed subspace. Furthermore, the kernel of a continuous projection (in fact, a continuous linear operator in general) is closed. Thus a continuous projection $P$  gives a decomposition of $X$  into two complementary closed subspaces: $X=\mathrm {ran} (P)\oplus \mathrm {ker} (P)=\mathrm {ker} (1-P)\oplus \mathrm {ker} (P)$ .

The converse holds also, with an additional assumption. Suppose $U$  is a closed subspace of $X$ . If there exists a closed subspace $V$  such that X = UV, then the projection $P$  with range $U$  and kernel $V$  is continuous. This follows from the closed graph theorem. Suppose xnx and Pxny. One needs to show that $Px=Y$ . Since $U$  is closed and {Pxn} ⊂ U, y lies in $U$ , i.e. Py = y. Also, xnPxn = (IP)xnxy. Because $V$  is closed and {(IP)xn} ⊂ V, we have $x-y\in V$ , i.e. $P(x-y)=Px-Py=Px-y=0$ , which proves the claim.

The above argument makes use of the assumption that both $U$  and $V$  are closed. In general, given a closed subspace $U$ , there need not exist a complementary closed subspace $V$ , although for Hilbert spaces this can always be done by taking the orthogonal complement. For Banach spaces, a one-dimensional subspace always has a closed complementary subspace. This is an immediate consequence of Hahn–Banach theorem. Let $U$  be the linear span of $u$ . By Hahn–Banach, there exists a bounded linear functional $\varphi$  such that φ(u) = 1. The operator $P(x)=\varphi (x)u$  satisfies $P^{2}=P$ , i.e. it is a projection. Boundedness of $\varphi$  implies continuity of $P$  and therefore $\operatorname {ker} (P)=\operatorname {ran} (I-P)$  is a closed complementary subspace of $U$ .

## Applications and further considerations

Projections (orthogonal and otherwise) play a major role in algorithms for certain linear algebra problems:

As stated above, projections are a special case of idempotents. Analytically, orthogonal projections are non-commutative generalizations of characteristic functions. Idempotents are used in classifying, for instance, semisimple algebras, while measure theory begins with considering characteristic functions of measurable sets. Therefore, as one can imagine, projections are very often encountered in the context operator algebras. In particular, a von Neumann algebra is generated by its complete lattice of projections.

## Generalizations

More generally, given a map between normed vector spaces $T\colon V\to W,$  one can analogously ask for this map to be an isometry on the orthogonal complement of the kernel: that $(\ker T)^{\perp }\to W$  be an isometry (compare Partial isometry); in particular it must be onto. The case of an orthogonal projection is when W is a subspace of V. In Riemannian geometry, this is used in the definition of a Riemannian submersion.