A common basic result of analytical mechanics is that point transformations $Q=Q(q)$ are canonical, i.e. they preserve the canonical structure of Hamilton equations. Also, a known theorem says that a necessary and sufficient condition for $(p,q) \to (P,Q)$ to be a canonical transformation is that its Jacobian $M$ has to be of the form $M J M^t=M^t J M = a J$, with $J$ the standard symplectic matrix and $a$ a constant different from zero.
As an exercise, I want to verify the theorem for a point transformation, but I am having trouble proving that $M^t J M = a J$ for dimension of $M$ higher than 2.
Being that $Q=Q(q)$ and $P=(N^t(q))^{-1}p$, where $N$ is the Jacobian of $Q(q)$ I write the Jacobian $M$ of the overall $(p,q) \to ((N^t)^{-1}p, Q(q))$ transformation as
$$\begin{bmatrix} \frac{\partial P}{\partial p} & \frac{\partial P}{\partial q}\\ \frac{\partial Q}{\partial p} & \frac{\partial Q}{\partial q} \end{bmatrix} = \begin{bmatrix} (N^t(q))^{-1} & R\\ 0 & N \end{bmatrix}$$
and I get $$ M^tJM= \begin{bmatrix} (N(q))^{-1} & 0\\ R^t & N^t \end{bmatrix} \begin{bmatrix} 0 & -I\\ I & 0 \end{bmatrix} \begin{bmatrix} (N^t(q))^{-1} & R\\ 0 & N \end{bmatrix} = \begin{bmatrix} (N(q))^{-1} & 0\\ R^t & N^t \end{bmatrix} \begin{bmatrix} 0 & -N\\ (N^t(q))^{-1} & R \end{bmatrix} = \begin{bmatrix} 0 & -I\\ I & -R^tN+N^tR \end{bmatrix} $$
where $R=[\frac{\partial (N^t(q))^{-1}p}{\partial q_1}...\frac{\partial (N^t(q))^{-1}p}{\partial q_n}]$
so that $$N^tR(i,j)=\begin{bmatrix} \frac{\partial Q_1}{\partial q_i} & ... &\frac{\partial Q_n}{\partial q_i} \end{bmatrix} \begin{bmatrix} \frac{\partial (N^t(q))^{-1}p}{\partial q_j} \end{bmatrix} $$ $$ R^tN(i,j)= \begin{bmatrix} \frac{\partial (N^t(q))^{-1}p}{\partial qi} \end{bmatrix}^t\begin{bmatrix} \frac{\partial Q_1}{\partial q_j} & ... &\frac{\partial Q_n}{\partial q_j} \end{bmatrix} $$
This last matrix is $J$ (so $a$ is 1) if $R^tN$ is symmetric, but I am not sure how to check it. Is the reasoning and the methodology correct?