A basic property of the dot product of two vectors is that
$$\frac{\vec{u}\cdot \vec{v}}{||\vec{u}||*||\vec{v}||} = \cos \theta $$
Where $\theta$ is the angle between the two vectors. Since there is obviously always an angle between two vectors, this means that the quotient of the dot product and the magnitudes of the two vectors will always be on the range of the cosine function:
$$-1 \leq \frac{\vec{u}\cdot \vec{v}}{||\vec{u}||*||\vec{v}||} \leq 1 $$
Square the quotient to make it non-negative and get the inequality
$$ \frac {(\vec{u}\cdot \vec{v})^2}{||\vec{u}||^2*||\vec{v}||^2} \leq 1$$
For the quotient to be less than one, the denominator must be greater than the numerator:
$$ ||\vec{u}||^2*||\vec{v}||^2 \geq (\vec{u}\cdot\vec{v})^2 $$
And rewrite using the property $\vec{u}\cdot\vec{u} = ||\vec{u}||^2$ :
$$ (\vec{u}\cdot\vec{u})*(\vec{v}\cdot\vec{v}) \geq (\vec{u}\cdot\vec{v})^2 $$
The above inequality is the claim I want to prove. Is there a way to show why the inequality holds for arbitrarily many dimensions, and using general vector operations instead of components?
I have found a way to show that the inequality holds for two-dimensional vectors using components, but it bugs me that I have to use components instead of more general vector notation and operations. And of course I want to be able to show it in more dimensions.
Proof:
Let $\vec{u} = <u_1, u_2>$ and $\vec{v} = <v_1, v_2>$ with real components. The inequality becomes
$$ (u_1^2+u_2^2)*(v_1^2+v_2^2) \geq (u_1v_1 + u_2v_2)^2 $$
Multiply it out.
$$ u_1^2v_1^2 + u_2^2v_2^2 + u_1^2v_2^2 + u_2^2v_1^2 \geq u_1^2v_1^2+u_2^2v_2^2 + 2u_1u_2v_1v_2 $$
Subtract the quantity $u_1^2v_1^2 + u_2^2v_2^2 $ from both sides.
$$ u_1^2v_2^2 + u_2^2v_1^2 \geq 2u_1u_2v_1v_2 $$
Observe that the right side can be rewritten
$$ (u_1v_2-u_2v_1)^2 + 2u_1u_2v_1v_2 \geq 2u_1u_2v_1v_2 $$
And subtract the long term
$$ (u_1v_2-u_2v_1)^2 \geq 0 $$
And the left side will be a non-negative number because it is squared and $x^2 \geq 0$ for all real numbers $x$. Since the components of the vectors are real, $u_1v_2- u_2v_1$ is real and the inequality holds for all real vectors $\vec{u}$ and $\vec{v}$.
This is called the Cauchy-Schwarz inequality.
If $\vec{v}$ or $\vec{w}$ is the zero vector, the result is trivial. So assume $\vec{v} \neq \vec{0}$ and $\vec{w} \neq \vec{0}$ Start by noting that $\langle v-w,v-w\rangle \geq 0 $. Expanding this out, we have: \begin{align*} \langle v,v \rangle - 2 \langle v,w \rangle +\langle w,w\rangle &\geq 0 \\ 2\langle v,w \rangle &\leq \langle v,v \rangle + \langle w,w\rangle \end{align*}
Now, if $\vec{v}$ and $\vec{w}$ are unit vectors, this says that
\begin{align*} 2\langle \vec{v}, \vec{w} \rangle &\leq 2 \\ \langle \vec{v},\vec{w}\rangle &\leq 1 \end{align*}
Now to prove the result for any pair of nonzero vectors, simply scale them to make them unit vectors:
\begin{align*} \langle \frac{1}{|\vec{v}|}\vec{v},\frac{1}{|\vec{w}|}\vec{w}\rangle &\leq 1\\ \langle v,w\rangle &\leq |v||w| \end{align*}
This proves one half of the inequality. Can you prove the other half?