Module 1 of 1 · Lesson 7 of 14
Orthogonality and Projection
Lengths and angles on any space, orthonormal bases, and the closest point in a subspace.
What you will be able to do
Given a basis of a subspace, the learner can produce an orthogonal basis by Gram–Schmidt, project a vector onto that subspace, verify that the residual is orthogonal to the subspace, and set up the normal equations for a least-squares problem.
Orientation
Finding coordinates in an arbitrary basis means solving a linear system: every coordinate depends on every other. In an orthonormal basis it means taking one inner product per coordinate, because the directions do not interfere.
That independence follows from orthogonality, and it answers a second question at the same time. Given a point off a subspace, the closest point in it is found by keeping the part that lies along the subspace and discarding the part perpendicular to it, and the discarded part being perpendicular is exactly what makes the remainder closest.
Least squares is that construction applied to a system with no solution. When
Definition
The inner product axioms and what depends on the choice
Positive definiteness is what makes a norm. Symmetry and linearity alone would permit
Orthogonality is relative to the inner product. The vectors
Why an orthogonal set is independent. Suppose
Why the coefficients are inner products. For an orthonormal basis, apply
The denominator is the commonest omission. Writing
Projection is idempotent.
Figure
Projection, residual, and the right angle between them
The right angle is the whole theorem. Because
Example
Orthogonal sets in four different spaces
The same definition, applied wherever an inner product exists.
The standard basis of
A rotated pair in
which pair to zero and have norm 1. This is the distinction that decides whether the denominators in the projection formula may be dropped.
Polynomials on
One Gram–Schmidt step replaces
Two functions can look entirely unalike and still fail to be orthogonal; the integral decides, not the appearance.
Trigonometric functions on
while
Symmetric matrices, with
is pairwise orthogonal, with squared norms
Nothing about the objects, lists of numbers, polynomials, functions, matrices. What they share is an inner product satisfying the three axioms, and every construction in this unit is written in those terms alone. What differs is which sets count as orthogonal, and that depends entirely on the inner product chosen.
Procedure
Orthogonalise, project, verify
Gram–Schmidt. Given a basis
.- For
: subtract from its projection onto each earlier ,
- Optionally divide each
by to normalise.
At each step, check
Projecting onto a subspace
If the basis is orthonormal the denominators are 1 and may be dropped, but only then.
Verification, in two independent ways.
| Check | What it catches |
|---|---|
| a wrong coefficient, a missing denominator | |
| an arithmetic slip anywhere |
The first is the definitive one: the projection is characterised by having an orthogonal residual, so a residual that fails the test means the answer is not the projection.
Least squares for
- Form
and . - Solve
. - The fitted vector is
, and the residual is . - Check
. The residual is orthogonal to every column.
For fitting
The two rows say
Worked example
Gram–Schmidt, then a projection, then the check
Let
---
Step 1: orthogonalise. Take
For
Check.
The pair
Step 2: the coefficients.
The denominators matter: dropping them would give
Step 3: the projection.
Step 4: the residual and the checks.
Orthogonality.
Pythagoras.
and
On the ordering. Starting Gram–Schmidt from
Theorem
The projection is the closest point
Theorem. Let
Proof. Write
and
with equality exactly when
The proof uses only that
Corollary (Pythagoras for the decomposition). Taking
Corollary (the normal equations). Let
So the normal equations are the orthogonality condition rearranged, not a separate construction. They are solvable for any
Why uniqueness can fail. If the columns are dependent, many
Non-example
Projecting without an orthogonal basis, and three other errors
Using the formula on a non-orthogonal basis. Take
The correct projection is
The formula presumes the cross terms vanish. When they do not, each term double-counts the overlap between the basis vectors, and the result is a vector in
Dropping the denominator. For an orthogonal but not orthonormal basis, writing
Calling vectors orthogonal without naming the inner product.
Reading uniqueness of the fit as uniqueness of the coefficients. When the columns of
Each drops a condition that the construction depends on, orthogonality of the basis, the normalisation, the choice of inner product, independence of the columns, and each produces an answer that looks well-formed. Only the residual check catches the first two, and only attention to the hypotheses catches the last two.
Optional enrichment (1)
Application
Fitting a line as a projection
Fit
As a system with no solution. Demanding exact fit gives three equations in two unknowns:
The three points are not collinear, so
The normal equations. With
The determinant is
The fitted line is
The residuals, and what the normal equations asserted. Fitted values at
Row 1 of the normal equations says
Row 2 says
Those two conditions are
The sum of squared residuals is
What this account does not establish. That the line is a good model, that the errors behave in any particular way, or that
What the geometry explains. It accounts for why the normal equations look as they do, why an intercept forces the residuals to sum to zero, why dependent columns leave the fit unique but the coefficients not, and why the computation is stable when the columns are far from parallel and delicate when they are nearly aligned.