Let vectors \(\textbf{v}\) and \(\textbf{u}\) be defined as follows:
$$ \textbf{v} = \begin{bmatrix} v_1 \\ v_2 \\ v_3 \end{bmatrix} \quad \textbf{u} = \begin{bmatrix} u_1 \\ u_2 \\ u_3 \end{bmatrix} $$
The magnitude \(\Vert \textbf{v} \Vert\) is:
$$ \Vert v \Vert = \sqrt{v_1^2 + v_2^2 + v_3^2} $$
So the square of this is:
$$ \Vert v \Vert^2 = v_1^2 + v_2^2 + v_3^2 $$
The dot product \(\textbf{v} \cdot \textbf{u}\) is defined as follows:
$$ \textbf{v} \cdot \textbf{u} = v_1u_1 + v_2u_2 + v_3u_3 $$
If you do a dot product of \(\textbf{v}\) with itself:
$$ \textbf{v} \cdot \textbf{v} = v_1^2 + v_2^2 + v_3^2 $$
This means \(\textbf{v} \cdot \textbf{v} = \Vert \textbf{v} \Vert^2\). A similar proof can be used for other dimensions.