I wish to replicate the following proof using tensor notation. Let $v$ be a vector of $\mathbb{R}^n$. First I define this function:
$$ f(v)=v^Tv\\ $$
I now ask, what are the transformations that leave $f$ invariant:
$$ f(Ov)=(Ov)^T (Ov)=v^TO^TOv $$
which is invariant iff $O^TO=I$.
Now using tensor notation, I write $f$ as follows:
$$ f(v)=v_av_bm^{ab} $$
for a 2D vector:
$$ f(v)=v_0v_0m^{00}+v_0v_1m^{01}+v_0v_1m^{10} +v_1v_1m^{11} $$
Then, if we assume the $m_{ab}$ is the identity matrix, we get:
$$ f(v)=v_0^2+v_1^2 $$
What happen when I inject a transformation into $f$? Is the following the correct approach?
$$ f(Ov) = (Ov)_a(Ov)_b m^{ab} $$
How do I then eliminate $O$ such that the condition $O^TO=I$ emerges, using this kind of notation?
The $O$ for which $v\mapsto Ov$ preserves $v^Tmv$ (where without loss of generality $m$ is symmetric, so is diagonalisable with real eigenvalues) are not in general the orthogonal $O$, but the solutions to $O^TmO=m$. Indeed$$(Ov)_a(Ov)_bm^{ab}=O_a^{\:c}v_cO_b^{\:d}v_dm^{ab}\equiv v_cv_dm^{cd}\iff m^{cd}=O_a^{\:c}O_b^{\:d}m^{ab}=(O^TmO)^{cd}.$$