Solution (source code)

= Solution

For a curve $O(t)=I+tX+O(t^2)$ in the <special orthogonal group>, differentiate $O(t)^TO(t)=I$ at the identity. This gives $X^T+X=0$. Conversely, the <matrix exponential> of any real <skew-symmetric matrix> is orthogonal and has <determinant> $\det e^{tX}=e^{t\operatorname{tr}X}=1$. Hence
$$
\boxed{\mathfrak{so}(N)=\{X\in M_N(\mathbb R):X^T=-X\},\qquad [X,Y]=XY-YX.}
$$
A <basis> is $L_{ij}=E_{ij}-E_{ji}$ for $1\le i<j\le N$, where $E_{ij}$ is a <matrix unit>. If $L_{ji}=-L_{ij}$ and $L_{ii}=0$, their <Lie brackets> are
$$
[L_{ij},L_{kl}]=\delta_{jk}L_{il}-\delta_{jl}L_{ik}-\delta_{ik}L_{jl}+\delta_{il}L_{jk}.
$$
There are $\binom N2$ independent off-diagonal entries. A <maximal torus> rotates independently in mutually orthogonal two-planes, generated by $L_{12},L_{34},\ldots$. Thus
$$
\boxed{\dim\mathfrak{so}(N)=\frac{N(N-1)}2,\qquad \operatorname{rank}\operatorname{SO}(N)=\left\lfloor\frac N2\right\rfloor.}
$$
The maximality follows by simultaneously decomposing commuting real <skew-symmetric matrices> into rotation two-planes, with at most one remaining fixed axis.