Inner Product Spaces
A space with a dot product: the four rules that buy angles, lengths and projections in any dimension, including spaces of functions.
Why Does This Exist?
Vector spaces give addition and scaling but no geometry: without extra structure you cannot say how long a vector is, whether two vectors are perpendicular, or how much of one points along another. An inner product adds exactly that: a pairing obeying four axioms, from which lengths, angles, projections and the Cauchy-Schwarz inequality all follow.
This abstraction pays off the moment vectors stop being arrows. Function spaces (signals, images, solutions of differential equations) carry inner products defined by integrals. Kernel methods evaluate inner products in feature spaces nobody constructs explicitly. The dot product is the prototype; this page is the general contract it satisfies, which is what lets the same geometry run on functions.
The one idea you need first
A vector space supports adding vectors and scaling them, covered in vector spaces and rank. Lengths come from norms. The inner product sits underneath both: it manufactures a norm via , and that norm manufactures a distance.
Think of It Like This
A tape measure that also reads angles
A ruler measures lengths along one line. A protractor measures the opening between two lines. An inner product is the single instrument that does both and agrees with each: feed it one vector twice for squared length, feed it two different vectors for length-times-length-times-cosine.
Carry that instrument into a function space and it keeps working: "length" of a signal becomes root-mean-square energy, "angle" between two signals becomes their correlation. Same four axioms, wildly different objects measured. The contract travels; the pictures stay behind.
How It Actually Works
The four axioms for a real inner product:
- Symmetry: (conjugate symmetry over complex numbers).
- Linearity: linear in each argument: .
- Positive definiteness: , with equality only for .
From these alone: the induced norm satisfies the triangle inequality, projections behave, and angles make sense via . The crown jewel is Cauchy-Schwarz:
with equality exactly when and are linearly dependent. Every "correlation is at most 1" statement is this inequality in disguise.
Worked example
Test Cauchy-Schwarz on and with the standard dot product:
Check: . Holds with a small margin, and the margin says the vectors are nearly (not exactly) aligned: . The same computation with integrals, , bounds signal correlations identically.
Code
The point is the check: verify Cauchy-Schwarz and the projection formula on concrete vectors.
import numpy as np
u = np.array([1.0, 2.0])v = np.array([3.0, 4.0])print(float(u @ v) <= float(np.linalg.norm(u) * np.linalg.norm(v))) # -> Trueproj = (u @ v) / (v @ v) * v # projection of u onto vprint(proj.tolist()) # -> [1.32, 1.76]The projection points along (it equals ), and the leftover proj is perpendicular to : their dot product is up to rounding, which allclose confirms.
Watch Out For
Assuming the dot product is the only inner product
Weighted inner products , the Frobenius pairing , and integral pairings all satisfy the axioms and induce different geometries: different lengths, different angles, different "closest points". Least squares with a weight matrix is exactly a change of inner product. Name which pairing a result uses before quoting its geometry.
Forgetting conjugate symmetry over complex numbers
Over the axioms require , and physics-style texts put linearity in the second argument instead of the first. Code mixing conventions (NumPy's vdot conjugates the first argument) silently flips phases. In complex spaces, check the convention of every routine you call.
The Quick Version
- Inner products add lengths, angles and projections to vector spaces through four axioms.
- Cauchy-Schwarz bounds every pairing by the product of lengths: 11 below 11.18 above.
- The induced norm manufactures distances, so geometry follows the axioms everywhere.
- Function spaces carry integral inner products; kernels evaluate them implicitly.
- Weighted, Frobenius and integral pairings are all legitimate: name yours.