Factorization of a positive semi-definite matrix based on null space bases When I read papers, I found a confusing conclusion which I don't really know how to obtain. Suppose $A$ and $B$ are two $n$-dimensional positive semi-definite matrix, and $AB=0$. Furthermore, we know Rank(A)=$r$. Let $C=[c_1,c_2,...,c_{n-r}]$ with $C^HC=I$ denote the orthogonal basis for the null space of $A$. The conclusion is $B$ can be expressed as $B=\sum_{1}^{n-r}k_{i}c_{i}c_{i}^H$, where $k_{i}\ge 0$. How to demonstrate that?
 A: The statement is not quite true in its current form. Here is a true version of the statement:

Suppose $A$ and $B$ are two $n$-dimensional positive semi-definite matrix, and $AB=0$. Furthermore, we know Rank(A)=$r$. Then, there exists an orthogonal basis $C=[c_1,c_2,...,c_{n-r}]$ for the null space of $A$ such that $B$ can be expressed as $B=\sum_{1}^{n-r}k_{i}c_{i}c_{i}^H$, where $k_{i}\ge 0$.

Here is one approach to proving this.
We are given that $A,B$ are positive semidefinite and that $AB = 0$. It follows that $BA = (AB)^H = 0$. Thus, $A,B$ are Hermitian matrices that satisfy $AB = BA$, which means that they can be simultaneously unitarily diagonalized. That is, there exists a unitary matrix $U$ such that both $U^HAU$ and $U^HBU$ are diagonal. Because $AB = 0$, we must have
$$
A = \pmatrix{\lambda_1\\ & \ddots \\ &&\lambda_r\\ &&& 0 \\ &&&& \ddots \\&&&&& 0}, \quad 
B = \pmatrix{0\\ & \ddots \\ && 0\\ &&& k_1 \\ &&&& \ddots \\&&&&& k_{n-r}}
$$
for some positive values $\lambda_1,\dots,\lambda_r$ and non-negative $k_1,\dots,k_{n-r}$. Let $u_1,\dots,u_n$ denote the columns of $U$. We can see from the diagonal forms of $U^HAU$ and $U^HBU$ that the columns $u_1,\dots,u_r$ form a basis for the image of $A$ and the columns $u_{r+1},\dots,u_{n}$ form a basis for its nullspace. Moreover, with block matrix multiplication, we can express
$$
B = U[U^HBU]U^H = \sum_{i=1}^{n-r} k_i\, u_{r+i}u_{r+i}^H.
$$

A counterexample to the original statement: consider
$$
A = \pmatrix{1&0&0\\0&0&0\\0&0&0}, \quad B = \pmatrix{0&0&0\\0&1&1\\0&1&1}, \quad C = \pmatrix{c_1 & c_2} = \pmatrix{0&0\\1&0\\0&1}.
$$
It is true that $A$ and $B$ are positive semidefinite with $AB = 0$, but there do not exist constants $k_i$ for which $B = k_1 \,c_1c_1^H + k_2\,c_2c_2^H$. Indeed, every matrix that can be expressed in this fashion is diagonal, but $B$ is not.
