Let $\|x\|_B\mathrel{\mathop:}=\sqrt{x^{t}Bx}$, where $B \in \mathbb{R}^{n\times n}$ is a symmetric and positive semidefinite matrix. If $\mid x\mid = (|x_1|,|x_2|,\ldots,|x_n|)$, I want to show that $\|x\|_B=\||x|\|_B, \forall x \in \mathbb{R}^n \iff B$ is diagonal.
I was thinking about a proof by contradiction:
$\Rightarrow:$ If $B$ is not diagonal, $\exists\space i\neq j$ such that $B_{ij}\neq0$. Now, I don't know how to complete the implication;
$\Leftarrow:$ If exists a $x \in \mathbb{R^n}$ such that $\|x\|_B\neq\|\mid x\mid\|_B$, than we have $\|\mid x\mid\|_B>\|x\|_B$. But how this implies that $B$ is not diagonal?
Suggestions to complete the proof or do this using another way?
Let $e_i$ be an indicator (zero everywhere, 1 at the ith position) For any $i, j$ such that $i \neq j$, by the problem assumption, we have $(e_i +e_j)^TB (e_i+e_j)= (e_i -e_j)^TB (e_i-e_j)$.
So $B_{ii}+ B_{jj}+ 2 B_{ij}= B_{ii}+B_{jj}-2B_{ij}, \forall i \neq j$, So $B_{ij}=0$.