[Math] If $A,B$ are square matrices and $A^2=A,B^2=B,AB=BA$, then calculate $\det (A-B)$

determinantdiagonalizationlinear algebramatrices

If $A,B$ are square matrices and $A^2=A,B^2=B,AB=BA$, then calculate $\det (A-B)$.

My solution: consider $(A-B)^3=A^3-3A^2B+3AB^2-B^3=A^3-B^3=A-B$, then $\det(A-B)=0\vee 1\vee -1$

The result of the book is the same as mine, but their solution is different. They begin: "Since $A^2=A$ and $B^2=B$, $A$ and $B$ are diagonalizable; moreover, since $AB=BA$, then there exists a invertible matrix $P$ such that $P^{-1}AP$ and $P^{-1}BP$ are diagonal matrices."

The statement has two parts, and I don't understand both. So I really need a specific explanation for those two parts.

Thanks in advance.

Best Answer

For any square matrix $\;A\;$ :

$\;A^2=A\implies A(A-I)=0\implies\;$ the minimal polynomial of $\;A\;$ divides $\;x(x-1)\;$ and it is thus a product of different linear factors $\;\iff A\;$ is diagonalizable.

Also, if two matrices are diagonalizable, then they are simultaneosly diagonalizable iff they commute.

Related Question