The set of Involutary Matrices is a smooth regular submanifold? 
Let $M_n(\mathbb R)=M_{n\times n}(\mathbb R)$ be the vector space of $n\times n$ matrices with entries in $\mathbb R$.
Let $S=\big\{ A\in M_2(\mathbb R)\,\big|\, A^2=I,\, A\ne \pm I\big\}$.
Show that $S$ is a smooth regular submanifold of $M_2(\mathbb R)$.

I am using the Regular Value Theorem stated in this question: Regular Value Theorem Using Implicit Function Theorem in Calculus.
I tried to construct a map
$f: M_2(\mathbb{R}) \to M_2(\mathbb{R})$
$$f : A \mapsto A^2 - I$$
The above mapping can be expressed as:
$$f(a, b, c, d) = (a^2+b c - 1, a b+b d, a c+c d, b c+d^2 - 1)$$
I can calculate the derivative to be
$$Df(a, b, c, d) = \left(
    \begin{array}{cccc}
    2 a & c & b & 0 \\
    b & a+d & 0 & b \\
    c & 0 & a+d & c \\
    0 & c & b & 2 d \\
    \end{array}
    \right)$$
However, there are some element in $S$ that is not a regular point. For example, $B = \begin{pmatrix} 0 &1 \\ 1 & 0 \end{pmatrix}$ with $f(B) = 0$ where the $Df(B) = \left(
\begin{array}{cccc}
 0 & 1 & 1 & 0 \\
 1 & 0 & 0 & 1 \\
 1 & 0 & 0 & 1 \\
 0 & 1 & 1 & 0 \\
\end{array}
\right)$ where the rank is 2.
It seems that the Regular Value Theorem cannot be used to conclude that $S$ is a smooth regular submanifold. Is there a another way to do it?
Any thoughts are appreciated!
 A: Let me set
$$ S_{+} = \{ A \in M_n(\mathbb{R}) \, | \, A^2 = I \}, \,\,\, S = S_{+} \setminus \{ \pm I \}. $$
I'll discuss the case $n = 2$ first. You have defined a (natural) smooth function $f \colon M_2(\mathbb{R}) \rightarrow M_2(\mathbb{R})$  such that $S_{+} = f^{-1} \left( 0_{2 \times 2} \right)$ (and not $S$!) is a pre-image of a point. If $0_{2 \times 2}$ would have been a regular value of $f$ this would imply that $S_{+}$ is a zero-dimensional submanifold. Unfortunately $S_{+} = S \cup \{ \pm I \}$ is not a submanifold but in fact the union of two points $\{ \pm I \}$ and a two-dimensional submanifold $S$. So in order to show $S$ is a submanifold using the regular value theorem we need to find a function whose range is two-dimensional and not four dimensional.
Let's try to describe $S$ more explicitly. Write
$$ A = \begin{pmatrix} a & b \\ c & d \end{pmatrix}, \,\,\,
A^2 = \begin{pmatrix} a^2 + bc & b(a+d) \\ c(a+d) & bc + d^2 \end{pmatrix}. $$
Then if $A^2 = I$ there are two options:

*

*If $a + d \neq 0$ then $b = c = 0$ and so $A$ is digonal with $a,b = \pm 1$.

*If $a + d = 0$ then $A$ has the form
$$ \begin{pmatrix} a & b \\ c & -a \end{pmatrix} $$
with $a^2 + bc = 1$.

This shows that
$$ S = \left \{ \left. \begin{pmatrix} a & b \\ c & d \end{pmatrix}  \right| a + d = 0, \, bc - ad = 1 \right \} $$
which coincides with Jason Devito's description of $S$ as the set of matrices which satisfy $\operatorname{tr}(A) = 0$ and $\det(A) = -1$. Hence it is natural to try and define $f \colon M_2(\mathbb{R}) \rightarrow \mathbb{R}^2$ by $f(A) = (a + d, bc - ad)$ and verify that $(0,1)$ is a regular value of $f$. Identifying $M_2(\mathbb{R})$ with $\mathbb{R}^4$ in the natural order corresponding to $(a,b,c,d)$ we get that
$$ Df|_{(a,b,c,d)} = \begin{pmatrix} 1 & 0 & 0 & 1 \\ -d & c & b & -a \end{pmatrix}. $$
Since $a + d = 0$ on $S$ the rows of $Df$ are indeed linearly independent on $S$ so $(0,1)$ is a regular value. Identifying $S$ with the manifold $ \{ (a,b,c) \in \mathbb{R}^3 \, | \, a^2 + bc = 1 \} $ and using the classification of the level sets of quadratic forms, one can see that $S$ is a one-sheeted hyperboloid (and so diffeomorphic to $\mathbb{R} \times S^1$), again agreeing with Jason Devito's guess.

This handles the case of $2 \times 2$ matrices. What about the general case? The equation $A^2 = I$ implies that the minimal polynomial of $A$ must divide $x^2 - 1 = (x-1)(x+1)$ and in particular $A$ is diagonalizable with $\pm 1$'s on the diagonal. Given $0 \leq k \leq n$, set
$$D_k = \operatorname{diag}(\underbrace{1,\dots,1}_{k \textrm{ times}}, -1, \dots, -1) \in M_n(\mathbb{R}). $$
A matrix $A$ satisfies $A^2 = I$ iff it is similar to $D_k$ for some $0 \leq k \leq n$. Hence, in general, $S_{+}$ is the disjoint union of $n + 1$ conjugacy classes and each conjugacy class is regular submanifold (see here) of codimension $k^2 + (n-k)^2$. When $n = 2$, $S$ is precisely the conjugacy class of $\operatorname{diag}(-1,1)$ and it can be described as the set of matrices whose characteristic polynomial is $(x-1)(x+1) = x^2 - 1$. Since the characteristic polynomial of a $2 \times 2$ matrix is $x^2 - \operatorname{tr}(A)x + \det(A)$ we again arrive to the description that $S_{+}$ is the set of matrices which satisfy $\operatorname{tr}(A) = 0$ and $\det(A) = -1$. This allows us to think of $S_{+}$ as the inverse image of $x^2 - 1$ under the map which sends a matrix to its characteristic polynomial and gives us another method of proving that $S_{+}$ is an embedded submanifold (using this answer).
