Let $A$ be a finite subset of $\mathbb{N}$.
Let $X$ be the semigroup generated by elements of form
$$\begin{pmatrix} 0&1\\1&a \end{pmatrix}$$ where $a\in A$
Let $Y$ be the semigroup generated by all products of the form
$$\begin{pmatrix} 0&1\\1&a \end{pmatrix} \cdot \begin{pmatrix} 0&1\\1&b \end{pmatrix} $$ where $a,b \in A$.
Clearly $X\subseteq \mbox{GL}(2,\mathbb{Z})$ and $Y \subseteq \mbox{SL}(2,\mathbb{Z}) $.
How can one show also that $Y = X \cap \mbox{SL}(2,\mathbb{Z}) $ ?
It is clear to me that $Y \subseteq X \cap \mbox{SL}(2,\mathbb{Z}) $ but I do not know how to go about showing the reverse direction.
An element in $X$ is a product of matrices $A=\prod_{i=0}^nA_i=\prod_{i=0}^n\begin{pmatrix} 0 & 1 \\ 1 & a_i \end{pmatrix}$. In order for this to have determinant $1$, you need $n$ to be even. Therefore you can write $A=(A_1A_2)(A_3A_4)...(A_{n-1}A_n)$.