Solution (source code)

= Solution

If $M_1^TJM_1=J$ and $M_2^TJM_2=J$, then <matrix multiplication> and the transpose rule give
$$
(M_1M_2)^TJ(M_1M_2)
=M_2^T(M_1^TJM_1)M_2
=M_2^TJM_2=J.
$$
Thus the product also satisfies the equation.

The equation and part (i) imply that $M_1$ is invertible. Multiplying
$M_1^TJM_1=J$ on the left by $(M_1^{-1})^T$ and on the right by $M_1^{-1}$ gives
$$
(M_1^{-1})^TJ M_1^{-1}=J.
$$
\b[Hence the set of solutions is closed under products and <matrix inverses>.]