Inner Product Spaces
An inner product space is a vector space with a generalized dot product. Once an inner product is specified, abstract vectors can have length, angle, distance, projection, and orthogonality. This lets the geometry of apply to polynomials, functions, matrices, and other vector spaces.
The important shift is that geometry is not tied to columns of numbers. A polynomial can be orthogonal to another polynomial, a function can have a norm, and a matrix can have a length. The inner product is the extra structure that tells us how to measure these objects.
Definitions
An inner product on a real vector space assigns a scalar to each pair of vectors and satisfies:
- .
- .
- .
- , with equality only for .
The norm induced by an inner product is
Two vectors are orthogonal if . A set is orthonormal if every vector has norm and distinct vectors are orthogonal.
For continuous functions on , a common inner product is
For matrices of the same size, the Frobenius inner product is
Key results
The Cauchy-Schwarz inequality holds in every real inner product space:
This inequality implies the triangle inequality:
It also permits the definition of angle between nonzero vectors by
The projection of onto a nonzero vector is
If is an orthonormal set, then the projection of onto its span is
The best approximation theorem says that this projection is the unique vector in closest to , and the error is orthogonal to .
The same vector space can carry different inner products, and changing the inner product changes the geometry. On , for example, the ordinary integral inner product treats all parts of the interval equally. A weighted inner product
with emphasizes regions where the weight is large. Orthogonality, projection, and best approximation are then measured with respect to that weighted notion of size. This is not merely a technical detail: many families of orthogonal polynomials arise from different choices of interval and weight.
In any inner product space, the polarization idea says that the inner product is encoded by the norm. For real inner product spaces,
So once the inner product is chosen, lengths determine angles; and once lengths and angles are known, projection and approximation follow. This is why inner products are the correct abstraction for Euclidean geometry.
Orthogonal sets behave especially well. If are nonzero and mutually orthogonal, then they are linearly independent. Suppose
Taking the inner product with gives
Because , the factor is positive, so . This argument works for every .
For an orthonormal basis, coordinates are inner products. If is an orthonormal basis, then every vector has the expansion
This is the abstract version of resolving a vector into perpendicular coordinate axes. Fourier series use the same principle in infinite-dimensional function spaces: coefficients are inner products with orthogonal basis functions.
Visual
| Space | Vectors look like | Example inner product | Norm |
|---|---|---|---|
| columns | Euclidean length | ||
| polynomials | root mean-square style length | ||
| functions | function energy | ||
| matrices | Frobenius norm |
Worked example 1: Orthogonal polynomials on an interval
Problem: in with
show that and are orthogonal, and compute .
Step 1: compute the inner product.
Thus and are orthogonal.
Step 2: compute the norm of .
Step 3: evaluate the integral.
Therefore
Checked answer: and .
Worked example 2: Project a polynomial onto a subspace
Problem: project onto the subspace in using the inner product
Step 1: use the projection formula onto the nonzero vector :
Step 2: compute the numerator.
Step 3: compute the denominator.
Step 4: combine.
Step 5: check orthogonality of the error.
Checked answer: the best constant approximation to on in this inner product is .
Code
import sympy as sp
x = sp.symbols("x")
def inner(f, g):
return sp.integrate(f * g, (x, -1, 1))
f = x**2
basis_vector = 1
projection = inner(f, basis_vector) / inner(basis_vector, basis_vector) * basis_vector
error = f - projection
print(sp.simplify(projection))
print(sp.simplify(inner(error, basis_vector)))
print(sp.sqrt(inner(x, x)))
The function inner encodes the chosen geometry. Changing the interval or adding a weight function changes lengths, angles, and projections.
Common pitfalls
- Assuming there is only one possible inner product on a vector space.
- Forgetting positive definiteness: must be positive for every nonzero vector.
- Treating orthogonality of functions as pointwise perpendicularity. It means the integral of the product is zero.
- Using projection formulas without the denominator .
- Calling an orthogonal set orthonormal before normalizing each vector to length .
- Assuming a formula from applies to functions without replacing dot products by the chosen inner product.
A good way to test whether a proposed formula is an inner product is to check the axioms with generic vectors, not only examples. Symmetry and linearity are usually straightforward. Positive definiteness is often the subtle part: one must prove that forces . For function spaces, this may require knowing whether functions are continuous or whether equality is understood pointwise or almost everywhere.
Projection in an inner product space should always be followed by an orthogonality check. If is claimed to be the projection of onto a subspace , then should be orthogonal to every vector in . When has a basis, it is enough to test the basis vectors. This is the abstract version of checking residuals in least squares.
The choice of inner product can change what "best" means. The constant function that best approximates on under the ordinary integral inner product is its average value over that interval. With a weighted inner product, the best constant would emphasize some parts of the interval more than others. Thus approximation results are always relative to the chosen geometry.
In complex vector spaces, the inner product axioms are adjusted with conjugation: symmetry becomes conjugate symmetry, and linearity is usually placed in one argument with conjugate linearity in the other. This page uses real inner products, but the complex convention is essential in Fourier analysis, quantum mechanics, and many numerical algorithms.
Finite-dimensional inner product spaces are especially close to once an orthonormal basis is chosen. The coordinates of a vector in that basis behave exactly like ordinary Euclidean coordinates, and the inner product becomes a dot product of coordinate vectors. This is why orthonormal bases are so valuable: they convert abstract geometry into familiar arithmetic.
For function spaces, orthogonality often expresses cancellation rather than pointwise separation. The functions and on are orthogonal because the positive area on one side cancels the negative area on the other side in the integral of their product. They are not perpendicular at each point. This integral viewpoint is essential for Fourier series and polynomial approximation.
Norms induced by inner products obey the parallelogram law:
Not every norm comes from an inner product. This identity is one way to recognize the special geometry inner products provide.
Inner product spaces are the natural setting for approximation because "closest" requires a notion of distance. Without an inner product or at least a norm, the phrase "best approximation" is incomplete. Once an inner product is chosen, projection gives a precise and computable answer.
This is also why orthogonality is more than a visual idea. In polynomial and function spaces, perpendicularity means zero inner product, often an integral cancellation. The same projection theorem that works for arrows then supports Fourier coefficients, least-squares fits, and orthogonal polynomial expansions.