# A necessary and sufficient condition for two matrices to be “diagonalized” at the same time

Suppose that $$A$$ and $$B$$ are real symmetric matrices and $$A$$ is invertible. Show that the matrix $$A^{-1}B$$ is diagonizable(similar to a diagonal matrix) if and only if there exists an invertible $$P$$ such that $$P^{T}AP$$ and $$P^{T}BP$$ are both diagonal matrices.

The 'if' part is straightforward; however the only if part seems quite hard. Can anyone help?

• I suspect that the following reduction is useful: Suppose that $A^{-1}B$ is diagonalizable. Select matrix $P_1$ such that $P_1^TAP_1$ is diagonal with $1$s, followed by $-1$s. We now have $$(P_1^TAP_1)^{-1}(P_1^TBP_1) = P_1^{-1}(A^{-1}B)P_1.$$ Let $A_1 = P_1^TAP_1,B_1 = P_1^TBP_1, C_1 = P_1^{-1}(A^{-1}B)P_1$. We now have $A_1^{-1}B_1 = C_1$, so $B_1 = A_1C_1$ where $A_1$ has the form described, $B_1$ is symmetric, and $C_1 = A_1^{-1}B_1$ is diagonalizable. – Omnomnomnom Dec 29 '19 at 17:55
• At the very least, this leads to a clear proof in the case where $A$ is positive definite since we would then have $A_1 = I$. – Omnomnomnom Dec 29 '19 at 17:56
• Note that whenever $A$ has a "square root" $A^{1/2}$, $A^{-1}B$ must be diagonalizable. In particular, $A^{-1}B$ is similar to $A^{-1/2}BA^{-1/2}$, which is symmetric. With that being said: if we allow for complex diagonal matrices, then $A^{-1}B$ will be diagonalizable for any symmetric matrices $A,B$. – Omnomnomnom Dec 29 '19 at 18:13
• In this context, it seems that "diagonalizable" specifically means similar to a diagonal matrix with real entries. Can you verify whether this is the intended meaning? – Omnomnomnom Dec 29 '19 at 18:14
• @Omnomnomnom Yes, this is the intended meaning of 'diagonal'. – j200932 Dec 30 '19 at 2:22

This is equivalent to part (a) of Theorem 4.5.17 of Horn and Johnson's Matrix Analysis, second edition.

Theorem: Suppose that $$A$$ and $$B$$ are Hermitian and $$A$$ is nonsingular. Let $$C = A^{−1} B$$. There is a nonsingular $$S \in M_n$$ and real diagonal matrices $$\lambda,M$$ such that $$A = S\Lambda S^*$$ and $$B = SMS^*$$ if and only if $$C$$ is diagonalizable and has real eigenvalues.

Your statement amounts to the case where $$A$$ and $$B$$ are also real matrices. The proof for the "only-if" direction is as follows:

• If I find the time (and patience) to do so, I'll try to rewrite this proof to make it a bit more accessible. – Omnomnomnom Dec 29 '19 at 18:43

Hint: Notice that $$(P^T A P)^{-1} \cdot P^T B P = P^{-1} A^{-1} B P$$ is the product of two diagonal matrices.

• This can sove the 'if' part. What about the 'only if' part? – j200932 Dec 29 '19 at 12:43

Thoughts so far on the "only if" direction:

Suppose that $$A^{-1}B$$ is diagonalizable. Select matrix $$P_1$$ such that $$P_1^TAP_1$$ is diagonal with $$1$$s, followed by $$-1$$s. We now have $$(P_1^TAP_1)^{-1}(P_1^TBP_1) = P_1^{-1}(A^{-1}B)P_1.$$ Let $$A_1 = P_1^TAP_1,B_1 = P_1^TBP_1, C_1 = P_1^{-1}(A^{-1}B)P_1$$. We now have $$A_1^{-1}B_1 = C_1$$, so $$B_1 = A_1C_1$$ where $$A_1$$ has the form described, $$B_1$$ is symmetric, and $$C_1 = A_1^{-1}B_1$$ is diagonalizable.

I suspect that the trick from here is to select an orthogonal $$U$$ such that $$U^TB_1U$$ is diagonal and $$UA_1 = A_1 U$$. Note, however, that $$UA_1 = A_1 U$$ if and only if $$U$$ is block-diagonal with the same shape as $$A_1 = \operatorname{diag}(I_p,-I_q)$$. However, if $$B_1$$ is diagonalizable with such a $$U$$, then $$B_1$$ must also be block-diagonal of the same shape.

Long story short: in order to proceed with the proof in the way that I suspect it should go, we would need to show that if $$A_1 = \operatorname{diag}(I_p,-I_q)$$, $$B_1$$ is symmetric, and $$A_1^{-1}B_1$$ is diagonalizable, then $$B_1$$ must be block-diagonal (with block sizes $$p$$ and $$q$$). However, I don't see a clear reason that this should hold.