Let A and B be two matrices, of order mx n and nx m respectively, such that r(AB) = r(BA)= min\{r(A), r(B)\}. Then AB is idempotent implies BA is also idempotent.

Please help. I am neither able to prove this, nor able to get any counter-example to disprove this.