TITLE: Can the product of some matrices equal the identity matrix?
QUESTION [9 upvotes]: Let $A=\begin{pmatrix} 1 & 2 \\ 0 & 1\end{pmatrix}$ and $B=\begin{pmatrix} 1 & 0 \\ -2 & 1\end{pmatrix}$.
Can a product $X_1 X_2...X_n$ be equal to the identity matrix if every factor $X_i$ equals either $A$ or $B$?
I believe that the answer is negative, but I don't really know how to prove it. I thought of two approaches:

We could try doing this by induction. The base case is trivial since neither of $A$ nor $B$ are the identity matrix. However, I don't know how to go from $n$ to $n+1$.

Maybe we should use the fact that if $U, V$ are two square matrices such that $UV$ is the identity, then $VU$ is also the identity. I guess that we should somehow shuffle the order of the factors using this observation, but then again, I don't know how to use this.

REPLY [2 votes]: Let $s=\begin{bmatrix}0 & -1 \\1&0\end{bmatrix}$ and $t=\begin{bmatrix}1 & -1 \\ 1&0\end{bmatrix}$. Then, in $PSL_2(\mathbb{Z})$, $s^2=t^3=1$, $s,t$ generate this group and have no other nontrivial relation (see https://chiasme.wordpress.com/2015/03/08/an-elementary-application-of-ping-pong-lemma/).
Now, note that in $PSL_2(\mathbb{Z})$, $(ts)^{2}=A$ while $B=(st)^2$.
So we want to see that no word in $stst$ and $tsts$ simplifies to the trivial word when $s^2=t^3=1$. That looks obvious (we can only reduce when $stst$ comes after $tsts$ and then the result is $tst^{-1}st$ which cannot be reduced further).