When does $X \succcurlyeq \operatorname{diag}(X)\operatorname{diag}(X)^\top$, if $X \succcurlyeq 0$? Basically the title. I have a problem that begins with a PSD matrix $X$ and I can solve it depending on wether $X - \operatorname{diag}(X)\operatorname{diag}(X)^\top$ is positive semidefinite. I thought for a while but I'm stuck.
 A: Let $w$ be the projection of  $\operatorname{diag}(X)$ onto the kernel of $X$.
If  $\operatorname{diag}(X)\notin \text{Im}(X)$ then $w\neq 0$ and $w^t\operatorname{diag}(X)\neq 0$. Hence, $$w^t(X-\operatorname{diag}(X)\operatorname{diag}(X)^t)w=-w^t\operatorname{diag}(X)\operatorname{diag}(X)^tw<0.$$
Now, let us assume that $\operatorname{diag}(X)\in \text{Im}(X)\setminus\{\vec{0}\}$.
Choose an orthornormal basis of $\mathbb{R}^n$: $\alpha=\{v_1,\ldots,v_m,v_{m+1}\ldots,v_n\}$ such that 


*

*$\{v_1,\ldots,v_m\}$ is an orthonormal basis of the image of $X$

*$v_m=\operatorname{diag}(X)/|\operatorname{diag}(X)|$

*$\{v_{m+1}\ldots,v_n\}$ is an orthonormal basis of the Kernel of $X$
Note that $[X-\operatorname{diag}(X)\operatorname{diag}(X)^t]_{\alpha}^{\alpha}=\begin{pmatrix}A-|\operatorname{diag}(X)|^2e_me_m^t & 0_{m\ \times\  n- m}\\
0_{n-m \ \times\ m} & 0_{n-m\ \times\ n-m} \end{pmatrix}$, 
where $A_{m\times m}$ is positive definite and $e_m^t=(0,\ldots,0,1)$ (Only the position m is occupied by 1).
Note that the principal submatrix of order $m-1$ of $A$ is positive definite then, by Sylvester's Criterion, we just need to check that $\det(A-|\operatorname{diag}(X)|^2e_me_m^t)\geq 0$ to obtain $A-|\operatorname{diag}(X)|^2e_me_m^t \succcurlyeq 0$.
By the matrix determinant lemma, we have $\det(A-|\operatorname{diag}(X)|^2e_me_m^t)=(1-|\operatorname{diag}(X)|^2e_m^tA^{-1}e_m)\det(A)$.
So we need $(1-|\operatorname{diag}(X)|^2e_m^tA^{-1}e_m)\geq 0$.
Besides $A$, we only need to compute one entry of $A^{-1}$: $A^{-1}_{mm}=e_m^tA^{-1}e_m$. 
For example, we could use Cramer's rule to find the last entry of the solution of $Ax=e_m$. Thus, $A^{-1}_{mm}=det(B)/\det(A)$, where $B$ is the principal submatrix of $A$ of order $m-1$.
