Repository navigation
Orthogonality in Linear Algebra
The final piece in our theoretical module deals with orthogonality. Orthogonal vectors are our preferred vectors for most uses, so we need to look more closely at them. Everything in here is about orthogonality and how we can get it or use it. It's not just a random list of facts about orthogonality, though. The ideas hopefully build on each other in a logical way.
As a reminder, our key fact about orthogonality is:
Two vectors are orthogonal if their dot product is 0.
We'll start with a definition:
Definition: Let
$\large W$ be a subspace of$\large \mathbb{R}^n$ . The set of all vectors orthogonal to$\large W$ is called the orthogonal complement of$\large W$ , and we write$\large W^\perp$ .
As an example, let
There is a single basis vector orthogonal to the plane (the blue vector). The subspace is the set of all linear combinations of that basis vector. In other words,
Here's a neat result with orthogonal subspaces. Suppose we have a subspace
Note
The intuition here is that a vector space can be broken up into two independent or separate subpaces,
There is a theorem that we will use in optimization problems in our next module:
Theorem: Let
$\large A$ be an$\large m\times n$ matrix. Then$\large \left( \text{Row}(A)\right)^\perp=\text{Null}(A)$ and$\large \left( \text{Col}(A)\right)^\perp=\text{Null}(A^T)$ .
At first glance, this looks like the kind of thing you'd need to think hard about to understand. It's not that bad though. For the first statement, let's remember that
The second statement is just the first statement applied to the matrix
Note
Here's how we think of this theorem: we have an
For reasons we will see throughout the rest of the class, orthogonal vectors are the best vectors to work with!
Definition: A set of vectors
$\large \vec{v_1},\vec{v_2},\dots,\vec{v_m}$ in$\large \mathbb{R}^n$ is an orthogonal set of vectors if each pair of vectors is orthogonal (if$\large \vec{v_i}\cdot\vec{v_j}=0$ for all$\large i\ne j$ ).
Example: Show that the following is an orthogonal set of vectors:
We'll see in the video that these do make up an orthogonal set.
Now, a theorem that illustrates why we care about orthogonal sets of vectors:
Theorem: An orthogonal set of nonzero vectors is linearly independent.
The proof is short and is a good example of how these types of arguments are made. Please watch it in the video:
Note
One consequence of the theorem is that a set of orthogonal vectors necessarily forms a basis for whatever subspace they span!
Definition: An orthogonal basis for a subspace is a basis that is also an orthogonal set.
Now, in general if we want to write a given vector as a linear combination of basis vectors, we need to solve a system of linear equations (Gaussian elimination...yay!) to find the coefficients in the linear combination. But if we have an orthogonal basis, it's much easier!
Theorem: If
$\large \lbrace \vec{v_1},\vec{v_2},\dots,\vec{v_m}\rbrace$ is an orthogonal basis for$\large W$ , then any$\large \vec{u}\in W$ can be written$\large \vec{u} = c_1\vec{v_1}+c_2\vec{v_2}+\dots+c_m\vec{v_m}$ where the coefficients are:
$$\large c_j = \frac{\vec{u}\cdot\vec{v_j}}{\vec{v_j}\cdot\vec{v_j}}$$
Note
The proof of this theorem mirrors the proof in the video above. Just start with
Here's an example of how to use the theorem. We found earlier that the set:
is an orthogonal set in
We can repeat all of the above with unit vectors (vectors of length one,
Note
An orthonormal basis is the best kind of basis. But there is a conservation of misery principle at work here: it's easier to use an orthonormal basis, but it's harder to get one!
In Calc II, we learned about the projection of one vector onto another. The projection of
The formula we learned in calculus for the projection of
Even though we can only visualize projections in
Now, here's a new idea, and a big one. Instead of the projection of
The idea of the projection is that any vector
Note
In this situation, we have a vector
Theorem: Let
$\large \hat{u}$ be the projection of$\large \vec{u}$ onto a subspace$\large W$ ,$\large \hat{u}=\text{proj}_W\vec{u}$ . Then$\large\lVert \vec{u}-\hat{u}\rVert \le \lVert \vec{u}-\vec{v}\rVert$ for any$\large \vec{v}\in W$ .
Note
Whenever we see superlatives in math - closest, smallest, best - we should think about optimization. This case is no different. We will use the theorem above about projections onto a subspace in the next module, which is all about a key optimization technique known as Least Squares.
We now have a picture and an idea. We'd like to project a vector onto a subspace; we'd like to find the vector in
Here's our situation and formulas, which are based on the idea of subtracting off each orthogonal direction from
Theorem: Let
$\large \vec{u}$ be a vector in$\large \mathbb{R}^n$ , and let$\large W$ be a subspace of$\large \mathbb{R}^n$ with orthogonal basis$\large \lbrace \vec{v_1}, \vec{v_2},\dots,\vec{v_m} \rbrace$ . Then there are vectors$\large \hat{u}\in W$ and$\large \vec{z}\in W^\perp$ such that$\large \vec{u}=\hat{u}+\vec{z}$ . The formulas for$\large \hat{u}$ and$\large \vec{z}$ are:
Note
In the formula above, we start with
This is a lot, and it's and the end of one of our longest lectures all semester. Let's do an example that helpfully makes it more clear. The vectors
The image below shows the plane and vectors in this particular example:
I can:
- Recall and use the definitions of orthogonal set, orthogonal basis, orthogonal subspace, and orthogonal projection.
- Recognize an othogonal/orthonormal set of vectors.
- Recall and use theorems related to orthogonal/orthonormal sets/bases.
- Write a vector as a linear combination of an orthogonal/orthonormal basis.
- Find the orthogonal projection of a vector onto a subspace.