Theorem (IsIdempotentElem.exists_conjTranspose_mul_mul_eq_fromBlocks). Unitary canonical form of an idempotent. In an orthonormal basis of the range and its orthogonal complement, the diagonal blocks are the identity and zero. The rectangular upper-right block is diagonal with entries \sqrt{\sigma_i(\mathbf{P})^2-1}. [HornJohnson2013, Corollary 3.4.3.3].
Headline General form: sizes are index types
Lean statement and details
IsIdempotentElem.exists_conjTranspose_mul_mul_eq_fromBlocks.{u_1, u_2} {𝕜 : Type u_1} [RCLike 𝕜]
{n : Type u_2} [Fintype n] {P : Matrix n n 𝕜} (hP : IsIdempotentElem P) {s : ℕ}
(hc : P.rank + s = Fintype.card n) :
∃ H,
HasOrthonormalCols H ∧
Hᴴ * P * H =
fromBlocks 1 (of fun i j ↦ if ↑i = ↑j then ↑√(singularValues P ↑i ^ 2 - 1) else 0) 0 0