Solution (source code)

= Solution

Rearrange the identity into
$$
A(B-A-I)=I.
$$
Taking <determinants> gives $\det A\,\det(B-A-I)=1$. Hence $\det A\ne0$, so \b[$A$ is an <invertible matrix>], with $A^{-1}=B-A-I$. This uses that the <matrices> are finite and square: a right inverse then implies a two-sided inverse. Applying the identity to a vector in the <kernel> without first establishing commutation would not justify cancelling an $A$ on the wrong side. The argument is a case of <invertibility forced by a polynomial product identity>.