# Cauchy–Schwarz inequality

In mathematics, the Cauchy–Schwarz inequality is a useful inequality encountered in many different settings, such as linear algebra, analysis, probability theory, and other areas. It is considered to be one of the most important inequalities in all of mathematics.[1] It has a number of generalizations, among them Hölder's inequality.

The inequality for sums was published by Template:Harvs, while the corresponding inequality for integrals was first proved by Template:Harvs. The modern proof of the integral inequality was given by Template:Harvs.[1]

## Statement of the inequality

The Cauchy–Schwarz inequality states that for all vectors x and y of an inner product space it is true that

${\displaystyle |\langle x,y\rangle |^{2}\leq \langle x,x\rangle \cdot \langle y,y\rangle ,}$

where ${\displaystyle \langle \cdot ,\cdot \rangle }$ is the inner product also known as dot product. Equivalently, by taking the square root of both sides, and referring to the norms of the vectors, the inequality is written as

${\displaystyle |\langle x,y\rangle |\leq \|x\|\cdot \|y\|.\,}$[2]

Moreover, the two sides are equal if and only if x and y are linearly dependent (or, in a geometrical sense, they are parallel or one of the vectors' magnitude is zero).

If ${\displaystyle x_{1},\ldots ,x_{n}\in \mathbb {C} }$ and ${\displaystyle y_{1},\ldots ,y_{n}\in \mathbb {C} }$ have an imaginary component, the inner product is the standard inner product and the bar notation is used for complex conjugation then the inequality may be restated more explicitly as

${\displaystyle |x_{1}{\bar {y}}_{1}+\cdots +x_{n}{\bar {y}}_{n}|^{2}\leq (|x_{1}|^{2}+\cdots +|x_{n}|^{2})(|y_{1}|^{2}+\cdots +|y_{n}|^{2}).}$

When viewed in this way the numbers x1, ..., xn, and y1, ..., yn are the components of x and y with respect to an orthonormal basis of V.

Even more compactly written:

${\displaystyle \left|\sum _{i=1}^{n}x_{i}{\bar {y}}_{i}\right|^{2}\leq \sum _{j=1}^{n}|x_{j}|^{2}\sum _{k=1}^{n}|y_{k}|^{2}.}$

Equality holds if and only if x and y are linearly dependent, that is, one is a scalar multiple of the other (which includes the case when one or both are zero).

The finite-dimensional case of this inequality for real vectors was proven by Cauchy in 1821, and in 1859 Cauchy's student Bunyakovsky noted that by taking limits one can obtain an integral form of Cauchy's inequality. The general result for an inner product space was obtained by Schwarz in the year 1888.

## Proof

Let u, v be arbitrary vectors in a vector space V over F with an inner product, where F is the field of real or complex numbers. We prove the inequality

${\displaystyle {\big |}\langle u,v\rangle {\big |}\leq \left\|u\right\|\left\|v\right\|,}$

and the equality holds only when either u or v is a multiple of the other.

If v = 0 it is clear that we have equality, and in this case u and v are also linearly dependent (regardless of u). We henceforth assume that v is nonzero. We also assume that ${\displaystyle \langle u,v\rangle \neq 0}$ otherwise the inequality is obviously true, because neither ${\displaystyle \left\|u\right\|}$ nor ${\displaystyle \left\|v\right\|}$ can be negative.

Let

${\displaystyle z=u-{\frac {\langle u,v\rangle }{\langle v,v\rangle }}v.}$

Then, by linearity of the inner product in its first argument, one has

${\displaystyle \langle z,v\rangle =\left\langle u-{\frac {\langle u,v\rangle }{\langle v,v\rangle }}v,v\right\rangle =\langle u,v\rangle -{\frac {\langle u,v\rangle }{\langle v,v\rangle }}\langle v,v\rangle =0,}$

i.e., z is a vector orthogonal to the vector v (Indeed, z is the projection of u onto the plane orthogonal to v.). We can thus apply the Pythagorean theorem to

${\displaystyle u={\frac {\langle u,v\rangle }{\langle v,v\rangle }}v+z,}$

which gives

${\displaystyle \left\|u\right\|^{2}=\left|{\frac {\langle u,v\rangle }{\langle v,v\rangle }}\right|^{2}\left\|v\right\|^{2}+\left\|z\right\|^{2}={\frac {|\langle u,v\rangle |^{2}}{\left\|v\right\|^{2}}}+\left\|z\right\|^{2}\geq {\frac {|\langle u,v\rangle |^{2}}{\left\|v\right\|^{2}}},}$

and, after multiplication by ||v||2, the Cauchy–Schwarz inequality. Moreover, if the relation '≥' in the above expression is actually an equality, then and hence z = 0; the definition of z then establishes a relation of linear dependence between u and v. This establishes the theorem.

## Alternative Proof

Let uv be arbitrary vectors in a vector space V over F with an inner product, where F is the field of real or complex numbers.

If ${\displaystyle \langle u,v\rangle =0}$, the theorem holds trivially.

${\displaystyle 0\leq \left\|{\frac {\lambda u}{\|u\|}}-{\frac {v}{\|v\|}}\right\|^{2}=|\lambda |^{2}{\frac {\|u\|^{2}}{\|u\|^{2}}}-2{\text{Re}}\left(\left\langle {\frac {\lambda u}{\|u\|}},{\frac {v}{\|v\|}}\right\rangle \right)+{\frac {\|v\|^{2}}{\|v\|^{2}}}=2-2{\frac {{\text{Re}}\left(\lambda \langle u,v\rangle \right)}{\|u\|\|v\|}}}$

It follows that

${\displaystyle |\langle u,v\rangle |={\text{Re}}\left(\lambda \langle u,v\rangle \right)\leq \|u\|\|v\|}$

## Special cases

### Rn

In Euclidean space ${\displaystyle \mathbb {R} ^{n}}$ with the standard inner product, the Cauchy–Schwarz inequality is

${\displaystyle \left(\sum _{i=1}^{n}x_{i}y_{i}\right)^{2}\leq \left(\sum _{i=1}^{n}x_{i}^{2}\right)\left(\sum _{i=1}^{n}y_{i}^{2}\right).}$

To prove this form of the inequality, consider the following quadratic polynomial in z.

${\displaystyle (x_{1}z+y_{1})^{2}+\cdots +(x_{n}z+y_{n})^{2}=\left(\sum (x_{i}^{2})\right)\cdot z^{2}+2\cdot \left(\sum (x_{i}\cdot y_{i})\right)\cdot z+\sum (y_{i}^{2})}$

Since it is nonnegative it has at most one real root in z, whence its discriminant is less than or equal to zero, that is,

${\displaystyle \left(\sum (x_{i}\cdot y_{i})\right)^{2}-\sum {x_{i}^{2}}\cdot \sum {y_{i}^{2}}\leq 0,}$

which yields the Cauchy–Schwarz inequality.

An equivalent proof for ${\displaystyle \mathbb {R} ^{n}}$ starts with the summation below.

Expanding the brackets we have:

${\displaystyle \sum _{i=1}^{n}\sum _{j=1}^{n}\left(x_{i}y_{j}-x_{j}y_{i}\right)^{2}=\sum _{i=1}^{n}x_{i}^{2}\sum _{j=1}^{n}y_{j}^{2}+\sum _{j=1}^{n}x_{j}^{2}\sum _{i=1}^{n}y_{i}^{2}-2\sum _{i=1}^{n}x_{i}y_{i}\sum _{j=1}^{n}x_{j}y_{j},}$

collecting together identical terms (albeit with different summation indices) we find:

${\displaystyle {\frac {1}{2}}\sum _{i=1}^{n}\sum _{j=1}^{n}\left(x_{i}y_{j}-x_{j}y_{i}\right)^{2}=\sum _{i=1}^{n}x_{i}^{2}\sum _{i=1}^{n}y_{i}^{2}-\left(\sum _{i=1}^{n}x_{i}y_{i}\right)^{2}.}$

Because the left-hand side of the equation is a sum of the squares of real numbers it is greater than or equal to zero, thus:

${\displaystyle \sum _{i=1}^{n}x_{i}^{2}\sum _{i=1}^{n}y_{i}^{2}-\left(\sum _{i=1}^{n}x_{i}y_{i}\right)^{2}\geq 0.}$

Yet another approach when n ≥ 2 (n = 1 is trivial) is to consider the plane containing x and y. More precisely, recoordinatize Rn with any orthonormal basis whose first two vectors span a subspace containing x and y. In this basis only ${\displaystyle x_{1},~x_{2},~y_{1}}$ and ${\displaystyle y_{2}~}$ are nonzero, and the inequality reduces to the algebra of dot product in the plane, which is related to the angle between two vectors, from which we obtain the inequality:

${\displaystyle |x\cdot y|=\|x\|\|y\||\cos \theta |\leq \|x\|\|y\|.}$

When n = 3 the Cauchy–Schwarz inequality can also be deduced from Lagrange's identity, which takes the form

${\displaystyle \langle x,x\rangle \cdot \langle y,y\rangle =|\langle x,y\rangle |^{2}+|x\times y|^{2}}$

from which readily follows the Cauchy–Schwarz inequality.

Another proof of the general case for n can be done by using the technique used to prove Inequality of arithmetic and geometric means.

### L2

For the inner product space of square-integrable complex-valued functions, one has

${\displaystyle \left|\int _{{\mathbb {R} }^{n}}f(x){\overline {g(x)}}\,dx\right|^{2}\leq \int _{{\mathbb {R} }^{n}}\left|f(x)\right|^{2}\,dx\cdot \int _{{\mathbb {R} }^{n}}\left|g(x)\right|^{2}\,dx.}$

A generalization of this is the Hölder inequality.

## Applications

The triangle inequality for the inner product is often shown as a consequence of the Cauchy–Schwarz inequality, as follows: given vectors x and y:

{\displaystyle {\begin{aligned}\|x+y\|^{2}&=\langle x+y,x+y\rangle \\&=\|x\|^{2}+\langle x,y\rangle +\langle y,x\rangle +\|y\|^{2}\\&=\|x\|^{2}+2{\text{ Re}}\langle x,y\rangle +\|y\|^{2}\\&\leq \|x\|^{2}+2|\langle x,y\rangle |+\|y\|^{2}\\&\leq \|x\|^{2}+2\|x\|\|y\|+\|y\|^{2}\\&=\left(\|x\|+\|y\|\right)^{2}.\end{aligned}}}

Taking square roots gives the triangle inequality.

The Cauchy–Schwarz inequality allows one to extend the notion of "angle between two vectors" to any real inner product space, by defining:

${\displaystyle \cos \theta _{xy}={\frac {\langle x,y\rangle }{\|x\|\|y\|}}.}$

The Cauchy–Schwarz inequality proves that this definition is sensible, by showing that the right-hand side lies in the interval [−1, 1], and justifies the notion that (real) Hilbert spaces are simply generalizations of the Euclidean space.

It can also be used to define an angle in complex inner product spaces, by taking the absolute value of the right-hand side, as is done when extracting a metric from quantum fidelity.

The Cauchy–Schwarz is used to prove that the inner product is a continuous function with respect to the topology induced by the inner product itself.

The Cauchy–Schwarz inequality is usually used to show Bessel's inequality.

### Probability theory

Let X, Y be random variables, then:

${\displaystyle {\text{Var}}\left(Y\right)\geq {\frac {{\text{Cov}}\left(Y,X\right){\text{Cov}}\left(Y,X\right)}{{\text{Var}}\left(X\right)}}.}$

In fact we can define an inner product on the set of random variables using the expectation of their product:

${\displaystyle \langle X,Y\rangle \triangleq \operatorname {E} (XY),}$

and so, by the Cauchy–Schwarz inequality,

${\displaystyle |\operatorname {E} (XY)|^{2}\leq \operatorname {E} (X^{2})\operatorname {E} (Y^{2}).}$

Moreover, if μ = E(X) and ν = E(Y), then

{\displaystyle {\begin{aligned}|\operatorname {Cov} (X,Y)|^{2}&=|\operatorname {E} ((X-\mu )(Y-\nu ))|^{2}\\&=|\langle X-\mu ,Y-\nu \rangle |^{2}\\&\leq \langle X-\mu ,X-\mu \rangle \langle Y-\nu ,Y-\nu \rangle \\&=\operatorname {E} ((X-\mu )^{2})\operatorname {E} ((Y-\nu )^{2})\\&=\operatorname {Var} (X)\operatorname {Var} (Y),\end{aligned}}}

where Var denotes variance and Cov denotes covariance.

## Generalizations

Various generalizations of the Cauchy–Schwarz inequality exist in the context of operator theory, e.g. for operator-convex functions, and operator algebras, where the domain and/or range of φ are replaced by a C*-algebra or W*-algebra.

This section lists a few of such inequalities from the operator algebra setting, to give a flavor of results of this type.

### Positive functionals on C*- and W*-algebras

One can discuss inner products as positive functionals. Given a Hilbert space L2(m), m being a finite measure, the inner product < · , · > gives rise to a positive functional φ by

${\displaystyle \phi (g)=\langle g,1\rangle .}$

Since < ff > ≥ 0, φ(f*f) ≥ 0 for all f in L2(m), where f* is pointwise conjugate of f. So φ is positive. Conversely every positive functional φ gives a corresponding inner product < fg >φ = φ(g*f). In this language, the Cauchy–Schwarz inequality becomes

${\displaystyle |\phi (g^{*}f)|^{2}\leq \phi (f^{*}f)\phi (g^{*}g),}$

which extends verbatim to positive functionals on C*-algebras.

We now give an operator theoretic proof for the Cauchy–Schwarz inequality which passes to the C*-algebra setting. One can see from the proof that the Cauchy–Schwarz inequality is a consequence of the positivity and anti-symmetry inner-product axioms.

Consider the positive matrix

${\displaystyle M={\begin{bmatrix}f^{*}\\g^{*}\end{bmatrix}}{\begin{bmatrix}f&g\end{bmatrix}}={\begin{bmatrix}f^{*}f&f^{*}g\\g^{*}f&g^{*}g\end{bmatrix}}.}$

Since φ is a positive linear map whose range, the complex numbers C, is a commutative C*-algebra, φ is completely positive. Therefore

${\displaystyle M'=(I_{2}\otimes \phi )(M)={\begin{bmatrix}\phi (f^{*}f)&\phi (f^{*}g)\\\phi (g^{*}f)&\phi (g^{*}g)\end{bmatrix}}}$

is a positive 2 × 2 scalar matrix, which implies it has positive determinant:

${\displaystyle \phi \left(f^{*}f\right)\phi \left(g^{*}g\right)-\left|\phi \left(g^{*}f\right)\right|^{2}\geq 0\quad {\text{i.e.}}\quad \phi \left(f^{*}f\right)\left(g^{*}g\right)\geq \left|\phi \left(g^{*}f\right)\right|^{2}.}$

This is precisely the Cauchy–Schwarz inequality. If f and g are elements of a C*-algebra, f* and g* denote their respective adjoints.

We can also deduce from above that every positive linear functional is bounded, corresponding to the fact that the inner product is jointly continuous.

### Positive maps

Positive functionals are special cases of positive maps. A linear map Φ between C*-algebras is said to be a positive map if a ≥ 0 implies Φ(a) ≥ 0. It is natural to ask whether inequalities of Schwarz-type exist for positive maps. In this more general setting, usually additional assumptions are needed to obtain such results.

The following theorem is named after Richard Kadison.

This extends the fact ${\displaystyle \varphi (a^{*}a)\cdot 1\geq \varphi (a)^{*}\varphi (a)=|\varphi (a)|^{2}}$, when ${\displaystyle \varphi }$ is a linear functional.

The case when ${\displaystyle a}$ is self-adjoint, i.e. ${\displaystyle a=a^{*}}$, is sometimes known as Kadison's inequality.

#### 2-positive maps

When Φ is 2-positive, a stronger assumption than merely positive, one has something that looks very similar to the original Cauchy–Schwarz inequality:

Theorem (Modified Schwarz inequality for 2-positive maps).[3] For a 2-positive map Φ between C*-algebras, for all a, b in its domain,

${\displaystyle \Phi (a)^{*}\Phi (a)\leq \Vert \Phi (1)\Vert \Phi (a^{*}a)}$
${\displaystyle \Vert \Phi (a^{*}b)\Vert ^{2}\leq \Vert \Phi (a^{*}a)\Vert \cdot \Vert \Phi (b^{*}b)\Vert .}$

A simple argument for (2) is as follows. Consider the positive matrix

${\displaystyle M={\begin{bmatrix}a^{*}&0\\b^{*}&0\end{bmatrix}}{\begin{bmatrix}a&b\\0&0\end{bmatrix}}={\begin{bmatrix}a^{*}a&a^{*}b\\b^{*}a&b^{*}b\end{bmatrix}}.}$

By 2-positivity of Φ,

${\displaystyle (I_{2}\otimes \Phi )M={\begin{bmatrix}\Phi (a^{*}a)&\Phi (a^{*}b)\\\Phi (b^{*}a)&\Phi (b^{*}b)\end{bmatrix}}}$

is positive. The desired inequality then follows from the properties of positive 2 × 2 (operator) matrices.

Part (1) is analogous. One can replace the matrix ${\displaystyle {\begin{bmatrix}a&b\\0&0\end{bmatrix}}}$ by ${\displaystyle {\begin{bmatrix}1&a\\0&0\end{bmatrix}}.}$

## Reforming Cauchy-Schwarz Inequality for cross product

Theorem. Let u and v be non-zero vectors, then:

${\displaystyle \|\mathbf {v} \times \mathbf {u} \|\leq \|\mathbf {v} \|\cdot \|\mathbf {u} \|.}$

To prove this inequality we first write the outer product magnitude as

${\displaystyle \|\mathbf {v} \times \mathbf {u} \|=\|\mathbf {v} \|\cdot \|\mathbf {u} \|\cdot |\sin(\mathbf {v} ,\mathbf {u} )|}$

Dividing both sides by the product of the magnitudes we arrive at:

${\displaystyle {\frac {\|\mathbf {v} \times \mathbf {u} \|}{\|\mathbf {v} \|\cdot \|\mathbf {u} \|}}=|\sin(\mathbf {v} ,\mathbf {u} )|\leq 1.}$

The last line follows from the fact that ${\displaystyle \sin {(\mathbf {v} ,\mathbf {u} )}\in [-1,1].}$

## Physics

The general formulation of the Heisenberg uncertainty principle is derived using the Cauchy–Schwarz inequality.

## Notes

1. {{#invoke:citation/CS1|citation |CitationClass=book }}
2. {{#invoke:citation/CS1|citation |CitationClass=citation }} page 40.

## References

• {{#invoke:citation/CS1|citation

|CitationClass=citation }}

• {{#invoke:citation/CS1|citation

|CitationClass=citation }}

• {{#invoke:citation/CS1|citation

|CitationClass=citation }}

• {{#invoke:citation/CS1|citation

|CitationClass=citation }}

• {{#invoke:citation/CS1|citation

|CitationClass=citation }}.

• {{#invoke:citation/CS1|citation

|CitationClass=citation }}

• {{#invoke:citation/CS1|citation

|CitationClass=citation }}.

• {{#invoke:citation/CS1|citation

|CitationClass=citation }}

• {{#invoke:citation/CS1|citation

|CitationClass=citation }}

• {{#invoke:citation/CS1|citation

|CitationClass=citation }} Template:Refend