Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
In the $2\times 2$ case I don't think it is possible to find such a matrix $A$. Indeed, in case $A+A^\top\not<0$, by virtue of the Schur-Horn Theorem, there always exists an orthogonal matrix $U$ such that $U^\top A U$ has one diagonal entry equal to $\mathrm{tr}(A)$ and the other entry equal to zero.
Thanks for your comment. I see your point, however I couldn't find any numerical counterexample yet (I've run an extensive number of random numerical simulation for $n=2,3,\dots,10$). If you have some ideas about how to construct such a counterexample, please let me know.
If $A$ is diagonalizable and has strictly negative eigenvalues, then it is not true in general that $A+A^\top \le 0$. Take for instance $A=\begin{bmatrix}-\frac{1}{2} & 2\\ 0 & -\frac{1}{2}\end{bmatrix}$, $A+A^\top$ has eigenvalues $\{-3,+1\}$.
Your proof is correct when $A+A^\top\le 0$. However when $A+A^\top\not\le 0$, taking $X=\frac{1}{2}I$ violates the constraint $AX+XA^\top\le 0$ and so it does not represent an admissible solution.
Ok, so your claim is that the solution is invariant under unitary similarity transformations. I agree. Further, I would say that the optimum is $X=\frac{1}{2}I$ in the case $A+A^\top\le 0$ (not just $A$ diagonal). Otherwise, the explicit form of the optimum $X$ seems tricky (cf. the explicit example in my edited OP).
@user35593: I think I'm missing something. Since $S$ is in general not orthogonal, $Y$ is typically non-symmetric. Hence, what does $Y\le \frac{1}{2} I$ mean for a non-symmetric matrix $Y$?