Table of Contents
1. Proof equivalence of algebraic and geometric definition of dot product
This is a quick proof on the equivalent definitions for the dot product. Just for me to test on how integrate org roam with latex tikz and sage plugins, I generate this HTML page with the Emacs function org-html-export-as-html(with minor edits),
1.1. Observation
Algebraic and geometric definitions of dot product are equivalent this is:
where
is the angle between x and y
1.1.1. Proof
We will proove it for the 2 dimention case, it can be easily extended to n dimention by embedding the 2 vectors in a plane…
Lets consider x and y as in the definition, notice that the dot product is invariant over chage of orthonormal bases, this because given a 2×2 matrix M we have that
Notice that it can be refactored as
and as M is an orthogonal matrix then
as that matrix has as columns orthogonal vectors and this expression is its dot product
also notice the
and
where
this is are the orthnormal vectors of the base, and as they are unitary then both previous expresions are equal to one
so finally
So to proof we will change the base of x and y from the standard base i, j to a new base
and
which are the unitary vector in the x direction and the perpendicular vector (so that we have a right coordinate) to the unitary x vector respectively
Following the diagram of the two bases described in the las parragraph
\begin{tikzpicture} \draw[<->] (-1,0)--(1,0) node[right]{$i$}; \draw[<->] (0,-1)--(0,1) node[above]{$j$}; \draw[<->,red] (45:-1)--(45:1) node[above]{$u := \hat x$}; \draw[<->,red] (135:-1)--(135:1) node[above]{$v := \hat x ^\perp$}; \end{tikzpicture}
To simplifly calculaitions notice that that way we can express the matrix of base change from (u,v) to (i,y) is the matrix m in then code below.
Also recall that
can be seen geometrically as
this is the norm of x times the projection of y over x
Now if we change to the base (u,v) conveniently the projection of y over x will be just be the component in the
direction (first coordinate).
var('x1 x2 y1 y2'); x = vector([x1,x2]); y = vector([y1,y2]); xhat = x/norm(x) m = matrix([ [xhat[0],-xhat[1]],[xhat[1],xhat[0]] ]) print(f'm = ', end=''); mylatex(factor(m)) print(f'X := m^-1*x = ', end=""); X = (m.inverse()*x).apply_map(factor) mylatex( X ) print(f'Y := m^-1*y = ', end=""); Y = (m.inverse()*y).apply_map(factor) mylatex( Y )
m =
X := m-1*x =
Y := m-1*y =
And according to our last discussion then
and finally we have that
As stated
