Not unique in general. For any invertible matrix ,is another rank factorization, with the same full ranks. This is a change of basis in the intermediate -dimensional space. For example, even has different full-rank factors. Once a particular ordered basis is fixed, its coordinate matrix is unique; it is the basis choice that creates the freedom.
Choose independent columns of that form a basis of its column space, and put them in . For each column of , let be its coordinate vector in that basis; put these coordinate vectors in . The column equations give .
By construction has full column rank . The columns of corresponding to the selected basis columns are the standard vectors of , so has full row rank . This proves the requested rank factorization. When , and the corresponding empty-column and empty-row factors have the required shapes and rank zero.
For the first matrix choose its single independent column:Their product has every column equal to , and both factors have rank one.
For the second matrix, the first and third columns are independent and the second equals the first, givingMultiplication reconstructs the stated matrix. The first factor has independent columns and the second has independent rows, so both have matrix rank two, as required for a rank factorization.
Let . If , the matrix is zero and the identity is immediate. Otherwise choose the rank factorization from part b. The column space of is the image of .
An idempotent matrix acts as the identity on its image: if , then . Applying this to each column of gives . Substituting yields . Since has full column rank, the represented map is injective, so each column of is zero. Thus .
Now the rectangular cyclic property of the trace givesThis proves that the trace of an idempotent equals its rank using the supplied factorization method. Orthogonality of the projection is unnecessary: the argument applies to every real idempotent matrix.