Solution (source code)

= Solution

The ambient matrix space has dimension $4n^2$, while the space of skew-symmetric $2n\times2n$ matrices has dimension
$$
\binom{2n}{2}=n(2n-1).
$$
Because $\Omega$ is a regular value, the codimension of its level set is the dimension of the target. Hence
$$
\dim Sp(2n,\mathbb R)
=4n^2-n(2n-1)
=n(2n+1).
$$