Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.Shadows
Hold a stick in the sunlight at noon. Its shadow on the floor is the part of the stick that points along the floor. The shadow is the closest you can get to the stick while staying flat on the floor. That’s an orthogonal projection.
Perpendicular helpers
Directions that are perpendicular to each other (like east, north and up) are wonderful helpers. Each one measures its own part of a vector, and none of them interfere with the others. Turning a messy set of directions into perpendicular ones, one at a time, is called Gram–Schmidt.
A spacecraft gets position readings from several noisy sensors. The best possible guess of where it really is turns out to be a “shadow” too: a projection of the truth onto what the sensors can see. That is the heart of the Kalman filter, which helped steer Apollo to the Moon.
- 1. Perpendicular arrows have a dot product of…
- 2. The shadow of the arrow (3, 4) on the floor (x-axis) has length…
- 3. How many mutually perpendicular directions fit in a room?
Level 1: Beginner
★★☆☆☆ Basic⏱ 15 minSecondary-school mathematics: arithmetic and elementary algebra.Inner products beyond the dot product
An inner product is any rule that behaves like the dot product. It gives you lengths and angles. Examples:
| Space | Inner product |
|---|---|
| weighted | with (more trust in some coordinates) |
| functions on | |
| random variables | (for zero-mean ones, this is the covariance) |
Example. On , . The constant function and are orthogonal!
Projection onto a line
For and , the coefficient is , so the projection is . The leftover is perpendicular to .
- 1. ⟨(1,2,3), (4,−5,6)⟩ = ?
- 2. Are (1, 1) and (1, −1) orthogonal?
- 3. On [−1, 1], ⟨1, x⟩ = ∫x dx = ?
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 45 minUndergraduate students and practising engineers.Projection onto a subspace
The projection of onto a subspace is characterized by one condition: the residual is orthogonal to .
- With an orthonormal basis : , and .
- With any basis (the columns of ): . These are the normal equations of A2.3-7.
- With a general inner product, solve the Gram system with and .
Projection matrices satisfy (projecting twice changes nothing) and .
Gram–Schmidt
Turn independent vectors into orthonormal with the same span. Subtract from each new vector its projections onto the earlier ’s, then normalize:
Worked example. For and :
- .
- , which has norm 0.8.
- So .
The coefficients form an upper-triangular , so Gram–Schmidt is the QR factorization (A2.3-4).
Function spaces: the same picture
Functions are vectors too. Apply Gram–Schmidt to on and you get the Legendre polynomials. Use and instead and the projection coefficients are the Fourier coefficients. A truncated Fourier series is the best approximation, in the integral-squared-error sense, by a trigonometric polynomial.
- 1. The residual b − p of an orthogonal projection is…
- 2. Projecting (1, 1, 1) onto the xy-plane gives…
- 3. A projection matrix satisfies…
Level 3: Advanced
★★★★☆ Advanced⏱ 45 minGraduate level, with full derivations and proofs.Cauchy–Schwarz
In any inner product space, . Equality holds exactly when and are parallel.
Proof. If , there is nothing to prove. Otherwise, let be the projection of onto . The residual is orthogonal to , so Pythagoras gives . ∎ This is what makes angles well defined in every inner product space.
The projection is the best approximation
If with , then for every other .
Proof. , where the second part lies in , so it is orthogonal to the first. By Pythagoras, . ∎
Bessel, Parseval and Hilbert spaces
For an orthonormal set , the captured energy never exceeds the total (Bessel):
Equality for every (Parseval) means the set is a complete orthonormal basis. In infinite dimensions, you also need completeness of the space (every Cauchy sequence converges) for projections to exist. A complete inner product space is a Hilbert space, such as . Hilbert spaces are the setting for Fourier analysis, quantum mechanics and kernel methods (RKHS, B3).
Classical vs modified Gram–Schmidt
In exact arithmetic, the two orderings are identical. In floating point:
- Classical GS computes every coefficient from the original . It loses orthogonality like and can fail completely on nearly dependent columns.
- Modified GS subtracts one projection at a time from the updated vector, and its error grows only like .
- Householder QR is better still (A2.3-4). Practice Code 3 measures the difference.
Exercise 3.1: Show that every projection matrix has eigenvalues 0 or 1
If , then , so . Consequently, the trace of equals its rank, which is the dimension of the subspace.
- 1. ‖u‖ = 3 and ‖v‖ = 4. The largest possible ⟨u, v⟩?
- 2. Which Gram–Schmidt variant is more stable in floating point?
- 3. trace of a projection onto a 2-D subspace of ℝ⁵?
Level 4: Expert
★★★★★ Expert⏱ 35 minResearchers: original papers and open problems.Estimation is projection
Treat zero-mean random variables as vectors with . The best linear estimate of a hidden state from measurements (minimum mean-square error) is the projection of onto their span. Its error is uncorrelated with every measurement: the orthogonality principle. This is the core of the Wiener filter and of the Kalman filter’s update step (Kalman, 1960). Fusing two sensors with noise variances and gives weights proportional to , and a fused variance smaller than either sensor’s alone. Practice Code 5 checks this by simulation.
Orthogonal bases in science and engineering
- Spectral methods: Legendre and Chebyshev expansions solve PDEs and trajectory-optimization problems to near machine precision (pseudospectral optimal control; Ross and Karpenko, 2012). This includes the methods used to plan the zero-propellant maneuvers of the International Space Station.
- Orthogonal polynomial features make polynomial regression well-conditioned (A2.3-8).
- Kernel methods do projections in a reproducing-kernel Hilbert space, where (B3).
- Krylov methods (A2.4-7) run Gram–Schmidt on . Arnoldi and Lanczos are Gram–Schmidt with structure.
- Orthogonality in deep learning: orthogonal initialization preserves signal norms through depth (Saxe et al., 2014), and orthogonality constraints stabilize recurrent networks.
References
- E. Schmidt (1907). “Zur Theorie der linearen und nichtlinearen Integralgleichungen.” Mathematische Annalen, 63.
- R. E. Kalman (1960). “A new approach to linear filtering and prediction problems.” Journal of Basic Engineering, 82.
- Å. Björck (1967). “Solving linear least squares problems by Gram–Schmidt orthogonalization.” BIT, 7.
- D. Luenberger (1969). Optimization by Vector Space Methods. Wiley. (Projection theorem and estimation.)
- L. N. Trefethen (2013). Approximation Theory and Approximation Practice. SIAM.
- A. Saxe, J. McClelland, S. Ganguli (2014). “Exact solutions to the nonlinear dynamics of learning in deep linear neural networks.” ICLR.
- I. M. Ross, M. Karpenko (2012). “A review of pseudospectral optimal control: From theory to flight.” Annual Reviews in Control, 36.
- G. Strang (2016). Introduction to Linear Algebra, 5th ed. Chapter 4.