Solution (source code)

= Solution

By the <spectral theorem>, the <Hermitian matrix> $A$ has a complete <orthonormal eigenbasis>. If $Av=\lambda v$, idempotence gives $\lambda^2=\lambda$, so every <eigenvalue> is zero or one. Since $\det A\ne1$, at least one is zero. Therefore
$$
\boxed{\det A=0,\qquad\operatorname{tr}A=m=\operatorname{rank}A\in\{0,1,\ldots,n-1\}.}
$$
The <trace of an idempotent equals its rank>; here Hermiticity further identifies $A$ as an <orthogonal projection matrix>.

A complex <inner product> $\langle u,v\rangle$ is conjugate-linear in its first argument, linear in its second, conjugate symmetric and positive definite: $\langle v,u\rangle=\overline{\langle u,v\rangle}$ and $\langle u,u\rangle>0$ for nonzero $u$. An <orthonormal basis> is a spanning linearly independent family $e_i$ with $\langle e_i,e_j\rangle=\delta_{ij}$. The associated <norm> is $\|u\|=\sqrt{\langle u,u\rangle}$.

For two distinct basis elements $x,y$, their <orthogonality> and unit norms give $\|x-y\|^2=\langle x,x\rangle+\langle y,y\rangle-\langle x,y\rangle-\langle y,x\rangle=2$. Hence \b[their distance is $\sqrt2$]; if the same element is selected twice, it is zero.

Finally, for $B^\dagger=B$, the scalar quadratic form obeys $(x^\dagger Bx)^*=x^\dagger B^\dagger x=x^\dagger Bx$, proving \b[$x^\dagger Bx$ is real].