Let $V = \mathbb R^n$, and $Q : V\times V\to \mathbb R$ be a symmetric and positive definite bilinear form. I define $SO(n)$ to be $$ SO(n) := \left\{ A \in SL_n(\mathbb R) ~|~ A^T A = I_n \right\}. $$ Fulton and Harris claim, in page 96 of their book on Representation Theory, that the subgroup of $SL_n(\mathbb R)$ preserving $Q$ is $SO(n)$. It isn't clear to me that this is true, and I would like to prove it.
Fixing a basis for $V$, we get that $Q$ is given by a symmetric, positive definite matrix $M$ and we wish to prove that
$$ SO(n) \cong \left\{ A \in SL_n(\mathbb R) ~|~ A^T M A = M \right\}. $$
We may assume $M$ is diagonal since every real symmetric matrix is diagonalizable.
Here's what I have so far:
Write $A = (a_{ij})$ and $M = \mathrm{diag}(\lambda_1, \ldots, \lambda_n)$ with $\lambda_i > 0$ for all $1 \leq i \leq n.$ Then $A^TMA = M$ gives us the following system of equations:
$$\sum_{i} \left(A^T\right)_{si} \left(MA\right)_{it} = \left(M\right)_{st}$$ $$ \iff \sum_i a_{is} \lambda_i a_{it} = \lambda_s \delta_{st}, $$ for all $1 \leq s,t \leq n$. So the entries $a_{ij}$ of $A$ satisfy the equations we obtain above.
I would like to construct a map $\varphi$ which takes any such $A$ to $\varphi(A) \in SO(n)$, i.e whose entries $\tilde a_{ij}$ satisfy $$ \sum_i \tilde a_{is} \tilde a_{it} = \delta_{st}, $$ for all $1\leq s,t \leq n$, and then eventually argue that $\varphi$ is an isomorphism. I don't see how I can construct such a $\varphi$, any advice?
Thanks to Levent for the map $\varphi$.
Let $G = \left\{ A \in SL_n\mathbb R ~|~ A^TMA = M \right\},$ and let $\sqrt M = \textrm{diag}\left(\sqrt \lambda_1, \ldots, \sqrt \lambda_n\right)$.
We take $\varphi : G \to SO(n)$ to be the map given by $\varphi(A) = \sqrt M A {\sqrt M}^{-1}$. Indeed, we have $$ \varphi(A)^T \varphi(A) = \sqrt{M}^{-1} A^T \sqrt M \sqrt{M}A\sqrt{M}^{-1} = \sqrt M^{-1} M \sqrt M^{-1} = I_n, $$ so $\varphi(A) \in SO(n)$ for all $A \in G$.
Note that $\varphi$ is an injective homomorphism with inverse $\psi(B) = \sqrt M^{-1} B \sqrt M$, and for $B \in SO(n)$ $$ \psi(B)^T M \psi(B) = \sqrt M B^T \sqrt M^{-1} M \sqrt M^{-1} B \sqrt M = \sqrt M B^T B \sqrt M = M. $$
Hence $\varphi : G \to SO(n)$ is an isomorphism.