Solution (source code)

= Solution

A point $x$ is critical for a smooth map $f:X\to Y$ when $Df_x:T_xX\to T_{f(x)}Y$ is not surjective. A critical value is the image of a critical point; a <regular value> has no critical point in its fiber, including the case of an empty fiber.

To prove the <regular level set theorem>, take $x_0\in f^{-1}(y)$ and write $n=\dim X$, $m=\dim Y$. In local coordinates, surjectivity supplies an invertible $m\times m$ derivative minor; relabel source coordinates so it uses the first $m$ columns. The map
$$
\Phi(x)=(f_1(x),\ldots,f_m(x),x_{m+1},\ldots,x_n)
$$
has an invertible derivative. The <inverse function theorem> makes it a local diffeomorphism. In these coordinates the fiber is obtained by fixing its first $m$ coordinates, so it is locally an open subset of $\mathbb R^{n-m}$. These smooth charts prove that \b[a nonempty regular fiber is a smooth embedded manifold of dimension $n-m$], with tangent space $\ker Df_x$.

For the <special orthogonal group>, use $F:M_n(\mathbb R)\to\operatorname{Sym}_n(\mathbb R)$ defined by $F(A)=AA^T$. Its derivative is $DF_A(H)=HA^T+AH^T$. At an orthogonal $A$, any symmetric matrix $B$ is obtained by taking $H=BA/2$, so $I$ is a regular value. Therefore $O(n)=F^{-1}(I)$ has dimension $n^2-n(n+1)/2=n(n-1)/2$. The determinant takes only the values $\pm1$ there, so $SO(n)$ is an open and closed part of $O(n)$ and has the same manifold dimension:
$$
\boxed{\dim SO(n)=\frac{n(n-1)}2.}
$$
It is closed in matrix space and bounded because every orthogonal matrix column has norm one. The <Heine-Borel theorem> proves compactness. Finally the tangent space is the derivative kernel,
$$
\boxed{T_ASO(n)=\{H:AH^T+HA^T=0\}
=\{AK:K^T=-K\}.}
$$
Thus its translated tangent space is the vector space of skew-symmetric matrices.