Diagonalizing two real symmetric matrices with one $SL(n,\mathbb{R})$ transformation Consider two real symmetric $n\times n$ matrices $A$ and $B$, I would like to know if it is possible to find a single $SL(n,\mathbb{R})$ matrix $M$ such that both $MAM^T$ and $(M^{-1})^TBM^{-1}$ are diagonal.
There are certainly enough parameters in an $SL(n,\mathbb{R})$ matrix to make this possible. Simple counting gives $\frac{n(n+1)}{2}+\frac{n(n+1)}{2}-(n^2-1)=n+1\leq 2n$. So in principle this should work unless something very special happens. $n=1$ is trivial, and I have worked out that it is possible in the $n=2$ case. Edit (I have since realized I was working out the wrong problem with the $n=2$ case)
This seems well suited for a proof by induction, but I can't figure out where to start!
Edit
While I have accepted @user8675309 's answer, I'd like to add here the conditions for which such an $M$ can be found. As per @WillJagy 's reference, there is a theorem which states that if we have $A$ and $B$ with $B$ invertible, then $MAM^T$ and $MBM^T$ are diagonal for some nonsingular $M$ if and only if $C=B^{-1}A$ is diagonalizeable.
The case that I am asking about can be turned into this one by considering $A$ and $B^{-1}$ instead. Therefore my condition that both $MAM^T$ and $(M^{-1})^TBM^{-1}$ are diagonal is possible if and only if $C=BA$ is diagonalizeable.
If we take @user8675309 's counter example, we see that their $BA$ is not diagonalizeable.
 A: edit, much shorter rationale:
The claim can't be true even if we allow $M\in GL\big(n,\mathbb C\big)$.  The reason simply is it implies
$M\big(AB\big)M^{-1}= \big(MAM^T\big)\big( M^{-T}BM^{-1}\big) = D_1D_2=D$
i.e. it implies the product of two real symmetric matrices $A,B$ is always diagonalizable.  Yet if we select $A$ to be the $2\times 2$ ones matrix and $B$ to be the (diagonal) reflection matrix, then $\text{rank}\big(AB\big)=1$ and $\text{trace}\big(AB\big)=0$ which means $\big(AB\big)$ is defective and contradicts the existence of $M$.
original response below:
Suppose for contradiction that the statement is True
Then $\big(MAM^T\big)= D_1$ and $\big( M^{-T}BM^{-1}\big)=D_2$.
$$
\begin{align}    
M\big(AB\big)M^{-1}\\   
&=\big(MAM^T\big)\big( M^{-T}BM^{-1}\big) \\  
&=D_1D_2\\ 
&=D_2D_1\\  
&=\big( M^{-T}BM^{-1}\big)\big(MAM^T\big)\\  
&=M^{-T}\big(BA\big)M^{T}\\
\end{align}
$$
multiplying on the left by $M^T$ and the right by $M^{-T}$ implies
$\big(M^TM\big)\big(AB\big)\big(M^{T}M\big)^{-1} =\big(BA\big)$
Suppose $A$ is singular and $B$ is invertible but indefinite.  This should raise alarm bells since $\big(AB\big)$ and $\big(BA\big)$ are similar through $B$ yet $B \neq M^TM$.  To make this explicit:  select $A:=\mathbf{11}^T$ and $B:=\bigg[\begin{array}\\ 
1  &0 \\ 0 & -1\end{array}\bigg]$
multiplying each on the left by $A$ gives
$ \mathbf {11}^T\big(M^TM\big)\big(\mathbf {11}^TB\big)\big(M^{T}M\big)^{-1} =\mathbf {11}^T\big(B\mathbf {11}^T\big)$
since $M \in GL(n,\mathbb{R})$, we have $M\mathbf 1 = \mathbf v\neq 0$ and $0\lt\alpha = \big \Vert \mathbf v\big \Vert_2^2$.  Finally, computing the rank of each side of the equality gives us
$$
\begin{align}    
1\\
&=\text{rank}\Big(\alpha\cdot \mathbf {1}\mathbf 1^T\Big)\\   
&=\text{rank}\Big(\mathbf {1}\big(\mathbf v^T\mathbf v\big) \mathbf 1^T\Big)\\
&=\text{rank}\Big(\mathbf {1}\big(\mathbf 1^TM^T\big)\big(M\mathbf 1\big) \mathbf 1^T\Big)\\      
&=\text{rank}\Big(\mathbf {11}^T\big(M^TM\big)\big(\mathbf {11}^T\big)\Big)\\   
&=\text{rank}\Big(\mathbf {11}^T\big(M^TM\big)\big(\mathbf {11}^T\big)B\Big)\\   
&=\text{rank}\Big(\mathbf {11}^T\big(M^TM\big)\big(\mathbf {11}^TB\big)\big(M^{T}M\big)^{-1}\Big)\\   
&=\text{rank}\Big(\mathbf {11}^TB\mathbf {11}^T\Big)\\  
&=\text{rank}\Big(\mathbf 0\Big)\\ 
&= 0  
\end{align}
$$
and we conclude $1=0$ which is a contradiction
A: Suppose $B$ is invertible and $C=B^{-1}$. Then $MAM^T$ and $MCM^T$ are diagonal. This means $A$ and $C$ are always simultaneously diagonalisable by the usual kind of congruence whenever $A$ is symmetric and $C$ is both invertible and symmetric. But this is known to be false. E.g. if we take user8675309's counterexample, we have $MAM^TMCM^T=MCM^TMAM^T$. Therefore $AM^TMC=CM^TMA$ and $C^{-1}AM^TM=M^TMAC^{-1}$, i.e. $SAC^{-1}$ is symmetric for some positive definite matrix $S=M^TM$. However,
$$
S=\pmatrix{a&b\\ b&c}\Rightarrow
SAC^{-1}=\pmatrix{a&b\\ b&c}\pmatrix{1&1\\ 1&1}\pmatrix{1&0\\ 0&-1}=\pmatrix{a+b&-a-b\\ b+c&-b-c}.
$$
It is symmetric only when $a+c=-2b$. But then $\det(S)=ac-b^2=ac-\frac14(a+c)^2=-\frac14(a-c)^2\le0$. Therefore $S$ isn't positive definite, which is a contradiction. Hence $A$ and $C$ are not simultaneously diagonalisable by congruence.
