The Cauchy–Schwarz inequality (also called Cauchy–Bunyakovsky–Schwarz inequality) is an upper bound on the absolute value of the inner product between two vectors in an inner product space in terms of the product of the vector norms. It is considered one of the most important and widely used inequalities in mathematics.
Inner products of vectors can describe finite sums (via finite-dimensional vector spaces), infinite series (via vectors in sequence spaces), and integrals (via vectors in Hilbert spaces). The inequality for sums was published by . The corresponding inequality for integrals was published by
Moreover, the two sides are equal if and only if <math>\mathbf{u}</math> and <math>\mathbf{v}</math> are linearly dependent.
Special cases
Sedrakyan's lemma – positive real numbers
Sedrakyan's inequality, also known as Bergström's inequality, Engel's form, Titu's lemma (or the T2 lemma), states that for real numbers <math>u_1, u_2, \dots, u_n</math> and positive real numbers <math>v_1, v_2, \dots, v_n</math>:
<math display=block>\frac{\left(u_1 + u_2 + \cdots + u_n\right)^2}{v_1 + v_2 + \cdots + v_n} \leq \frac{u^2_1}{v_1} + \frac{u^2_2}{v_2} + \cdots + \frac{u^2_n}{v_n},</math>
or, using summation notation,
<math display=block>
\dfrac{\left(\sum\limits_{i=1}^{n} u_i\right)^2}{\sum\limits_{i=1}^{n} v_i} \le \sum_{i=1}^n \frac{u_i^2}{v_i}. </math>
It is a direct consequence of the Cauchy–Schwarz inequality, obtained by using the dot product on <math>\R^n</math> upon substituting <math>u_i' = \frac{u_i}{\sqrt{v_i\vphantom{t}</math> and <math>v_i' = {\textstyle \sqrt{v_i\vphantom{t}</math>. This form is especially helpful when the inequality involves fractions where the numerator is a perfect square.
- The plane
thumb|<math>|\mathbf u \cdot \mathbf v| = \|\mathbf v\| \cdot (\|\mathbf u\| |\cos \theta|) \leq \|\mathbf u\| \cdot \|\mathbf v\|</math>
The real vector space <math>\R^2</math> denotes the 2-dimensional plane. It is also the 2-dimensional Euclidean space where the inner product is the dot product.
If <math>\mathbf{u} = (u_1, u_2)</math> and <math>\mathbf{v} = (v_1, v_2)</math> then the Cauchy–Schwarz inequality becomes:
<math display=block>\langle \mathbf{u}, \mathbf{v} \rangle^2 = \bigl(\|\mathbf{u}\| \|\mathbf{v}\| \cos \theta\bigr)^2 \leq \|\mathbf{u}\|^2 \|\mathbf{v}\|^2,</math>
where <math>\theta</math> is the angle between <math>\mathbf{u}</math> and <math>\mathbf{v}</math>.
The form presented here is perhaps the easiest in which to understand the inequality, as the square of the cosine can be at most 1, which occurs when the vectors are in the same or opposite directions. It can also be restated in terms of the vector coordinates <math>u_1</math>, <math>u_2</math>, <math>v_1</math>, and <math>v_2</math> as
<math display=block>\left(u_1 v_1 + u_2 v_2\right)^2 \leq \left(u_1^2 + u_2^2\right) \left(v_1^2 + v_2^2\right),</math>
where equality holds if and only if the vector <math>\left(u_1, u_2\right)</math> is in the same or opposite direction as the vector <math>\left(v_1, v_2\right)</math>, or if one of them is the zero vector.
: n-dimensional Euclidean space
In Euclidean space <math>\R^n</math> with the standard inner product, which is the dot product, the Cauchy–Schwarz inequality becomes:
<math display=block>\biggl(\sum_{i=1}^n u_i v_i\biggr)^2 \leq \biggl(\sum_{i=1}^n u_i^2\biggr) \biggl(\sum_{i=1}^n v_i^2\biggr).</math>
The Cauchy–Schwarz inequality can be proved using only elementary algebra in this case by observing that the difference of the right and the left hand side is
<math display=block> \tfrac{1}{2} \sum_{i=1}^n\sum_{j=1}^n (u_i v_j - u_j v_i)^2 \ge 0</math>
or by considering the following quadratic polynomial in <math>x</math>
<math display=block> (u_1 x + v_1)^2 + \cdots + (u_n x + v_n)^2 = \biggl(\sum_i u_i^2\biggr) x^2 + 2 \biggl(\sum_i u_i v_i\biggr) x + \sum_i v_i^2.</math>
Since the latter polynomial is nonnegative, it has at most one real root, hence its discriminant is less than or equal to zero. That is,
<math display=block>\biggl(\sum_i u_i v_i\biggr)^2 - \biggl(\sum_i {u_i^2}\biggr) \biggl(\sum_i {v_i^2}\biggr) \leq 0.</math>
: n-dimensional complex space
If <math>\mathbf{u}, \mathbf{v} \in \Complex^n</math> with <math>\mathbf{u} = (u_1, \ldots, u_n)</math> and <math>\mathbf{v} = (v_1, \ldots, v_n)</math> (where <math>u_1, \ldots, u_n \in \Complex</math> and <math>v_1, \ldots, v_n \in \Complex</math>) and if the inner product on the vector space <math>\Complex^n</math> is the canonical complex inner product (defined by <math>\langle \mathbf{u}, \mathbf{v} \rangle := u_1 \overline{v_1} + \cdots + u_{n} \overline{v_n},</math> where the bar notation is used for complex conjugation), then the inequality may be restated more explicitly as follows:
<math display=block>\bigl|\langle \mathbf{u}, \mathbf{v} \rangle\bigr|^2
= \Biggl|\sum_{k=1}^n u_k\bar{v}_k\Biggr|^2
\leq \langle \mathbf{u}, \mathbf{u} \rangle \langle \mathbf{v}, \mathbf{v} \rangle
= \biggl(\sum_{k=1}^n u_k \bar{u}_k\biggr) \biggl(\sum_{k=1}^n v_k \bar{v}_k\biggr)
= \sum_{j=1}^n |u_j|^2 \sum_{k=1}^n |v_k|^2.</math>
That is,
<math display=block>\bigl|u_1 \bar{v}_1 + \cdots + u_n \bar{v}_n\bigr|^2 \leq \bigl(|u_1|{}^2 + \cdots + |u_n|{}^2\bigr) \bigl(|v_1|{}^2 + \cdots + |v_n|{}^2\bigr).</math>
For the inner product space of square-integrable complex-valued functions, the following inequality holds.
<math display=block>\left|\int_{\R^n} f(x) \overline{g(x)}\,dx\right|^2 \leq \int_{\R^n} \bigl|f(x)\bigr|^2\,dx \int_{\R^n} \bigl|g(x)\bigr|^2 \,dx.</math>
The Hölder inequality is a generalization of this.
Applications
Analysis
In any inner product space, the triangle inequality is a consequence of the Cauchy–Schwarz inequality, as is now shown:
<math display="block">\begin{alignat}{4}
\|\mathbf{u} + \mathbf{v}\|^2
&= \langle \mathbf{u} + \mathbf{v}, \mathbf{u} + \mathbf{v} \rangle && \\
&= \|\mathbf{u}\|^2 + \langle \mathbf{u}, \mathbf{v} \rangle + \langle \mathbf{v}, \mathbf{u} \rangle + \|\mathbf{v}\|^2 ~ && ~ \text{ where } \langle \mathbf{v}, \mathbf{u} \rangle = \overline{\langle \mathbf{u}, \mathbf{v} \rangle} \\
&= \|\mathbf{u}\|^2 + 2 \operatorname{Re} \langle \mathbf{u}, \mathbf{v} \rangle + \|\mathbf{v}\|^2 && \\
&\leq \|\mathbf{u}\|^2 + 2|\langle \mathbf{u}, \mathbf{v} \rangle| + \|\mathbf{v}\|^2 && \\
&\leq \|\mathbf{u}\|^2 + 2\|\mathbf{u}\|\|\mathbf{v}\| + \|\mathbf{v}\|^2 ~ && ~ \text{ using CS}\\
&=\bigl(\|\mathbf{u}\| + \|\mathbf{v}\|\bigr)^2. &&
\end{alignat}</math>
Taking square roots gives the triangle inequality:
<math display=block>\|\mathbf{u} + \mathbf{v}\| \leq \|\mathbf{u}\| + \|\mathbf{v}\|.</math>
The Cauchy–Schwarz inequality is used to prove that the inner product is a continuous function with respect to the topology induced by the inner product itself.
Geometry
The Cauchy–Schwarz inequality allows one to extend the notion of "angle between two vectors" to any real inner-product space by defining:
<math display=block>\cos\theta_{\mathbf{u} \mathbf{v = \frac{\langle \mathbf{u}, \mathbf{v} \rangle}{\|\mathbf{u}\| \|\mathbf{v}\|}.</math>
The Cauchy–Schwarz inequality proves that this definition is sensible, by showing that the right-hand side lies in the interval 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 or the real part of the right-hand side, as is done when extracting a metric from quantum fidelity.
Linear algebra
The Cauchy-Schwarz inequality can be used to prove the spectral theorem for self-adjoint operators in the finite-dimensional case.
Let <math>A</math> be a self-adjoint operator on a finite-dimensional inner product space and <math>\mathbf{u}</math> be a non-zero vector which maximizes <math>\frac{\|A\mathbf{u}\|}{\|\mathbf{u}\|}</math>. The existence of <math>\mathbf{u}</math> is guaranteed by the Heine-Borel theorem. If <math>A\mathbf{u}=\mathbf{0}</math> then <math>\mathbf{u}</math> is an eigenvector of <math>A</math>. Otherwise the maximizing property of <math>\mathbf{u}</math> implies that
<math display=block>\frac{\|A\mathbf{u}\|}{\|\mathbf{u}\|} \geq \frac{\|A(A\mathbf{u})\|}{\|A\mathbf{u}\|}.</math> In the other direction, the Cauchy-Schwarz inequality implies that
<math display=block>\|A\mathbf{u}\|^2 = \langle A\mathbf{u}, A\mathbf{u} \rangle = \langle \mathbf{u}, A^2\mathbf{u} \rangle \leq \|\mathbf{u}\| \|A^2\mathbf{u}\|,</math> hence equality holds. By the characterization of equality, <math>\mathbf{u}</math> and <math>A^2\mathbf{u}</math> are linearly dependent, therefore <math>\mathbf{u}</math> is an eigenvector of <math>A^2</math>. From here it is straightforward to deduce that <math>A</math> has an eigenvector, then the spectral theorem follows by taking the orthogonal complement and arguing by induction on the dimension of the inner product space.
Probability theory
<!-- For the multivariate case,
<math display=block>\operatorname{Var}(Y) \geq \operatorname{Cov} (Y, X) \operatorname{Var}^{-1}(X) \operatorname{Cov}(X, Y)</math>
This inequality means that the difference is semidefinite positive. -->
Let <math>X</math> and <math>Y</math> be random variables. Then the covariance inequality is given by:
<math display=block>\operatorname{Var}(X) \geq \frac{\operatorname{Cov}(X, Y)^2}{\operatorname{Var}(Y)}.</math>
After defining an inner product on the set of random variables using the expectation of their product,
<math display=block>\langle X, Y \rangle := \operatorname{E}(X Y),</math>
the Cauchy–Schwarz inequality becomes
<math display=block>\bigl|\operatorname{E}(XY)\bigr|^2 \leq \operatorname{E}(X^2) \operatorname{E}(Y^2).</math>
To prove the covariance inequality using the Cauchy–Schwarz inequality, let <math>\mu = \operatorname{E}(X)</math> and <math>\nu = \operatorname{E}(Y),</math> then
<math display=block>\begin{align}
\bigl|\operatorname{Cov}(X, Y)\bigr|^2
&= \bigl|\operatorname{E}((X - \mu)(Y - \nu))\bigr|^2 \\
&= \bigl|\langle X - \mu, Y - \nu \rangle \bigr|^2\\
&\leq \langle X - \mu, X - \mu \rangle \langle Y - \nu, Y - \nu \rangle \\
& = \operatorname{E}\left((X - \mu)^2\right) \operatorname{E}\left((Y - \nu)^2\right) \\
& = \operatorname{Var}(X) \operatorname{Var}(Y),
\end{align}</math>
where <math>\operatorname{Var}</math> denotes variance and <math>\operatorname{Cov}</math> denotes covariance.
Graph Theory
In extremal graph theory, the Cauchy-Schwarz inequality is used to prove Mantel's theorem, which states that the number of edges in a triangle-free graph on <math>n</math> vertices is bounded above by <math>\lfloor \frac{n^2}{4} \rfloor</math> edges.
Consider any two adjacent vertices <math>x</math> and <math>y</math> in the graph with degrees <math> d(x)
</math> and <math> d(y)
</math> respectively. Since the graph is triangle-free, the neighbourhoods of <math>x</math> and <math>y</math> are disjoint, which gives <math>d(x) + d(y) \leq n</math>. Summing this inequality over all the vertices gives the following.
<math>\sum_{xy \in E(G)} (d(x) + d(y)) \leq \sum_{xy \in E(G)} n</math>
We then sum over vertices instead of edges.
<math>\sum_{x \in V(G)} d(x)^2 \leq n |E|</math>
Applying the Cauchy-Schwarz inequality gives the following inequality relating the sum of squares of degrees to the sum of degrees.
<math>( \sum_{x \in V(G)} d(x) )^2
\leq n ( \sum_{x \in V(G)} d(x)^2 ) </math>
Chaining the previous two inequalities, we get:
<math> ( \sum_{x \in V(G)} d(x) )^2 \leq n^2 |E|
</math>
And then by applying the handshaking lemma and then rearranging, we have that:
<math> |E| \leq \frac{n^2}{4}
</math>
Proofs
There are many different proofs of the Cauchy–Schwarz inequality other than those given below.
This section gives two proofs of the following theorem:
In both of the proofs given below, the proof in the trivial case where at least one of the vectors is zero (or equivalently, in the case where <math>\|\mathbf{u}\|\|\mathbf{v}\|= 0</math>) is the same. It is presented immediately below only once to reduce repetition. It also includes the easy part of the proof of the Equality Characterization given above; that is, it proves that if <math>\mathbf{u}</math> and <math>\mathbf{v}</math> are linearly dependent then <math>\bigl|\langle \mathbf{u}, \mathbf{v} \rangle\bigr| = \|\mathbf{u}\| \|\mathbf{v}\|.</math>
<!-- Note to Editors:
Anyone reading this part of the proof is very likely to be new to this subject, which is why this proof is much more detailed than the proofs given elsewhere in this article.
-->
By definition, <math>\mathbf{u}</math> and <math>\mathbf{v}</math> are linearly dependent if and only if one is a scalar multiple of the other.
If <math>\mathbf{u} = c \mathbf{v}</math> where <math>c</math> is some scalar then
<math display=block>|\langle \mathbf{u}, \mathbf{v} \rangle|
= |\langle c \mathbf{v}, \mathbf{v} \rangle|
= |c \langle \mathbf{v}, \mathbf{v} \rangle|
= |c|\|\mathbf{v}\| \|\mathbf{v}\|
=\|c \mathbf{v}\| \|\mathbf{v}\|
=\|\mathbf{u}\| \|\mathbf{v}\|</math>
which shows that equality holds in the .
The case where <math>\mathbf{v} = c \mathbf{u}</math> for some scalar <math>c</math> follows from the previous case:
<math display=block>|\langle \mathbf{u}, \mathbf{v} \rangle|
= |\langle \mathbf{v}, \mathbf{u} \rangle|
=\|\mathbf{v}\| \|\mathbf{u}\|.</math>
In particular, if at least one of <math>\mathbf{u}</math> and <math>\mathbf{v}</math> is the zero vector then <math>\mathbf{u}</math> and <math>\mathbf{v}</math> are necessarily linearly dependent (for example, if <math>\mathbf{u} = \mathbf{0}</math> then <math>\mathbf{u} = c \mathbf{v}</math> where <math>c = 0</math>), so the above computation shows that the Cauchy–Schwarz inequality holds in this case.
Consequently, the Cauchy–Schwarz inequality only needs to be proven only for non-zero vectors and also only the non-trivial direction of the Equality Characterization must be shown.
Proof via the orthogonal projection
The special case of <math>\mathbf{v} = \mathbf{0}</math> was proven above so it is henceforth assumed that <math>\mathbf{v} \neq \mathbf{0}.</math>
thumb|Cauchy-Schwarz inequality as a consequence of [[Pythagorean theorem]]
Let
<math display="block">\mathbf{z} := \mathbf{u} - \frac {\langle \mathbf{u}, \mathbf{v} \rangle} {\langle \mathbf{v}, \mathbf{v} \rangle} \mathbf{v}.</math>If we look at its length, we will see<math display="block">\begin{align}
\|\mathbf z\|^2 &= \left\langle\mathbf{u} - \frac {\langle \mathbf{u}, \mathbf{v} \rangle} {\langle \mathbf{v}, \mathbf{v} \rangle} \mathbf{v}, \mathbf{u} - \frac {\langle \mathbf{u}, \mathbf{v} \rangle} {\langle \mathbf{v}, \mathbf{v} \rangle} \mathbf{v}\right\rangle \\
&= \langle \mathbf u, \mathbf u\rangle - 2 \frac{\langle \mathbf u, \mathbf v\rangle}{\langle \mathbf v, \mathbf v\rangle}\langle \mathbf u, \mathbf v\rangle + \frac{\langle \mathbf u, \mathbf v\rangle^2}{\langle \mathbf v, \mathbf v\rangle^2} \langle \mathbf v, \mathbf v\rangle \\
&= \langle \mathbf u, \mathbf u\rangle - \frac{\langle \mathbf u, \mathbf v\rangle^2}{\langle \mathbf v, \mathbf v\rangle} = \|\mathbf u\|^2 - \frac{\langle \mathbf u, \mathbf v\rangle^2}{\|\mathbf v\|^2}
\end{align}</math>Since the length of any vector is always non-negative, we get<math display="block">\begin{align}
\|\mathbf u\|^2 - \frac{\langle \mathbf u, \mathbf v\rangle^2}{\|\mathbf v\|^2} = \|\mathbf z\|^2 \geq 0
\end{align}</math>The Cauchy–Schwarz inequality follows by multiplying by <math>\|\mathbf{v}\|^2</math> and then taking the square root.
Moreover, if the relation <math>\geq</math> in the above expression is actually an equality, then <math>\|\mathbf{z}\|^2 = 0</math> and hence <math>\mathbf{z} = \mathbf{0};</math> the definition of <math>\mathbf{z}</math> then establishes a relation of linear dependence between <math>\mathbf{u}</math> and <math>\mathbf{v}.</math> The converse was proved at the beginning of this section, so the proof is complete. <math>\blacksquare</math>
Proof by analyzing a quadratic
Consider an arbitrary pair of vectors <math>\mathbf{u}, \mathbf{v}</math>. Define the function <math>p : \R \to \R</math> defined by <math>p(t) = \langle t\alpha\mathbf{u} + \mathbf{v}, t\alpha\mathbf{u} + \mathbf{v}\rangle</math>, where <math>\alpha</math> is a complex number satisfying <math>|\alpha| = 1</math> and <math>\alpha\langle\mathbf{u}, \mathbf{v}\rangle = |\langle\mathbf{u}, \mathbf{v}\rangle|</math>.
Such an <math>\alpha</math> exists since if <math>\langle\mathbf{u}, \mathbf{v}\rangle = 0</math> then <math>\alpha</math> can be taken to be 1.
Since the inner product is positive-definite, <math>p(t)</math> only takes non-negative real values. On the other hand, <math>p(t)</math> can be expanded using the bilinearity of the inner product:
<math display=block>\begin{align}
p(t)
&= \langle t\alpha\mathbf{u}, t\alpha\mathbf{u}\rangle + \langle t\alpha\mathbf{u}, \mathbf{v}\rangle + \langle\mathbf{v}, t\alpha\mathbf{u}\rangle + \langle\mathbf{v}, \mathbf{v}\rangle \\
&= t\alpha t\overline{\alpha}\langle\mathbf{u}, \mathbf{u}\rangle + t\alpha\langle\mathbf{u}, \mathbf{v}\rangle + t\overline{\alpha}\langle \mathbf{v}, \mathbf{u}\rangle + \langle\mathbf{v}, \mathbf{v}\rangle \\
&= \lVert \mathbf{u} \rVert^2 t^2 + 2|\langle\mathbf{u}, \mathbf{v}\rangle|t + \lVert \mathbf{v} \rVert^2
\end{align}</math>
Thus, <math>p</math> is a polynomial of degree <math>2</math> (unless <math>\mathbf{u} = 0,</math> which is a case that was checked earlier). Since the sign of <math>p</math> does not change, the discriminant of this polynomial must be non-positive:
<math display=block>\Delta = 4 \bigl(\,|\langle \mathbf{u}, \mathbf{v} \rangle|^2 - \Vert \mathbf{u} \Vert^2 \Vert \mathbf{v} \Vert^2\bigr) \leq 0.</math>
The conclusion follows.
For the equality case, notice that <math>\Delta = 0</math> happens if and only if <math>p(t) = \bigl(t\Vert \mathbf{u} \Vert + \Vert \mathbf{v} \Vert\bigr)^2.</math> If <math>t_0 = -\Vert \mathbf{v} \Vert / \Vert \mathbf{u} \Vert,</math> then <math>p(t_0) = \langle t_0\alpha\mathbf{u} + \mathbf{v},t_0\alpha\mathbf{u} + \mathbf{v}\rangle = 0,</math> and hence <math>\mathbf{v} = -t_0\alpha\mathbf{u}.</math>
Generalizations
Various generalizations of the Cauchy–Schwarz inequality exist. Hölder's inequality generalizes it to <math>L^p</math> norms. More generally, it can be interpreted as a special case of the definition of the norm of a linear operator on a Banach space (Namely, when the space is a Hilbert space). Further generalizations are in the context of operator theory, e.g. for operator-convex functions and operator algebras, where the domain and/or range are replaced by a C*-algebra or W*-algebra.
An inner product can be used to define a positive linear functional. For example, given a Hilbert space <math>L^2(m), m</math> being a finite measure, the standard inner product gives rise to a positive functional <math>\varphi</math> by <math>\varphi (g) = \langle g, 1 \rangle.</math> Conversely, every positive linear functional <math>\varphi</math> on <math>L^2(m)</math> can be used to define an inner product <math>\langle f, g \rangle _\varphi := \varphi\left(g^* f\right),</math> where <math>g^*</math> is the pointwise complex conjugate of <math>g.</math> In this language, the Cauchy–Schwarz inequality becomes
<math display=block>\bigl|\varphi(g^* f)\bigr|^2 \leq \varphi\left(f^* f\right) \varphi\left(g^* g\right),</math>
which extends verbatim to positive functionals on C*-algebras:
The next two theorems are further examples in operator algebra.
This extends the fact <math>\varphi\left(a^*a\right) \cdot 1 \geq \varphi(a)^* \varphi(a) = |\varphi(a)|^2,</math> when <math>\varphi</math> is a linear functional. The case when <math>a</math> is self-adjoint, that is, <math>a = a^*,</math> is sometimes known as Kadison's inequality.
Another generalization is a refinement obtained by interpolating between both sides of the Cauchy–Schwarz inequality:
This theorem can be deduced from Hölder's inequality. There are also non-commutative versions for operators and tensor products of matrices.
Several matrix versions of the Cauchy–Schwarz inequality and Kantorovich inequality are applied to linear regression models.
See also
Citations
References
- <!-- -->
- .
- .
External links
- Earliest Uses: The entry on the Cauchy–Schwarz inequality has some historical information.
- Example of application of Cauchy–Schwarz inequality to determine Linearly Independent Vectors Tutorial and Interactive program.
