RTP: $${\displaystyle |\langle \mathbf {u} ,\mathbf {v} \rangle |\leq \|\mathbf {u} \|\|\mathbf {v} \|.}$$
I know there are many ways to prove the Cauchy-Schwarz inequality, however most proofs that I've been looking at start with $$({a\vec{x}-b\vec{y}})^2$$, where a,b ∈ℝ and x,y ∈ . The rest of the proof is quite easy to follow once the values for a and b are chosen, my question is why did we start off with $$({a\vec{x}-b\vec{y}})^2$$, where did it come from, and what constitutes our choice for the coefficients a and b.
We start with $\|ax-by\|^2$ since it is a non-negative number, with the hope to derive the Cauchy-Schwarz inequality from a trivial inequality. For instance, by just picking $a$ and $b$ as $1$ we have $$0 \leq \|x-y\|^2 = \|x\|^2+\|y\|^2 -2\langle x,y\rangle \tag{1}$$ from which it follows that $$ \langle x,y\rangle \leq \frac{\|x\|^2+\|y\|^2}{2}\qquad\text{(trivial inequality)}.\tag{2}$$ Now we may exploit a symmetry: if we pick some $\lambda>0$ and replace $x$ by $\lambda x$ and $y$ by $\frac{1}{\lambda}y$ the LHS of $(2)$ is unchanged. In particular $$ \forall \lambda>0,\qquad\langle x,y\rangle \leq \frac{\lambda^2\|x\|^2+\frac{1}{\lambda^2}\|y\|^2}{2}\qquad\text{(less trivial inequality)}.\tag{3}$$ Given some $\|x\|,\|y\|>0$, we may pick $\lambda>0$ such that the RHS of $(3)$ is minimal.
By the AM-GM inequality the RHS of $(3)$ is $\geq\|x\|\|y\|$, but equality is attained if $\lambda=\sqrt{\frac{\|y\|}{\|x\|}}$. $$ \langle x,y\rangle \leq \|x\|\|y\| \tag{4} $$ Is the Cauchy-Schwarz inequality. By performing a backtracking in the outlined proof we have that equality holds iff $x,y$ are linearly dependent. We also have that $(4)$ holds for any positive definite inner product $\langle \cdot,\cdot\rangle$, where $\|x\|$ is defined through $\|x\|^2=\langle x,x\rangle$.