# If both $A-B$ and $B-A$ are positive semidefinite, then $A = B$

Let $$A, B$$ be two positive semidefinite matrices. Prove that if both $$A-B$$ and $$B-A$$ are positive semidefinite, then $$A = B$$.

I can show that their diagonal elements are the same but for others I have no idea. Any help will be appreciated.

One route is to observe that if $$\lambda,v$$ is an eigenvalue/eigenvector pair of $$M$$ with , then $$(-M)v=-\lambda v$$, meaning that $$-\lambda$$ is an eigenvalue of $$(-M)$$. Since $$M:=A-B$$ is positive semidefinite, conclude that any eigenvalue of $$M$$ satisfies $$0\leq \lambda\leq 0$$, so $$\lambda=0$$, so that $$M=0$$.
By assumption $$A-B=-(B-A)$$ is both positive semidefinite and negative semidefinite. This can only happen if $$A-B=0$$.
• its this equivalent to saying that $x^TAx=0 \forall x \implies A = 0$ which is wrong (math.stackexchange.com/questions/358281/…) ? – honzaik Mar 15 at 17:57
• I assumed we are working over $\mathbb C$ and so we are using $x^*Ax$. So the link is not relevant. – chhro Mar 15 at 18:01
• well i assumed you meant $0 \geq -x^T (B-A) x = x^T (A-B) x \geq 0$. I guess when I hear positive semidef etc I assume this definition with vectors. – honzaik Mar 15 at 18:10