I have seen a proof of the fact that $$ \vec{a}\cdot \vec{b} = \lVert\vec{a} \rVert\lVert\vec{b} \rVert\cos(\theta) $$ where $\vec{a}$ and $\vec{b}$ are two vectors. The proof relies on the Law of Cosines. The proofs that I have seen of the Law of Cosines all rely on pictures (see for example this). So I was wondering if there is a purely algebraic proof of the above formula. This could be done by proving a purely algebraic proof of the Law of Cosines.
I am thinking that the reason for using pictures, is that cosine is often defined using pictures (triangles). But what if we take $$ \cos(x) = \sum_{n=0}^\infty \frac{(-1)^n x^{2n}}{(2n)!} $$ as the (algebraic) definition. Is there then a purely algehraic proof of the Law of Cosines or the formula above? If there is a nicer proof that relies on some other (algebraic) definition of $\cos(x)$, then I would be interested in seeing how that can be used as well.
Edit: From the comment below I see that this has to do with the definition of angle. So, I change by question: Is there a way to purely algebraically arrive at the above formula? I understand that this would involve choosing specific definitions. Can one, for example, prove the Law of Cosines, using $\vec{a}\cdot \vec{b} = \lVert\vec{a} \rVert\lVert\vec{b} \rVert\cos(\theta)$ as teh definition of the angle between two vectors?
Define $\cos\angle(a,b) = \dfrac{a ∙ b}{|a| \cdot |b|}$ for any nonzero Euclidean vectors $a,b$, and $0$ if either $a$ or $b$ is zero.
Then you want to prove $|a-b|^2 = |a|^2 + |b|^2 - 2 |a| \cdot |b| \cdot \cos\angle(a,b)$ for any Euclidean vectors $a,b$.
But it is obvious if $a$ or $b$ is zero, and otherwise it does immediately follow from the fact that $|v|^2 = v ∙ v$ for any Euclidean vector $v$.
In particular you have $|a-b|^2 = (a-b) ∙ (a-b) = a∙a - b∙a - a∙b + b∙b$ and this gives what you want quite immediately.