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 $\lVert x-sy\rVert$ where $s$ was selected in particular fashion which in the real case, $s$ would be the value that minimized the function $f(s) = \lVert x-sy\rVert$
The thing I am confused on is that the books say "$s$ was selected so that $\lVert x-sy\rVert$ would be minimized". I don't understand how beforehand minimizing $\lVert x-sy\rVert$ would be known to be relevant to the inequality.
What is the intuitive link between the minimum of $f(s) = \lVert x-sy\rVert$ and the Cauchy-Schwarz inequality?