TITLE: Positive semidefinite inner product
QUESTION [7 upvotes]: If S,Z are positive semidefinite. We now know that $y^TSy=\sum_{i}\sum_{j}S_{ij}y_{i}y_{j}\geq 0 $, same goes for Z.
We also know that we can write S as $S=\sum_{i}\lambda_{i}x_{i}x_{i}^{T}$, with $\lambda_{i}$ the eigenvalues and $x_{i}$ eigenvectors of the matrix S. In other words $S_{ij}=\sum_{k}\lambda_{k}x_{ik}x_{jk}$ by construction.
I want to show that $$\sum_{i}\sum_{j}S_{ij}Z_{ij}\geq0$$
Could anyone help me show this??
I would also like to know why the equality of this statement only holds if and only if $S \cdot Z=0$

REPLY [4 votes]: Note $S_i=\lambda_i x_i x^\top_i$, and so, $S=\sum S_i$. To show that the dot product between $Z$ and $S$ satisfies $Z\cdot S\geq 0$, it is enough to show that $Z\cdot S_i\geq 0$. For this, it is enough to show that $\lambda_i Z\cdot  x_i x^\top_i\geq 0$. Since $S$ is  positive semidefinite, $\lambda_i\geq 0$. We only need to prove $Z\cdot  x_i x^\top_i\geq 0$, which is simply equivalent to $x_i^\top Z x_i\geq 0$, which is true for any $x$ because Z is positive semidefinite.