This note is the second part of the geometry review used later to build the Fourier series: a vector space V with a scalar product ⟨⋅,⋅⟩ (linear in the first argument, conjugate-symmetric), the induced norm ∥v∥=⟨v,v⟩, and orthogonality v⊥w⟺⟨v,w⟩=0.
Definition: orthogonal projection onto a subspace
Let V be a vector space with scalar product and let W be a subspace of V. Given v∈V, the orthogonal projection of v onto W is a vector, denoted PvW, such that
PvW∈W;
v−PvW⊥w for all w∈W, i.e. ⟨v−PvW,w⟩=0 for all w∈W.
v
/|
/ | v - P
/ |
------P---+---------- W (P = P^W_v is the foot of the perpendicular from v to W)
Recall the lemma: if PvW exists, then it is unique.
Lemma (unique representation of vectors given an orthogonal basis)
Let V be a vector space with scalar product and W⊂V the subspace
W=span{w1,w2,…,wN},
where the generators are orthogonal: ⟨wk,wh⟩=ckδk,h, with δk,h=1 if k=h and 0 otherwise (δk,h is the Kronecker delta). Then:
(a) each w∈W has a unique representation
w=k=1∑Nαkwk,αk=⟨wk,wk⟩⟨w,wk⟩,
and moreover ∥w∥2=∑k=1Nck∣αk∣2.
(b) given v∈V, v∈/W,
PvW=k=1∑Nakwk,ak=⟨wk,wk⟩⟨v,wk⟩.
Proof of (a). If w∈W then w=∑kαkwk for some N-tuple of coefficients. Since the wk are orthogonal, they form a basis of W, so the αk are uniquely determined. Taking the scalar product of both sides with wk:
⟨w,wk⟩=⟨h=1∑Nαhwh,wk⟩=⟨wk,wk⟩αk,
because all the terms with h=k vanish; this gives αk=⟨w,wk⟩/⟨wk,wk⟩. Finally
∥w∥2=⟨w,w⟩=⟨k∑αkwk,h∑αhwh⟩=k=1∑Nh=1∑Nαkαh⟨wk,wh⟩=k=1∑Nck∣αk∣2.
Proof of (b). It is enough to verify properties (1) and (2) of the definition of projection. Property (1) is trivial: PvW=∑k⟨wk,wk⟩⟨v,wk⟩wk is a linear combination of the generators of W. For (2) it is enough to show v−PvW⊥wk for each generator, i.e. ⟨v−PvW,wk⟩=0 for k=1,…,N. Substituting,
⟨v−PvW,wk⟩=⟨v,wk⟩−h=1∑N⟨⟨wh,wh⟩⟨v,wh⟩wh,wk⟩.
Only the term h=k survives in the sum, so it equals
⟨⟨wk,wk⟩⟨v,wk⟩wk,wk⟩=⟨wk,wk⟩⟨v,wk⟩⟨wk,wk⟩=⟨v,wk⟩.
Hence ⟨v−PvW,wk⟩=0. ■
Let PvW be the projection of v onto W. Then
∥v−PvW∥≤∥v−w∥for all w∈W,
i.e. the projection is the point of W closest to v. More precisely,
w∈Wmin∥v−w∥2=∥v−PvW∥2=∥v∥2−∥PvW∥2.
Proof. Add and subtract PvW (0=PvW−PvW):
w∈Wmin∥v−w∥2=w∈Wmin⟨(v−PvW)+(PvW−w),(v−PvW)+(PvW−w)⟩.
Since PvW−w∈W and v−PvW⊥w′ for all w′∈W, the cross terms vanish and
=w∈Wmin[∥v−PvW∥2+∥PvW−w∥2].
The optimal (unique) solution is w∗=PvW, giving ∥v−PvW∥2. Finally, by the Pythagorean theorem and property (2) (since v=(v−PvW)+PvW with orthogonal summands), ∥v−PvW∥2=∥v∥2−∥PvW∥2. ■
Exercise: distance from a point to a line through the origin
Prove, using projections, the distance formula
dist(Q,W)=a2+b2∣ax0+by0∣,Q=(x0,y0),W:ax+by=0,
taking for granted that dist(Q,W)=∥u∥, where u=v−PvW is the vector from the foot of the perpendicular to Q (this should be proved separately). Take v=[x0y0]−[00]=[x0y0].
Solution. The line is by=−ax, so W=span([b−a]). The coefficient is
α=⟨[b−a],[b−a]⟩⟨[x0y0],[b−a]⟩=a2+b2bx0−ay0,PvW=α[b−a].
Writing it as a matrix acting on v,
PvW=[b−a][b−a][b−a][b−a][x0y0]=Π(projection matrix)[a2+b2b2−a2+b2ab−a2+b2aba2+b2a2][x0y0].
Then u⊥PvW with
u=v−PvW=(I−Π)[x0y0]=a2+b21[a2x0+aby0abx0+b2y0]=a2+b2ax0+by0[ab],
where I is the identity matrix. Hence
∥u∥2=(a2+b2)2(a2+b2)(ax0+by0)2=a2+b2(ax0+by0)2⇒dist(Q,W)=∥u∥=a2+b2∣ax0+by0∣.
(The lecture shows the expansion of ∥u∥2 term by term, with numerator a4x02+a2b2y02+2a3bx0y0+b4y02+a2b2x02+2ab3x0y0, and factors it as (a2+b2)(ax0+by0)2.)
In general, given Q and W, dist(Q,W)=∥Q−z∗∥ where z∗ is a special point of W: the projection of the point Q onto the subspace W, which is the optimum of the optimization problem solved by the projection theorem.
Versione ripasso
Projection of v onto subspace W: the vector PvW with (1) PvW∈W and (2) v−PvW⊥w for all w∈W. If it exists, it is unique.
each w∈W is w=∑kαkwk with αk=⟨wk,wk⟩⟨w,wk⟩ (unique) and ∥w∥2=∑kck∣αk∣2;
for any v: PvW=∑kakwk, ak=⟨wk,wk⟩⟨v,wk⟩.
Proof idea for PvW: take the scalar product with each wk; only the h=k term survives, so ⟨v−PvW,wk⟩=0.
Projection theorem:∥v−PvW∥≤∥v−w∥ for all w∈W; minw∈W∥v−w∥2=∥v−PvW∥2=∥v∥2−∥PvW∥2. Proof: split v−w=(v−PvW)+(PvW−w), cross term vanishes, Pythagoras.
Distance point-line:dist((x0,y0),ax+by=0)=a2+b2∣ax0+by0∣, from W=span[b,−a]T, Π=a2+b21[b2−ab−aba2], u=(I−Π)v.
Typical mistakes: applying the coefficient formula when the generators are not orthogonal; forgetting the conjugate on the second argument of the scalar product; dividing by ⟨wk,wk⟩ and forgetting that it is not 1 in general.