The context: I am learning about Lie Groups and have been asked to show that the groups SL(n,R), U(n), Sp(m) are Lie Groups, and to find their dimensions. These are the special linear group, the unitary group, and the symplectic group respectively.
But I am struggling in going from the algebraic constraint, to the implied dimension, for Sp(m), which is defined as
$$Sp(m) = \{A \in U(2m) : AJA^T = J\}$$
where $J= \begin{bmatrix} 0 & I \\ -I & 0 \end{bmatrix}$
For the constraint in $U(n)$, I literally counted the degrees of freedom by considering the matrix multiplication component-wise.
i.e. $U(m) = \{A \in GL(n,\mathbb{C}): AA^\dagger = I\}$
and from $a_{ij}a^*_{kj} = \delta _{ik}$ you can see that the equation is symmetric under interchange of i and k. So I counted n degrees of freedom along i=k, and then you only need to specify half of the rest of the matrix, i.e. $\frac{n^2-n}{2}$. But in fact, we multiply this by 2 because we have complex entries. Therefore we get n^2 constraints total, so 2n^2-n^2 =n^2 degrees of freedom in U(n).
But, I am struggling to do the same for the symplectic group, where the constraint component-wise reads $a_{ij}J_{jk}a_{mk}=J_{im}$. Clearly we have invariance under swapping both pairs kj and im simultaneously, but I can't extend this to count our remaining degrees of freedom.