# Proof of Cauchy-Schwarz inequality - Why select s so that so that $||x-sy||$ would be minimized?

I was looking at a number of different proofs of the cauchy schwarz inequality in an inner product space ($\mathbb{R}^n$ or $\mathbb{C}^n$).

All of them used the idea of $||x-sy||$ where $s$ was selected in particular fashion which in the real case, s would be the value that minimized the function $f(s) = ||x-sy||$

The thing I am confused on is that the books say "s was selected so that $||x-sy||$ would be minimized". I don't understand how beforehand minimizing $||x-sy||$ would be known to be relevant to the inequality.

What is the inuitive link between the minimum of $f(s) = ||x-sy||$ and the Cauchy Schwarz inequality?

-
Perhaps you could give the proof, the proof I know does not mention minimality. –  Rudy the Reindeer Sep 25 '12 at 20:32
The proof doesn't really use the minimality, only the fact that the proper choice of $s$ results in the desired conclusion. –  Stefan Smith Sep 27 '12 at 0:19

You want to bound $x \cdot y$ in terms of $x \cdot x$ and $y \cdot y$. The only inequality you know about $\cdot$ is that $z \cdot z \ge 0$ for all $z$. So it is reasonable to look at $z \cdot z$ where $z$ is a linear combination of $x$ and $y$, say $z = r x + s y$. By homogeneity, we might as well take $r = 1$. Now expand: $$0 \le (x + s y) \cdot (x + s y) = x \cdot x + 2 s x \cdot y + s^2 y \cdot y$$ For this to give us an upper bound on $x \cdot y$, we need $s$ to be negative. For convenience, write $s = -t$. Thus for all $t > 0$, $$x \cdot y \le \frac{x \cdot x + t^2 y \cdot y}{2 t}$$ Each positive number $t$ gives us an upper bound on $x \cdot y$. We want the best possible upper bound, so we minimize the right side.

-
In this proof we assume that the dot product of x and y is positive? –  Mike Oct 1 '12 at 21:35
If you take $t < 0$, you get a similar upper bound on $-(x \cdot y)$. –  Robert Israel Oct 3 '12 at 7:11

Intuitively perhaps the Cauchy-Schwarz theorem wants to say that there exists an angle $\gamma$ for any pair $x,y$ of vectors, such that $\langle x,y\rangle =|x|\cdot|y|\cdot \cos\gamma$.

Let $e$ denote the line $(x+sy)_{s\in\mathbb R}$, then minimalizing the norm among them means exactly orthogonal projection of the origo to $e$, making there a nice triangle with a right angle and with $\gamma$ and $\cos\gamma$.

-

The basic idea is that $\|x-sy\|\geq 0$ for all $s$, and, in particular, the minimizing $s$.

Let $s\in\mathbb{R}$, then expanding gives $\|x-sy\|^2=\|x\|^2+s^2\|y\|^2-2s\text{Re} \langle x,y\rangle$, which is a quadratic in $s$.

Note that the Cauchy-Schwarz inequality is trivially true if $y=0$, so assume $y\neq 0$. Then minimizing $\|x-sy\|^2$ with respect to $s$ gives $\hat{s}=\frac{\text{Re}\langle x,y\rangle}{\|y\|^2}$, and substituting this value into the above gives $\|x-\hat{s}y\|^2=\|x\|^2-\frac{(\text{Re}\langle x,y\rangle)^2}{\|y\|^2}\geq 0$, from which we obtain $|\text{Re}\langle x,y\rangle|\leq\|x\|\|y\|$.

To finish, note that if $\theta\in\mathbb{C}$ with $|\theta|=1$, we have $|\text{Re}\langle\theta x,y\rangle|\leq\|x\|\|y\|$, and we can choose $\theta$ such that $\text{Re}\langle\theta x,y\rangle=\langle x,y\rangle$, which gives the desired result.

However, the essence of the proof is that $\|x-sy\|\geq 0$ for all $s$.

-