A question on the codimension of $O(n)$ and $SO(n)$ reative to $GL(n,R)$ This seems like a very silly way to control the website, because as a new user it will not let me make comments.
So apologies in advance to reference a previous question, but given the warning not to post answers that are new questions, this is my only option.
Independence of Rotation Matrix Definitions
My question is similar to this original question.
I am able to understand that $O(n)$ has dimension 
$$\dim(O(n)) = \frac{n(n-1)}{2}$$
but I do not understand why $SO(n)$ also has dimension
$$\dim(O(n)) = \frac{n(n-1)}{2}$$
That is, I do not understand why the extra constraint of
$$\det(A) = 1$$
$\forall{A}\in SO(n)$ does not increase the co-dimension relative to $GL(n,R)$ by $1$.
Yuan says that it simply singles out the connected component. I understand that this is the case since we cannot move smoothly from the identity element to those $\hat{A}$ $\in$ O(n) with
$$\det(\hat{A}) = -1$$
but I do not see why this does not increase the co-dimension.
 A: The essential point here is that $g\in O(n)$ already implies that $\det(g)\in\{-1,+1\}$ (it is a consequence of $g^t\circ g=\mathrm{id}$), so that while $\det(g)=1$ is an additional constraint, it does not restrict any continuous degree of freedom. Since the determinant is locally constant, restricting it to be$~1$ just select the subset that can be continously reached from the identity (the connected component of the group containing the identity element).
By contrast, the (real) dimensions of the unitary group $U(n)$ and the special unitary group $SU(n)$ do differ by$~1$ (they are $n^2$ and $n^2-1$), since unitary matrices can have as determinant any complex number of modulus$~1$, so restricting it to be$~1$ removes one degree of freedom.
A: To use an analogy: think about $A = \{\pm 1\} \times \mathbb R$ and $B = \{1\} \times \mathbb R$ as submanifolds of $\mathbb R^2$.  They both are of dimension 1, but $B = \{x \in A : x_1 = 1\}$.
A: From another perspective, $SO(n)$ is the quotient of $O(n)$ by the discrete group $\mathbb{Z}/2\mathbb{Z}$ acting by diffeomorphisms, so the quotient map is a local diffeomorphism. In particular $O(n)\ni A\mapsto A/\det A\in SO(n)$ is a twofold covering map.
