 Let me present to you the so-called orthogonal decomposition theorem. If we have a vector y that lives inside of the vector space fn for some field f and we take a subspace w of that vector space, there always exist vectors w1 and w2 such as the following conditions that hold. First of all, w1 will live inside this subspace w, which be aware y itself might not have anything to do with w, but w1 will live inside of w, w2 will be inside the orthogonal complement of w, and the sum of w1 plus w2 will equal y. And in fact, there's only one way to do this, and so this is the orthogonal decomposition. We can break apart y into two pieces of a w part and a w per part. And the proof of this theorem is actually quite simple if you use orthogonal complements. The idea is you set w1 to equal y hat. More specifically, this is the orthogonal projection onto w of the vector y. Okay, so you take that vector by construction. Remember, this thing will look like the sum where i equals 1, 1 to p of, you're going to take vi dot y over vi dot vi times vi, which will live inside of w assuming that the w is the span of an orthogonal basis, v1, v2, all the way up to vp. So you have some orthogonal basis right here of w. At the moment, we kind of lack the, you know, we should make mention like how do we even know w has an orthogonal basis. It turns out when we talk about the Gram-Smith procedure, we'll get exactly that. So we can always construct this orthogonal projection and that gives you the element in w. How do you get w2? Well, w2 is just going to be y minus y hat, for which you can then show that y hat dot y minus y hat is always equal to zero. So these things will always be perpendicular to each other, which then implies that y minus y hat belongs to w perp. Clearly the way we've defined this, if w1 is y hat and w2 is y minus y hat, their sum will equal y. So that's what the orthogonal projection, the orthogonal decomposition theorem is all about, is we can decompose a vector using orthogonal projections. Let's look at an example of such a thing. Let's take two vectors u1 and u2 to be 1, 2, 3 and negative 4, negative 5 for negative 1, excuse me. Notice real quick that if I take the dot product of u1 and u2, you end up with negative 5 plus 8 minus 3, which is equal to zero. So those are perpendicular with each other. And let's take the vector y, which y is not actually inside of w. Maybe it could be, I don't know. We're going to see it's not going to be able to. So I want to construct the orthogonal decomposition of y with respect to this space w and this orthogonal basis, which be aware the orthogonal decomposition does not depend on which orthogonal basis you use. The calculation will change a little bit, but the end result will be the same. So if we want to calculate w1, right? This is supposed to equal the orthogonal projection onto w of y. So this will look like the sum. We're going to take u1 dot y divided by u1 dot u1 times u1. And then add to that u2 dot y divided by u2 dot u2 times u2. So doing this calculation here. So u1 dot y, we're going to get negative 9 plus 40 minus 3. And this will sit above 1 plus 4 plus 9. And we're going to times that by 1, 2, and 3. And then for the second one, u2 dot y, we're going to get 45 plus 80 plus 1. And this sits above u2 dot u2. So we get 25 plus 16 plus 1. And we'll times this by negative 5, 4, and negative 1. So some arithmetic that has to be done here, but nothing, frankly, that's going to be too painful for us here. And so we're going to get 40 minus 9 minus 3. That turns out to be 28. 1 plus 4 plus 9 is 14 times the vector 1, 2, and 3. And then for the second one, 45 plus 80 plus 1, that turns out to be 126. And then 25 plus 16 plus 1 is 42. So we get negative 5, 4, and negative 1. Notice that these fractions both reduce down. 14 goes into 28, 2 times. 42 goes into 126. That goes in there three times. And so if you take 2 times 1, 2, 3, and 3 times negative 5, 4, and 7, you can see that that's going to turn out to be the vector negative 13, 16, and 3. This is a vector that lives inside of w. It was a linear combination of its basis right here. So this gives you y hat, aka w1 here. The next one, if you want to calculate w2, it's a whole lot easier to do. We just have to take y minus w1. That is y minus y hat right here. So recall that y, I can't see on the screen anymore, y was just going to be negative 9, 20, and negative 1. y hat, which we can see right here, we're going to subtract from that negative 13, 16, and 3. And so that adds up to just to be 4, 4, and negative 4. Like so. And so let's verify to make sure we have everything correct. So if we take w1 plus w2, this part we should expect to go smoothly. We take our w1 right here, which was inside of w. We get negative 13, 16, and 3. And then we add it to w2, which is right here, 4, 4, and negative 4. And given that we computed w2 just a second go by subtraction, the sum should work out pretty obviously. You're going to end up with negative 9, 20, and negative 1 again. That's what y originally was. No surprise there. But this is this is the important part. So we found a vector in w, which adds to another vector to give you y, is w2 in the orthogonal complement. To prove that we're going to compute the dot product of w1 and w2. We're going to take the negative 13, 16, and 3. And we're going to dot it with 4, 4, and negative 4. So negative 13 times 4 is a negative 52. 16 times 4 is a 64. And 3 times negative 4 is negative 12, which you can see combined 52 and 12. You're going to get negative 64 plus 64, which gives you 0. Thus, in fact, we see that w2 belongs to w perp like we thought it would. And so we've then computed a orthogonal decomposition.