Matrix generating $\operatorname{SL}_n(\mathbb{R})$ How do I show that the following matrices generate $\operatorname{SL}_2(\mathbb{R})$
$\begin{pmatrix}
  1 & a \\
  0 & 1 \\
 \end{pmatrix}$ or $\begin{pmatrix}
  1 & 0 \\
  a & 1 \\
 \end{pmatrix}$

Let $G$ be the span of the matrices
$$
\begin{pmatrix}
1 & a \\ 0 & 1
\end{pmatrix}
\quad\text{and}\quad
\begin{pmatrix}
1 & 0 \\ a & 1
\end{pmatrix}
$$
with $a\in \mathbb R$.
We have
$$
\begin{pmatrix}
1 & 1 \\ 0 & 1
\end{pmatrix}
\begin{pmatrix}
1 & 0 \\ -1 & 1
\end{pmatrix}
\begin{pmatrix}
1 & 1 \\ 0 & 1
\end{pmatrix} =
\begin{pmatrix}
0 & 1 \\ -1 & 0
\end{pmatrix}
\in G
$$
and for all $a\in \mathbb{R}^\times$
$$
\begin{pmatrix}
1 & a \\ 0 & 1
\end{pmatrix}
\begin{pmatrix}
0 & 1 \\ -1 & 0
\end{pmatrix}
\begin{pmatrix}
1 & a^{-1} \\ 0 & 1
\end{pmatrix}
\begin{pmatrix}
0 & 1 \\ -1 & 0
\end{pmatrix}
\begin{pmatrix}
1 & a \\ 0 & 1
\end{pmatrix}
\begin{pmatrix}
0 & 1 \\ -1 & 0
\end{pmatrix}
=
\begin{pmatrix}
a & 0 \\ 0 & a^{-1}
\end{pmatrix}
\in G
$$
Now by a slightly modified Gauss elimination, any matrix $A\in \operatorname{SL}_2(\mathbb R)$ can be transformed into the unit matrix using the above matrices.
So $G = \operatorname{SL}_2(\mathbb R)$
