← Module 02 / Vectors & spaces

Lesson 02.11 · §3.5.3

Why is the perpendicular foot the closest point?

Prove unique orthogonal decomposition and all eight projection properties.

In this lesson 6 ideas
  1. Separate what a line explains
  2. Proposition 1: unique orthogonal decomposition
  3. Proposition 2: eight properties and their proofs
  4. Write the projection as a matrix
  5. Explore in three dimensions
  6. Transfer

Source scope: §3.5.3. Worked numerical examples, experiments, and practice are teaching supplements unless identified as source results.

Separate what a line explains

Let SS be the horizontal axis and v=(2,3)v=(2,3). The component in SS is (2,0)(2,0); the remaining component is (0,3)(0,3). Moving along the line cannot remove that vertical residual.

For any subset SS of an inner product space VV, define

S⊥={v∈V:⟨v,s⟩=0 for every s∈S}.S^\perp=\{v\in V:\langle v,s\rangle=0\text{ for every }s\in S\}.

Even if SS is not a subspace, S⊥S^\perp is: zero is orthogonal to everything, and inner-product linearity preserves the zero conditions under addition and scaling.

Proposition 1: unique orthogonal decomposition

Source statement. If SS is a finite-dimensional subspace of VV, every v∈Vv\in V can be written uniquely as v=vS+v⊥v=v_S+v_\perp, with vS∈Sv_S\in S and v⊥∈S⊥v_\perp\in S^\perp.

Source proof, with steps expanded. Choose an orthonormal basis u1,…,umu_1,\ldots,u_m for SS. Set

vS=∑i⟨v,ui⟩ui,v⊥=v−vS.v_S=\sum_i\langle v,u_i\rangle u_i,\qquad v_\perp=v-v_S.

The first vector belongs to SS by its span. For each basis vector,

⟨v⊥,uj⟩=⟨v,uj⟩−∑i⟨v,ui⟩⟨ui,uj⟩=⟨v,uj⟩−⟨v,uj⟩=0.\langle v_\perp,u_j\rangle=\langle v,u_j\rangle-\sum_i\langle v,u_i\rangle\langle u_i,u_j\rangle=\langle v,u_j\rangle-\langle v,u_j\rangle=0.

Linearity extends orthogonality from the basis to all of SS. For uniqueness, take another decomposition, including one constructed from a different orthonormal basis. Then vS−vS′=v⊥′−v⊥v_S-v'_S=v'_\perp-v_\perp lies in both spaces. Therefore

0=⟨vS−vS′,v⊥′−v⊥⟩=∥vS−vS′∥2.0=\langle v_S-v'_S,v'_\perp-v_\perp\rangle=\|v_S-v'_S\|^2.

Thus vS=vS′v_S=v'_S, and subtracting from vv gives v⊥=v⊥′v_\perp=v'_\perp. Consequently V=S⊕S⊥V=S\oplus S^\perp under the stated finite-dimensional-subspace assumption. The source follows its proposition with “whenever S is a subspace”; retain the finite-dimensional hypothesis here rather than extending that sentence to arbitrary infinite-dimensional subspaces.

Proposition 2: eight properties and their proofs

Define the orthogonal projection P=PS:V→SP=P_S:V\to S by Pv=vSPv=v_S.

  1. Basis formula: Pv=∑i⟨v,ui⟩uiPv=\sum_i\langle v,u_i\rangle u_i for any orthonormal basis of SS. This is the construction above; uniqueness makes it independent of basis.
  2. Residual: v−Pv⊥Sv-Pv\perp S. This was proved by taking its inner product with every basis vector.
  3. Linearity: Write x=xS+x⊥x=x_S+x_\perp and y=yS+y⊥y=y_S+y_\perp. Their sum splits as (xS+yS)+(x⊥+y⊥)(x_S+y_S)+(x_\perp+y_\perp) in the two subspaces; uniqueness gives P(x+y)=Px+PyP(x+y)=Px+Py. Likewise αx=αxS+αx⊥\alpha x=\alpha x_S+\alpha x_\perp, giving P(αx)=αPxP(\alpha x)=\alpha Px.
  4. Identity on S: For s∈Ss\in S, s=s+0s=s+0 is its decomposition, so Ps=sPs=s.
  5. Range and nullspace: The definition gives range⁡(P)⊆S\operatorname{range}(P)\subseteq S; property 4 gives the reverse inclusion by choosing input ss. If Pv=0Pv=0, its decomposition gives v=v⊥∈S⊥v=v_\perp\in S^\perp. Conversely v∈S⊥v\in S^\perp has decomposition 0+v0+v and maps to zero. Hence range⁡(P)=S\operatorname{range}(P)=S and null⁡(P)=S⊥\operatorname{null}(P)=S^\perp.
  6. Idempotence: P2v=P(Pv)=PvP^2v=P(Pv)=Pv because Pv∈SPv\in S and property 4 applies. Thus P2=PP^2=P.
  7. No length increase: Pythagoras gives ∥v∥2=∥Pv∥2+∥v−Pv∥2≥∥Pv∥2\|v\|^2=\|Pv\|^2+\|v-Pv\|^2\ge\|Pv\|^2. Take nonnegative square roots.
  8. Unique closest point: For s∈Ss\in S, the residual is perpendicular to Pv−s∈SPv-s\in S. Thus
∥v−s∥2=∥(v−Pv)+(Pv−s)∥2=∥v−Pv∥2+∥Pv−s∥2≥∥v−Pv∥2.\|v-s\|^2=\|(v-Pv)+(Pv-s)\|^2=\|v-Pv\|^2+\|Pv-s\|^2\ge\|v-Pv\|^2.

Taking square roots proves ∥v−Pv∥≤∥v−s∥\|v-Pv\|\le\|v-s\|. Equality requires ∥Pv−s∥2=0\|Pv-s\|^2=0, equivalently s=Pvs=Pv. Therefore Pv=arg min⁡s∈S∥v−s∥Pv=\operatorname*{arg\,min}_{s\in S}\|v-s\|.

Any linear map satisfying P2=PP^2=P is called a projection. Orthogonal projections have the additional perpendicular-residual property; idempotence alone does not establish it. The experiment replaces the source’s closest-point sketch with the same point, subspace, foot, and residual, plus a movable candidate.

Write the projection as a matrix

For S⊆RnS\subseteq\mathbb R^n and orthonormal columns uiu_i assembled in UU,

PSx=∑i⟨x,ui⟩ui=∑i(xTui)ui=∑iuiuiTx=(∑iuiuiT)x.P_Sx=\sum_i\langle x,u_i\rangle u_i=\sum_i(x^Tu_i)u_i=\sum_i u_i u_i^Tx=\left(\sum_i u_i u_i^T\right)x.

Hence PS=∑iuiuiT=UUTP_S=\sum_i u_i u_i^T=UU^T, using the sum-of-outer-products identity. Orthonormality matters; arbitrary basis columns do not give this formula.

Explore it yourself

Find the closest point on a line

Move the candidate along S. Can its distance beat the perpendicular foot?

Preparing interactive controls…

x₁x₂-4-4-3-3-2-2-1-1011223344SvPvresiduals

v = (2, 1); Pv = (1.933, 1.116); residual = (0.067, -0.116). Residual · u = 0. Candidate distance² = 1.536 = residual length² 0.018 + foot-to-candidate length² 1.518.

Axes: first and second real coordinates, in unit steps. Endpoints and labels identify each vector.

Explore in three dimensions

Explore it yourself

Drop a perpendicular to a plane

Tilt S or move the candidate point s. Which part of v cannot be removed by moving within S?

Preparing interactive controls…

Teaching supplement · interactive 3D projection · one grid interval = one coordinate unit

vPvrv − ssnormalDrag v in the xy plane at its current z; coordinate sliders provide the same control.xyz0

Change the mathematics

v = (1.000, 1.000, 2.000); Pv = (1.000, 1.611, 1.128); r = (0, -0.611, 0.872). r·e₁ = 0; r·w = 0. ‖v−s‖² = 3.067 ≈ ‖r‖² 1.134 + ‖Pv−s‖² 1.934.

Drag the red endpoint to move v in xy at its current z, or use the three coordinate sliders. The residual is perpendicular to both plane directions, hence to every vector in S. Moving s changes the in-plane error only. The displayed squared-distance identity explains why Pv is the unique closest point.

Camera controls · change only the view

Drag the diagram with a mouse, or use these sliders with a keyboard or touch. Projection can make perpendicular directions look oblique; the coordinate readout is unchanged.

Red: input or first direction. Blue: second direction or reference. Green: result. Amber: residual, normal, or third direction. Labels distinguish overlapping objects.

Transfer

Project (2,0)(2,0) onto the line spanned by (1,1)(1,1).

Normalize the basis first

Use u=(1,1)/2u=(1,1)/\sqrt2. Then Pv=(vTu)u=(1,1)Pv=(v^Tu)u=(1,1) and the residual is (1,−1)(1,-1). Their dot product is zero. The closest distance is 2\sqrt2; the origin is farther away, at distance two.