5.1 Orthogonality

5.1.1 Orthogonal Subspaces

Two vectors are called orthogonal if . Two subspaces and are orthogonal if for all and , the vectors and are orthogonal.

5.1.2 Subspaces Orthogonal if Basis is Orthogonal

Let be a basis of subspace . Let be a basis of subspace . and are orthogonal if and only if and are orthogonal for all and .

We can determine if two subspaces are orthogonal by only comparing their basis vectors, as if they are orthogonal, all their linear combinations will also be.

As all vectors are pairwise linearly independent, their union is also linearly independent. Therefore the union of two bases is still a basis of the sum of their subspaces:

5.1.3 Basis of Subspace together form basis of .

Let and be orthogonal subspaces of . Let be a basis of subspace . Let be a basis of subspace . The set of vectors are linearly independent.

We can use this Lemma to get the basis of the subspace , which is then indeed also a subspace of . This sum of orthogonal vectors is called the Minkovsky-Sum!

5.1.4 Properties of orthogonal subspaces

Let and be orthogonal subspaces. Then (as all subspaces contain the vector).

If and , then .

Note that them being orthogonal does not yet mean they are orthogonal complements. Thus their dimension is not .

5.1.5 Orthogonal Complement

Let be a subspace of . We define the orthogonal complement of as

This is also a subspace of . Therefore, the concept of orthogonal subspaces allows us to decompose the space into a subspace and it’s complement (these being the nullspace of and the row space of ).

5.1.6 Decomposition of

Let be a matrix.

As we know that if then . Thus they add up to the whole space!

5.1.7 Orthogonal subspace properties

Let be orthogonal subspaces of . Then the following statements are equivalent.

  • Every can be written as with unique vectors ,

In words, this means that we can combine two orthogonal subspaces and create a new subspace, whose dimension is the sum of the two dimensions.

Example We can write: (this is a Minkovsky sum). We can also write , it’s symmetric.

5.1.8 Orthogonality cancels out

Let be a subspace of . Then

This allows us to rewrite Theorem 5.1.6:

5.1.9 Four fundamental Subspaces

Let .

Subspace Orthogonality

We have: and

We can visualise the four fundamental subspaces in the following way:

Consequences: Recall that the complete solution to (“all ‘s st “) where is a particular solution (assuming the system is feasible).

You can show that is also equal to , where and and where is unique (i.e. such a particular solution always exists and is unique) (See Sabatino Notes Week 9 for Proof.)

5.1.10 and

Let . Then and .

Why is this needed?

  • : if i.e. lin. indep. columns then invertible as and square.
  • : needed so is in the same subspace as .

This one is important! Learn the proof! holds because:

  • if then .
  • if then , which means holds because:
  • if then let and if we set then thus .
  • as (). Then (by ) and thus .

5.2 Projections

If a system has no solutions (because is not invertible, i.e. ) can we find a such that the error is minimal - basically the next best solution?

This usually happens when we have more equations than variables (i.e. each is being “overdetermined”) (alternative phrasing: there aren’t enough vectors to span the space, thus is a line or a plane in 3d for example).

5.2.1 Projection of a vector onto a subspace

The projection of a vector onto a subspace (of ) is the point in that is closest to . In other words

Where , with the error.

The one-dimensional case

We can clearly see that the error vector in 2d is orthogonal to the projection by geometric intuition.

5.2.2 Projection in 2d formula

Let . The projection of on is given by This minimiser is unique.

And indeed if we substitute we find that the error vector is indeed orthogonal to .

Intuition: (In the lecture we don’t assume orthogonality of the error vector).

  • Assume (define error vector ).
  • We can write since we know the projection vector is on the line spanned by and hence is a scalar multiple of . \begin{align} \mathbf{a} \perp (\mathbf{b} - \mathbf{p}) &\iff \mathbf{a}^\top(\mathbf{b} - \mathbf{p}) = 0 \\ &\iff \mathbf{a}^\top(\mathbf{b} - \lambda\mathbf{a}) = 0 \\ &\iff \mathbf{a}^\top\mathbf{b} - \mathbf{a}^\top\lambda\mathbf{a} = 0 \\ &\iff \mathbf{a}^\top\mathbf{b} = \mathbf{a}^\top\lambda\mathbf{a} \\ &\iff \mathbf{a}^\top\mathbf{b} = \lambda\mathbf{a}^\top\mathbf{a} \\ &\iff \lambda = \frac{\mathbf{a}^\top\mathbf{b}}{\mathbf{a}^\top\mathbf{a}} \end{align}
  • Where we first used , then plugged in for , then used the distributivity of the vector multiplication.
  • We can divide by ( is a nonzero real number, as is a nonzero vector)

We can then plug in into to get the projection vector We can do this since is a scalar so (commute and associativity).

Idempotence in 1d: if we want to find the projection of a vector , then the projection simply returns , as is already on the line (subspace).

General Case

5.2.3 Projection is well defined

The projection of a vector to the subspace is well defined. It can be written as where satisfies the normal equations

Intuition:

  • In the previous case, we had . Here, the same orthogonality condition holds for all columns of (that we are projecting on).
  • This is the same as stating which by substituting gives which we can restate as , which is the normal equation.

Unique solution

If is invertible, we have a unique solution that satisfies the equation:

From we can construct a formula for : ( invertible if the columns of are independent), which gives us .

5.2.4 invertible has indep. columns

is invertible if and only if has linearly independent columns.

5.2.5 Projection Matrix

Let be a subspace in and a matrix whose columns are a basis of . The projection of to is given by where is the projection matrix.

Note the condition for the columns to be a basis - this forces them to be independent, which means invertible by Lemma 5.2.4.

IMPORTANT It may look like we can simplify the expression for the projection matrix . This is not the case as is only the case if itself is invertible. But if is invertible, it spans anyways and any projection is simply the point itself. This is beautifully reflected in the fact that if we simplify then we simply get .

5.2.6

If then by definition. This requires us to have that .

We also say is idempotent.

is symmetric (reprove in exam)

For we have that .

Proof: We use the fact that for invertible matrices .

5.2.6

Let be the orthogonal complement of and the projection matrix onto Then is the projection matrix that maps to .

Proof Idea: Since with Thus This is true, since it holds that indeed is also idempotent: