Let $\langle x,y\rangle=x\cdot y$ be the standard dot product on $\mathbb{R}^n$. By the Cauchy-Schwarz inequality, for $x,y$ non-zero, we have $$-1 \leq \frac{\langle x,y\rangle}{\|x\|\|y\|}\leq 1.$$
Thus there exists unique $\theta$ such that $\cos\theta$ is equal to the middle quantity in the above inequality. This $\theta$ is called as angle between $x$ and $y$.
However, while looking at proofs of Cauchy-Schwarz inequality, I came across one proof where it proceeds as follows:
since $\cos\theta=\frac{\langle x,y\rangle}{\|x\|\|y\|}$, taking modulus, we obtain $\left|\langle x,y\rangle\right|\leq \|x\|\|y\|$, which proves Cauchy-Schwarz inequality.
Question: Which of the two approaches is correct?
(1) Prove Cauchy-Schwarz inequality first and using it define angle between two vectors?
(2) Define angle between two (non-zero) vectors by $\cos\theta=\frac{\langle x,y\rangle}{\|x\|\|y\|}$ and use it to prove Cauchy-Schwarz inequality.
(2) is not correct. The definition of the angle between two vectors in $\mathbb R^n$ is based on the Cauchy-Schwarz. you just cannot use it to prove what it's based on.