Matrix with nonnegative symmetric part and semisimplicty of the eigenvalue 0 Let B be a real square matrix with non-negative symmetric part, i.e. for all vectors $X$, $X^\top B X\geq 0$. We also assume that $B$ is singular. I am wondering if the eigenvalue $0$ of $B$ is necessary semi-simple, i.e. is the dimension of the kernel of $B$ equal to algebraic multiplicity of the eigenvalue $0$.
I am unable to prove it, nor I am able to find a counterexample. A counterexample would necessary be non-symmetric, and of dimension at least $3$, and at this point, the differences between diagonalising the matrix $B$ and the quadratic form $X^\top BX$ are wrecking my brain.

I came back to this and found the answer: yes, if $B$ is singular and has nonnegative symmetric part, then the eigenvalue $0$ of $B$ is semisimple. This relies on the following observations:
Claim 1: If $0$ is not a semisimple eigenvalue of $B$, then the resolvent $R(z) = (B-z)^{-1}$ has a pole of order at least two at zero.
Claim 2: If $B$ has nonnegative symmetric part, then there exists $C>0$ such that for $z$ small enough, $\|R(z)\|\leq C|z|^{-1}$.
We use the following standard theorem:
Proposition: if there exists $c>0$ such that for all vectors $X$, $|AX|\geq c|X|$, then $A$ is nonsingular, and if $c$ is the greatest real that satisfies the previous inequality, then $\|A^{-1}\| = c^{-1}$.
Proof of claim 1: By assumption, $\ker(B)\neq \ker(B^n)$, so let us choose $X_0\neq 0$ such that $ BX_0\neq 0$ and $B^2 X_0 = 0$. Then, for $z\in\mathbb C^\ast$,
$$(B-z)(BX_0-zX_0) = -z^2X_0.$$
Since for $z$ small $|BX_0-zX_0|\geq c>0$, this implies that for $z$ small $\|R(z)\|\geq \frac{c}{|X_0|}|z|^{-2}$.
Proof of claim 2: We have for all $z\in(-\infty,0)$ and vector $X$:
\begin{align*}
|(B-z)X|^2 &= ((B-z)^\ast(B-z)X|X)\\
&=(B^\ast BX|x)-\bar z(BX|X) - z(B^\top X|X) + |z|^2(X|X)\\
&= |BX|^2 -z((B^\top+B)X|X) + |z|^2|X|^2\qquad\text{since }\bar z =z\\
&\geq |z|^2|X|^2\qquad\text{since }z<0
\end{align*}
So, for $z<0$, $\|R(z)\|\leq |z|^{-1}$. Now if we write the resolvent as a Laurent series $R(z) = \sum_{k=-n}^{+\infty}R_k z^k$, the previous inequality implies that $R_{-n} = R_{-n+1}=\dots=R_{-2} =0$, which concludes the proof. (Note: we can find the fact that for $k<-n$, $R_k = 0$ in Kato's "Perturbation theory for linear operators" p. 39 eqs. (5.18) and (5.20).)
