TITLE: Square Matrix Inequality
QUESTION [5 upvotes]: Suppose that for two $n \times n$ matrices $A,B$, $AB = A + B$. Prove that 
$$\text{rank}(A^2) + \text{rank} (B^2) \leq 2 \text{rank} (AB).$$
This reminds me of Sylvester's Rank Inequality theorem, but I'm not sure if that's really helpful here. I haven't really made significant progress on this beyond writing out a few matrix multiplication. Would appreciate any help at all! Thank you.

REPLY [3 votes]: There's a generalisation of Sylvester's Rank Inequality Theorem attributed to Frobenius. It states for all matrices $X, Y, Z$ we have
$$
rk(XY) + rk(YZ) \le rk(Y) + rk(XYZ).
$$
Using $AB = A + B$ we get $(A-I)(B-I)=I$ hence $(A-I) = (B-I)^{-1}$ and so $(B-I)(A-I) = I$ which implies $BA = A + B = BA$. So the matrices commute. Then apply the above theorem with $Y = AB$, $X = A-I$ and $Z = B-I$ gives the desired inequality.