Solution (source code)

= Solution

The <matrix product> is $Pa=a-a(a^Ta)-b(b^Ta)=a-a=0$. Thus $\boxed{Pa=0}$, and the nonzero <vector> $a$ is in its <kernel>. Hence $P$ is singular and $\boxed{\det P=0}$. This includes $n=2$, when $a,b$ span the whole space and $P=0$.