# For a symmetric matrix $B$ and following four relevant matrices $P,Q,C,D$, what's the relation between $QP$ and $CDC^{\rm T}$?

Suppose $$B\in\mathbb{R}^{n\times n}$$ is a symmetric matrix with $${\rm rank}(B)=r$$. Then $$B$$ is equivalent to $$\tilde{B}$$ in (1), where $$I_{r}$$ denotes the identity matrix of order $$r$$. That is, there exist two invertible matrices $$P,Q\in\mathbb{R}^{n\times n}$$ such that $$PBQ=\tilde{B}$$. On the other hand, $$B$$ is congruent to $$E$$ in (1) with $$r_{1}+r_{2}=r$$. That is, there exists invertible matrix $$C\in\mathbb{R}^{n\times n}$$ such that $$C^{\rm T}BC=E$$. Moreover, select $$D$$ as (1), and then we have $$C^{\rm T}BCD=\tilde{B}$$. If $$B$$ is positive semidefinite, then $$E=\tilde{B}$$ and $$D=I_{n}$$. $$$$\tag{1} \tilde{B}=\begin{bmatrix} I_{r} & 0\\ 0 &0 \end{bmatrix}_{n\times n}, E = \begin{bmatrix} I_{r_{1}} & & \\ &-I_{r_{2}} &\\ &&0 \end{bmatrix}_{n\times n}, D=\begin{bmatrix} I_{r_{1}} & &\\ &-I_{r_{2}} &\\ & & I_{n-r} \end{bmatrix}_{n\times n}.$$$$ Here comes my question: for any $$P,Q,C,D$$ satisfying $$PBQ=C^{\rm T}BCD=\tilde{B}$$, what's the relation between $$QP$$ and $$CDC^{\rm T}$$? Or to say the least, just like $$CDC^{\rm T}$$, is the product $$QP$$ also symmetric? For example, consider $$\begin{equation*} B=\begin{bmatrix} -12 & 6 & -2\\ 6 & -3 & 1\\ -2 & 1 &0 \end{bmatrix}. \end{equation*}$$ Choose $$\begin{equation*} P=\begin{bmatrix} 0& 1&0\\0 &0 &1\\1 & 2 &0 \end{bmatrix}, Q=\begin{bmatrix} 0 &0 &1\\0 &1 &2\\1 &3 &0 \end{bmatrix}, C=\begin{bmatrix} 0 & 1 & 2\\ 1 & 1 & 4\\ 2 &-1 &0 \end{bmatrix}, D=\begin{bmatrix} 1 &&\\&-1&\\&&1 \end{bmatrix}. \end{equation*}$$ We have $$\begin{equation*} QP = \begin{bmatrix} 1 &2&0\\ 2&4&1\\ 0&1&3 \end{bmatrix}, CDC^{\rm T}=\begin{bmatrix} 3&7&1\\7&16&3\\1&3&3 \end{bmatrix}. \end{equation*}$$ When $$B$$ is of full rank, it is easy to show $$QP=CDC^{\rm T}$$ since they are both the inverse of $$B$$. If $$r, I have tried a lot of examples, and find $$QP$$ is always symmetric. However, I still can't give a rigorous proof for the symmetry of $$QP$$, or the relation between $$QP$$ and $$CDC^{\rm T}$$. Any answer will be appreciated. Thanks a lot.