/bio/skills/blog/math

Ça se prononce « Cauchy »

Proof of the Cauchy-Schwarz Inequality: xyxy|\mathbb{x} \cdot \mathbb{y}| \leq |\mathbb{x}| |\mathbb{y}|

Proof

We will prove this by induction.

Base case R2\mathbb{R}^2

Let x \mathbb{x}, yR2\mathbb{y} \in \mathbb{R}^2 be (x1,x2)(x_1, x_2) and (y1,y2)(y_1, y_2) respectively.

Start with xy|\mathbb{x} \cdot \mathbb{y}| and note that:

xy2=x12y12+2x1x2y1y2+x22y22(x12y12+2x1x2y1y2+x22y22)+(x1y2x2y1)2=x12y12+x12y22+x12y22+x22y22=(x12+x22)(y12+y22)=(xy)2\begin{align} |\mathbb{x} \cdot \mathbb{y}|^2 &= x_1^2 y_1^2 + 2 x_1 x_2 y_1 y_2 + x_2^2 y_2^2 \\ &\leq (x_1^2 y_1^2 + 2 x_1 x_2 y_1 y_2 + x_2^2 y_2^2) + (x_1y_2 - x_2y_1)^2 \\ &= x_1^2 y_1^2 + x_1^2 y_2^2 + x_1^2 y_2^2 + x_2^2 y_2^2 \\ &= (x_1^2 + x_2^2)(y_1^2+ y_2^2) \\ &= (|x||y|)^2 \end{align}

Since both xy|\mathbb{x} \cdot \mathbb{y}| and xy|x||y| are positive and the square root is an increasing function, we have:

xyxy|\mathbb{x} \cdot \mathbb{y}| \leq |x||y|

which proves the base case.

Induction Step:

Let x \mathbb{x}, yRn\mathbb{y} \in \mathbb{R}^n be (x1,,xn)(x_1, \dots, x_n) and (y1,,yn)(y_1, \dots, y_n) respectively.

Assume xyxy|\mathbb{x} \cdot \mathbb{y}| \leq |\mathbb{x}||\mathbb{y}|. We will then show that this also works for x \mathbb{x'}, yRn+1\mathbb{y'} \in \mathbb{R}^{n+1}, where (x1,,xn,xn+1)(x_1, \dots, x_n, x_{n+1}) and (y1,,yn,yn+1)(y_1, \dots, y_n, y_{n+1}) respectively

By our assumption:

xyxy(xy)2xxyy(x1y1+xnyn)2x12++xn2y12++yn2\begin{align} |\mathbb{x} \cdot \mathbb{y}| &\leq |x||y| \\ \sqrt{(\mathbb{x} \cdot \mathbb{y})^2} &\leq \sqrt{\mathbb{x} \cdot \mathbb{x}} \sqrt{\mathbb{y} \cdot \mathbb{y}} \\ \sqrt{(x_1y_1 + \dots x_ny_n)^2} &\leq \sqrt{x_1^2 + \dots + x_n^2} \sqrt{y_1^2 + \dots + y_n^2} \\ \end{align}

Consider xy2|\mathbb{x'} \cdot \mathbb{y'}|^2:

=(xy)22=(xy)2=(x1y1+xnyn+xn+1yn+1)2=(xy+xn+1yn+1)2=(xy)2+2xn+1yn+1(xy)+(xn+1yn+1)2\begin{align*} &= \sqrt{(\mathbb{x'} \cdot \mathbb{y'})^2}^2\\ &= (\mathbb{x'} \cdot \mathbb{y'})^2\\ &= (x_1y_1 + \dots x_ny_n +x_{n+1}y_{n+1})^2 \\ &= (\mathbb{x} \cdot \mathbb{y} +x_{n+1}y_{n+1})^2 \\ &= (\mathbb{x} \cdot \mathbb{y})^2 + 2x_{n+1}y_{n+1}(\mathbb{x} \cdot \mathbb{y}) + (x_{n+1}y_{n+1})^2 \end{align*}

And (xy)2(|\mathbb{x'}||\mathbb{y'}|)^2:

=(xxyy)2=(xx)(yy)=(x12++xn2+xn+12)(y12++yn2+yn+12)=(xx+xn+12)(yy+yn+12)=(xx)(yy)+yn+12(xx)+xn+12(yy)+xn+12yn+12\begin{align*} &= (\sqrt{\mathbb{x'} \cdot \mathbb{x'}} \sqrt{\mathbb{y'} \cdot \mathbb{y'}})^2 \\ &= (\mathbb{x'} \cdot \mathbb{x'})(\mathbb{y'} \cdot \mathbb{y'}) \\ &=(x_1^2 + \dots + x_n^2 + x_{n+1}^2)(y_1^2 + \dots + y_n^2 + y_{n+1}^2) \\ &= (\mathbb{x} \cdot \mathbb{x} + x_{n+1}^2)(\mathbb{y} \cdot \mathbb{y} + y_{n+1}^2) \\ &= (\mathbb{x} \cdot \mathbb{x})(\mathbb{y} \cdot \mathbb{y}) + y_{n+1}^2(\mathbb{x} \cdot \mathbb{x}) + x_{n+1}^2(\mathbb{y} \cdot \mathbb{y}) + x_{n+1}^2y_{n+1}^2 \end{align*}

Note that:

xy2xy2+(yn+1xxn+1y)2=xy2+yn+12(xx)2xn+1yn+1(xy)+xn+12(yy)=(xy)2+2xn+1yn+1(xy)+(xn+1yn+1)2+yn+12(xx)2xn+1yn+1(xy)+xn+12(yy)=(xy)2+(xn+1yn+1)2+yn+12(xx)+xn+12(yy)=(xx)(yy)+yn+12(xx)+xn+12(yy)+xn+12yn+12=(xy)2\begin{align*} |\mathbb{x'} \cdot \mathbb{y'}|^2 &\leq |\mathbb{x'} \cdot \mathbb{y'}|^2 + |(y_{n+1}\mathbb{x} - x_{n+1}\mathbb{y})|^2 \\ & = |\mathbb{x'} \cdot \mathbb{y'}|^2 + y_{n+1}^2(\mathbb{x} \cdot \mathbb{x}) -2x_{n+1}y_{n+1}(\mathbb{x} \cdot \mathbb{y}) + x_{n+1}^2(\mathbb{y} \cdot \mathbb{y}) \\ & = (\mathbb{x} \cdot \mathbb{y})^2 + 2x_{n+1}y_{n+1} (\mathbb{x} \cdot \mathbb{y})+ (x_{n+1}y_{n+1})^2 + y_{n+1}^2(\mathbb{x} \cdot \mathbb{x}) -2x_{n+1}y_{n+1}(\mathbb{x} \cdot \mathbb{y}) + x_{n+1}^2(\mathbb{y} \cdot \mathbb{y}) \\ &= (\mathbb{x} \cdot \mathbb{y})^2 + (x_{n+1}y_{n+1})^2 + y_{n+1}^2(\mathbb{x} \cdot \mathbb{x}) + x_{n+1}^2(\mathbb{y} \cdot \mathbb{y}) \\ &= (\mathbb{x} \cdot \mathbb{x})(\mathbb{y} \cdot \mathbb{y}) + y_{n+1}^2(\mathbb{x} \cdot \mathbb{x}) + x_{n+1}^2(\mathbb{y} \cdot \mathbb{y}) + x_{n+1}^2y_{n+1}^2 \\ &= (|\mathbb{x'}||\mathbb{y'}|)^2 \end{align*}

But since the sqaure root is an increasing function and both xy|\mathbb{x'} \cdot \mathbb{y'}| and xy|\mathbb{x'}||\mathbb{y'}| are positive, xy2(xy)2|\mathbb{x'} \cdot \mathbb{y'}|^2 \leq (|\mathbb{x'}||\mathbb{y'}|)^2 means that xyxy|\mathbb{x'} \cdot \mathbb{y'}| \leq |\mathbb{x'}||\mathbb{y'}|

So we have shown that if we assume xyxy|\mathbb{x} \cdot \mathbb{y}| \leq |\mathbb{x}||\mathbb{y}| for x,yRn\mathbb{x}, \mathbb{y} \in \mathbb{R}^n then xyxy|\mathbb{x'} \cdot \mathbb{y'}| \leq |\mathbb{x'}||\mathbb{y'}| for x,yRn+1\mathbb{x'}, \mathbb{y'} \in \mathbb{R}^{n+1} as desired.

By induction, our proof is finished.

2025 Stefano De Vuono