Does anybody know how to prove the following statement: Let $A,B\in\mathbb{C}^{n\times n}$ be such that $A^*B=B^*A$. Show that $\det(B+iA)\neq0$ if and only if $\operatorname{rank} (A,B)=n$. It seems to be quite simple but I am not able to finish the proof. I think that I am missing something trivial.
The direction "$\Rightarrow$" is easy: If $\det(B+iA)\neq0$, then also $\det(B^*-iA^*)\neq0$, which yields that $\ker B^*\cap\ker A^*=\{0\}$, which is equivalent to the equality $\operatorname{rank} (A,B)=n$.
But the opposite implication? Let $\operatorname{rank} (A,B)=n$ or equivalently $\ker B^*\cap\ker A^*=\{0\}$ and assume that $\det(B+iA)=0$. Then we have also $\det(B^*-iA^*)=0$, which means that there is a vector $h\in\mathbb{C}^n\setminus\{0\}$ such that $(B^*-iA^*)h=0$, i.e., $B^*h=iA^*h$. If $h\in\ker B^*$ then also $h\in\ker A^*$, and so $h=0$ (a contradiction). Similarly, if $h\in\ker A^*$ then also $h\in\ker B^*$, and so $h=0$ (a contradiction). It remains to get a contradiction in the case when $h$ is such that $0\neq B^*h=iA^*h$. But how to do it?? By the way, so far I did not use the fact that $A^*B=B^*A$.
The statement is not true - the matrices $A=\left(\begin{smallmatrix} 1 & 0\\ 2 & 0\end{smallmatrix}\right)$ and $B=\left(\begin{smallmatrix} 1 & 0\\ 0 & 0\end{smallmatrix}\right)$ provide a counterexample.