Orthogonality & Orthonormal Bases
1607 words
8 min read
Visual companion
Python
Type and operator map
Python Week 1: the first filter for runtime behavior
View
Revision summary
What this note is really saying
Short form
# Orthogonality & Orthonormal Bases ## 🎯 Learning Objectives After this topic you will be able to: - Determine whether vectors are orthogonal - Define orthogonal complements and find them - Compute the orthogonal projection of a vector onto a subspace - Explain why orthonormal bases are convenient - Express a vecto...

Orthogonality & Orthonormal Bases
🎯 Learning Objectives
After this topic you will be able to:
- Determine whether vectors are orthogonal
- Define orthogonal complements and find them
- Compute the orthogonal projection of a vector onto a subspace
- Explain why orthonormal bases are convenient
- Express a vector in an orthonormal basis easily via inner products
📋 Prerequisites
- Inner Products & Norms (Week 7) — inner products, angles
- Subspaces (Week 3) — linear subspaces
- Orthogonality is the geometric heart of linear algebra
1. Intuition: Right Angles Everywhere
Two vectors are orthogonal if they meet at a right angle (dot product = 0). In an inner product space:
Why is orthogonality so powerful?
- Orthogonal vectors are automatically linearly independent
- Coordinates in an orthonormal basis are computed with simple inner products (no solving equations!)
- Projections onto orthogonal subspaces are easy (Diagram)
2. Orthogonal Vectors and Sets
2.1 Orthogonal Set
⟨c1v1+⋯+ckvk,vi⟩=ci⟨vi,vi⟩=0Definition (Orthogonal Set). A set of vectors {v1,…,vk} is orthogonal if ⟨vi,vj⟩=0 for all i=j. Theorem. An orthogonal set of non-zero vectors is linearly independent. Proof: Suppose c1v1+⋯+ckvk=0. Take inner product with vi:
Since ⟨vi,vi⟩=0 (non-zero vector), ci=0 for all i. ∎
2.2 Orthonormal Set
>⟨vi,vj⟩={10i=ji=j>Definition (Orthonormal Set). An orthonormal set is an orthogonal set where each vector has norm 1:
Example 1: Orthogonal and orthonormal sets{(1,2,−3),(3,0,1),(1,−5,−3)} is orthogonal (check dot products = 0). Normalising gives an orthonormal set.
2.3 Orthonormal Basis
v=⟨v,e1⟩e1+⟨v,e2⟩e2+⋯+⟨v,en⟩enDefinition (Orthonormal Basis). An orthonormal basis of V is a basis that is also an orthonormal set. The beauty of orthonormal bases: If {e1,…,en} is orthonormal, then for any v∈V:
The coordinates are just inner products — no system of equations to solve!
Example 2: Coordinates in orthonormal basisStandard basis of R2 is orthonormal. For v=(3,4): ⟨v,e1⟩=3, ⟨v,e2⟩=4. So v=3e1+4e2 — we read coordinates directly. Example 3: A non-standard orthonormal basisB={(21,21),(−21,21)} is orthonormal.For v=(3,1): ⟨v,b1⟩=23+1=24=22 ⟨v,b2⟩=2−3+1=2−2=−2Check: 22(21,21)+(−2)(−21,21)=(2,2)+(1,−1)=(3,1) ✓
3. Orthogonal Complements
>W⊥={v∈V∣⟨v,w⟩=0 for all w∈W}>Definition (Orthogonal Complement). For a subspace W⊆V, the orthogonal complement is:
Properties:
- W⊥ is a subspace of V
- W∩W⊥={0}
- dim(W)+dim(W⊥)=dim(V)
- (W⊥)⊥=W
Example 4: Orthogonal complement in ℝ²W=span{(1,2)} (a line). W⊥={(x,y)∣x+2y=0} (the perpendicular line). Basis for W⊥: {(−2,1)}. Example 5: Orthogonal complement in ℝ³W=xy-plane {(x,y,0)}. W⊥={(0,0,z)} (the z-axis).
4. Orthogonal Projections
>projW(v)=i=1∑k⟨v,ei⟩ei>Definition (Orthogonal Projection). For a subspace W⊆V with orthonormal basis {e1,…,ek}, the orthogonal projection of v onto W is:
The component of v orthogonal to W is v−projW(v), which lies in W⊥.
Example 6: Projection onto a lineProject v=(3,4) onto the line W=span{(1,2)}.Normalise: e=5(1,2). ⟨v,e⟩=53+8=511. projW(v)=511⋅5(1,2)=511(1,2)=(2.2,4.4).Check: v−proj=(0.8,−0.4), which is orthogonal to (1,2): 0.8(1)+(−0.4)(2)=0 ✓
5. Edge Cases & Gotchas
| Situation | What Happens |
|---|---|
| Zero vector | Orthogonal to everything; cannot be in an orthonormal set |
| ** v∈W ** | projW(v)=v |
| ** v⊥W ** | projW(v)=0 |
6. Common Pitfalls
❌ Pitfall 1: Thinking orthogonal = independent but not vice versa
Independence does NOT imply orthogonality. (1,0) and (1,1) are independent but not orthogonal.
❌ Pitfall 2: Normalising before checking orthogonality
Normalise after building orthogonal vectors, not before.
❌ Pitfall 3: Forgetting to normalise basis vectors for projection formula
The formula projW(v)=∑⟨v,ei⟩ei requires an orthonormal basis, not just orthogonal.
7. Formula Summary Table
| Concept | Formula |
|---|---|
| Orthogonal vectors | ⟨u,v⟩=0 |
| Orthonormal set | Orthogonal + each has norm 1 |
| Coordinates in orthonormal basis | ci=⟨v,ei⟩ |
| Orthogonal complement | W⊥={v∣⟨v,w⟩=0 ∀w∈W} |
| **Projection onto W ** | projW(v)=∑⟨v,ei⟩ei |
8. 📝 Practice Questions
Q1: Orthogonal set?Is {(1,1,1),(1,−1,0),(1,1,−2)} orthogonal?Solution: (1,1,1)⋅(1,−1,0)=1−1+0=0 ✓ (1,1,1)⋅(1,1,−2)=1+1−2=0 ✓ (1,−1,0)⋅(1,1,−2)=1−1+0=0 ✓Yes, orthogonal. Q2: Orthonormal from orthogonalNormalise the orthogonal set from Q1.Solution: ∥(1,1,1)∥=3, so e1=(31,31,31). ∥(1,−1,0)∥=2, so e2=(21,−21,0). ∥(1,1,−2)∥=6, so e3=(61,61,−62). Q3: Coordinates in orthonormal basisExpress (2,5,3) in the orthonormal basis from Q2.Solution: c1=⟨(2,5,3),e1⟩=32+5+3=310 c2=⟨(2,5,3),e2⟩=22−5+0=−23 c3=⟨(2,5,3),e3⟩=62+5−6=61So (2,5,3)=310e1−23e2+61e3. Q4: Orthogonal complementFind W⊥ where W=span{(1,1,1),(1,0,−1)}.Solution: Solve w⊥both: (x,y,z)⋅(1,1,1)=x+y+z=0 (x,y,z)⋅(1,0,−1)=x−z=0⇒x=z. Then x+y+x=2x+y=0⇒y=−2x.W⊥=span{(1,−2,1)}. Q5: Projection onto a lineProject (2,1) onto the line through (1,1).Solution: e=2(1,1). ⟨(2,1),e⟩=22+1=23. proj=23⋅2(1,1)=23(1,1)=(1.5,1.5). Q6: Projection onto a planeProject (1,2,3) onto the plane x+y+z=0 (with orthonormal basis from Q2's e2,e3).Solution: c2=⟨(1,2,3),e2⟩=21−2+0=−21. c3=⟨(1,2,3),e3⟩=61+2−6=−63=−23.proj=−21e2−23e3.Simplify: e2+3e3=(21+361,−21+361,0+3(−62)) =(21+21,−21+21,−623)=(2,0,−2).So proj=2−1(2,0,−2)=(−1,0,1).Check: (−1,0,1) is in the plane x+y+z=0 ✓. And (1,2,3)−(−1,0,1)=(2,2,2) is along (1,1,1), perpendicular to the plane ✓. Q7: Orthogonal decompositionDecompose (4,7) into components parallel and perpendicular to (2,3).Solution: Project onto (2,3): projuv=∥u∥2v⋅uu=4+98+21(2,3)=1329(2,3)=(1358,1387). v⊥=(4,7)−(1358,1387)=(1352−58,1391−87)=(−136,134). Q8: Orthogonal projection formula checkIf {e1,…,ek} is orthonormal, show ∥projW(v)∥2=∑i=1k⟨v,ei⟩2.Proof: ∥proj∥2=⟨∑⟨v,ei⟩ei,∑⟨v,ej⟩ej⟩=∑i∑j⟨v,ei⟩⟨v,ej⟩⟨ei,ej⟩. Since ⟨ei,ej⟩=0 for i=j and =1 for i=j: ∥proj∥2=∑i=1k⟨v,ei⟩2. ✓ Q9: Orthogonal complement of a sumShow (W1+W2)⊥=W1⊥∩W2⊥.Proof: v∈(W1+W2)⊥ iff ⟨v,w1+w2⟩=0 for all w1∈W1,w2∈W2. This holds iff ⟨v,w1⟩=0 for all w1 and ⟨v,w2⟩=0 for all w2, i.e., v∈W1⊥∩W2⊥. ✓ Q10: Best approximationShow that projW(v) is the closest vector in W to v — i.e., for any w∈W: ∥v−projW(v)∥≤∥v−w∥.Proof: Write v−w=(v−proj)+(proj−w). Since proj−w∈W and v−proj∈W⊥, they're orthogonal. By Pythagoras: ∥v−w∥2=∥v−proj∥2+∥proj−w∥2≥∥v−proj∥2. ✓
🔗 Cross-References
- Next topic: Gram-Schmidt & QR Decomposition
- Week 8 (Gram-Schmidt): Builds orthonormal bases from any basis
- Week 12 (Eigenvalues): Spectral theorem — symmetric matrices have orthogonal eigenvectors
- BSCS2004 (ML Foundations): Orthogonal features, PCA Join Discord Previous7.3 Inner Products & NormsNext8.2 Gram-Schmidt & QR