The Cauchy–Schwarz inequality is a fundamental inequality in linear algebra and mathematical analysis. It states that the absolute value of the inner product of two vectors cannot exceed the product of their lengths. Its importance lies in expressing a single principle that applies to finite-dimensional vectors, infinite sequences, functions, and random variables. In its general form,
The lengths here are measured by the norm induced by the inner product. (people.maths.ox.ac.uk)
Statement and equality condition
Let be a vector space over the real numbers or complex numbers, equipped with an inner product. Define
For every , the inequality can equivalently be written
Equality holds exactly when and are linearly dependent: one is a scalar multiple of the other, or at least one is zero. Thus, for two nonzero vectors, linear independence makes the inequality strict. No assumption of finite dimension or completeness is required; in particular, the result holds in every Hilbert space. (arxiv.org)
The absolute value is essential. A real inner product can be negative, while a complex inner product need not be real. The inequality controls magnitude, rather than imposing an ordering on complex values. (people.maths.ox.ac.uk)
Finite sums and geometric meaning
For vectors in Euclidean space , the usual dot product gives
For complex coordinates, the corresponding expression is
where the bar denotes complex conjugation. (linear.axler.net)
In real inner product spaces, the inequality guarantees that
for nonzero vectors. This makes it possible to define their angle through the cosine of this ratio. In ordinary Euclidean geometry, equality means that the vectors point along the same line, either in the same or opposite directions. The same ratio underlies cosine similarity. (ximera.osu.edu)
For example, and yield , a strict inequality. Replacing by gives equality because .
Proof by orthogonal projection
A direct proof uses the nonnegativity of squared norms. Adopt the convention that the inner product is linear in its first argument. If , the result is immediate. Otherwise set
Then . The vector is the orthogonal projection of onto the line generated by . Expanding the squared norm gives
Multiplication by proves the inequality. Equality holds precisely when , which also proves the equality condition. This argument works over both real and complex scalars. (linear.axler.net)
A second proof in the real case considers the nonnegative polynomial
Its quadratic discriminant cannot be positive, giving the same bound. (people.maths.ox.ac.uk)
Integrals and infinite sequences
In measure theory, square-integrable functions form the space , with inner product
Consequently,
The integral of the product is well defined because is integrable. Equality means linear dependence as elements of ; proportionality is therefore required only almost everywhere, not necessarily at every point. Square-summable infinite sequences satisfy the analogous inequality, and their paired product series converges absolutely. (tropp.caltech.edu)
Probability and statistics
For real random variables with finite second moments on the same probability space, the pairing gives
where denotes expected value. Applying this to centered variables yields
Thus covariance is bounded by the product of the standard deviations. When both variances are positive, the Pearson correlation coefficient lies between and . Equality occurs when the centered variables are proportional almost surely. (tropp.caltech.edu)
Related inequalities
Cauchy–Schwarz establishes the triangle inequality for an inner-product-induced norm:
Taking square roots gives . This connects inner product geometry with the theory of normed vector spaces. (ximera.osu.edu)
It is also the case of Hölder’s inequality, which bounds products using conjugate exponents satisfying . Unlike the general Hölder inequality, the inner product formulation directly identifies equality with linear dependence. (math.ucla.edu)