Solution (source code)

= Solution

For the standard meaning of a <canonical transformation>, the new coordinates must retain Hamiltonian form for every Hamiltonian, with the same physical function expressed in the new coordinates. Let $z=(q,p)$, $Z=F(z)=(Q,P)$, $S=DF$ and $J=\begin{pmatrix}0&I\\-I&0\end{pmatrix}$. With $K(Z)=H(F^{-1}(Z))$, the <chain rule> gives
$$
\dot Z=S J S^T\nabla_ZK.
$$
Agreement with $\dot Z=J\nabla_ZK$ for arbitrary $K$ forces $SJS^T=J$. Its matrix entries are precisely the <Poisson brackets> of the new coordinates, so
$$
\boxed{\{Q_i,Q_j\}=0,\qquad\{P_i,P_j\}=0,\qquad\{Q_i,P_j\}=\delta_{ij}.}
$$
The qualification for every Hamiltonian matters. <Preserving one Hamiltonian flow does not imply canonicality>. For example, with two coordinate pairs and $H=(q_1^2+p_1^2)/2$, the invertible change $Q_1=q_1$, $P_1=p_1$, $Q_2=2q_2$, $P_2=p_2$ preserves the equations and the same physical Hamiltonian, but $\{Q_2,P_2\}=2$. Thus a definition requiring only one chosen Hamiltonian flow is too weak to prove the claimed bracket identities. The universal definition supplies the missing condition.