Generators of $O(N)$, $SO(N)$, $U(N)$ and $SU(N)$ I am presently studying a first course in particle physics. It does not suppose a formal preparation in mathematical topics such as group theory or symmetries. In the lecture notes for my course, it is mentioned that the number of generators of the group $O(N)$ is $N(N-1)/2$, $SO(N)$ is also $N(N-1)/2$, $U(N)$ is $N^2$ and $SU(N)$ is $N^2 - 1$. I did not fully understand where these numbers come from so I tried to do a bit of googling myself.
I read that the generators of $O(N)$ are $N \times N$ antisymmetric matrices (correct me if I'm wrong). I'm not sure how this leads to the number of generators mentioned above. Secondly, with $SO(N)$ aren't we imposing an extra constraint $\textrm{det(A)} = +1$ so shouldn't we have one less generator? Any explanation for this as well as the cases for $U(N)$ and $SU(N)$ would be greatly appreciated.
P.S.: I do not have a strong background in group theory, Lie groups, Lie algebras and the like
 A: The number of generators of a group are the number of continuous directions that the group has. The difference between $SO(N)$ and $O(N)$ is a discrete $\pm$ sign so they have the same number of generators.
On the other hand, the difference between $SU(N)$ and $U(N)$ is a whole phase $e^{i\theta}$ (because the determinant of $U(N)$ can be any phase and that of $SU(N)$ is 1). This is a continuous direction so $SU(N)$ has one less generator compared to $U(N)$.
OK, to find the number of generators, it is convenient to move from the Lie group to the Lie algebra and do the counting there. An element $X$ of the Lie algebra $so(N)$ ($O(N)$ has the same Lie algebra) is related to an element $R$ of the group $SO(N)$ by
$$
R = \exp X \quad \implies \quad R R^T = \exp ( X + X^T ) 
$$
So the orthonormality condition implies $X=-X^T$. It follows that $X$ is an antisymmetric matrix. Further, the elements of $R$ are all real so the same is true for $X$. How many independent components does an $N \times N$ antisymmetric matrix have? This is simply the number of ways to choose 2 numbers from the set $\{1,\cdots,N\}$ which is ${N\choose 2} = \frac{1}{2}N(N-1)$.
An element $X$ of the Lie algebra $u(N)$ is related to an element $U$ of $U(N)$ by
$$
U = \exp (i X) , \qquad U^\dagger U = \exp [i(X-X^\dagger)].
$$
The unitarity condition then implies that $X=X^\dagger$. We can now do the counting as follows. A generic $N\times N$ matrix has $2N^2$ independent (complex) components. The condition $X=X^\dagger$ is $N^2$ equations so in total the number of independent components of $X$ is $2N^2-N^2=N^2$.
Elements of $SU(N)$ satisfy one additional condition $\det U = +1$ which translates to $\text{tr} X = 0$. This is one extra condition on $X$ (in addition to unitarity). Consequently, the number of independent components of $X$ is now $N^2-1$.
A: Lie groups are characterised by their Lie algebras (at least simply connected ones). The Lie algebra is defined as the tangent space at the identity and it has the same dimension as the group. Lie groups are typically defined as a level set, i.e. $O(N) = \{M \in \mathbb{R}^{n \times n} | F(M) = 0\}$ where $F(M) = M^T M - I$. For submanifolds defined by such a constraint/level set we find the tangent space as the kernel of the differential (imagine Taylor expanding the constraint $F(M) = F(0) + d_{M_0} F(M_0) \cdot M + \mathcal{O}(M^2)$ and then to stay in the level set we require the second term to vanish). First let us calculate the differential of $F$ for $O(N)$ at the identity
\begin{align*}
\mathrm{d}_I F(M) \cdot T &:= \frac{\mathrm{d}}{\mathrm{d}t}\Big[(M + tT)^T (M + tT) - I\Big]_{t=0,\ M=I} = \frac{\mathrm{d}}{\mathrm{d}t}\left[I^2 + tT + tT^T + t^2 T^T T - I\right]_{t=0} \\
&= t T + t T^T
\end{align*}
As mentioned the algebra is then the tangent space $\mathfrak{o}(N) = T_I O(N)$ which is given by the kernel of the differential $\mathrm{ker}(\mathrm{d}_I F(M)\cdot T)$. The kernel is everything that is sent to $0$, so we find $\mathcal{o}(N) = \{T \in \mathbb{R}^{n \times n}| T + T^T = 0\}$ or $T^T = -T$. For the special orthogonal we also require $\det O = 1$, which is not an independent constraint because $O^T O = I$ already implies $\det O = \pm 1$. Now to find the dimension of $SO(N)$ and $O(N)$ we need to find the dimension of the algebra instead, but we know that the algebra contains skew-symmetric matrices. This means that all diagonal entries are $0$ and the entries that we can freely choose are those on the upper triangular part. There are $(N-1) + (N-2) + \dots + 1 = \frac{N(N-1)}{2}$ real entries on the upper triangular part of a matrix. Therefore $\mathrm{dim\,SO(N)} = \frac{N(N-1)}{2}$.
For SU($N$) by the same procedure we find that $U U^\dagger = I$ leads to the condition $T^\dagger = -T$ and $\det U = 1$ leads to $\mathrm{tr}\,T = 0$. Again we need to count the degrees of freedom that we have: for a complex $N\times N$ matrix we have $2N^2$ real entries, the diagonal is purely imaginary so we subtract $N$, the lower triangular part is completely determined by the upper triangular part which has $2 \cdot \frac{N(N-1)}{2}$ components, in total we find
\begin{align*}
\mathrm{dim\,U(N)} = 2N^2 - N - N(N-1) = N^2
\end{align*}
and for SU($N$) we subtract $1$, because for the single constraint $\det T = 1$.
