How to write matrices as a summation? Suppose $U$ is a $m \times n$ real orthonormal matrix, i.e. $U^TU = I_n$, and $D$ is a real $n \times n$ diagonal matrix, and $A$ is a $p \times n$ real matrix, where $p \neq m$. Given a positive scalar $k$, how can I express $$A(UDU^T)^{-1}U(I-D)^kU^T$$
as a summation?
I was thinking that $UDU^T = \sum_{i=1}^n u_id_{ii}u_i^T$, where $u_i$ is the $i$th column of $U$, and $d_{ii}$ is the value of $D$ in the $i$th row, $i$th column. Similarly, $U(I-D)^kU^T = \sum_{i=1}^n u_i(1 - d_{ii})^ku_i^T$. However, I am unsure of how to put everything together.
 A: Let $U\in\mathbb{R}^{m\times n}$ be such that $U^\top U=I_n$. Then $\text{rank}(U)=n$. If $n<m$, then $\text{rank}(UDU^\top)\le n < m$, and since $UDU^\top\in\mathbb{R}^{m\times m}$, this implies that $UDU^\top$ is not invertible. Hence, let us suppose that $n=m$. Then $U$ is invertible with $U^{-1}=U^\top$.
Also note that if $D$ is singular, then $UDU^\top$ is not invertible. Hence, let us also suppose that $D$ is nonsingular. Then we have that
\begin{equation*}
(UDU^\top)^{-1} = (U^\top)^{-1}D^{-1}U^{-1}=UD^{-1}U^\top = \sum_{i=1}^n \frac{1}{d_i}u_i u_i^\top,
\end{equation*}
where $u_i$ is the $i$th column of $U$. Furthermore,
\begin{equation*}
U(I-D)^k U^\top = \sum_{j=1}^n (1-d_j)^k u_j u_j^\top.
\end{equation*}
Therefore,
\begin{align*}
A(UDU^\top)^{-1}U(I-D)^k U^\top &= A\left(\sum_{i=1}^n \frac{1}{d_i}u_i u_i^\top \right) \left(\sum_{j=1}^n (1-d_j)^k u_j u_j^\top\right) \\
&= A \sum_{i,j=1}^n \frac{(1-d_j)^k}{d_i}u_iu_i^\top u_ju_j^\top.
\end{align*}
Since $u_i^\top u_j=0$ for $i\ne j$ and $u_i^\top u_j=1$ for $i=j$, this reduces to
\begin{equation*}
A(UDU^\top)^{-1}U(I-D)^k U^\top = A \sum_{i=1}^n \frac{(1-d_i)^k}{d_i} u_i u_i^\top = \sum_{i=1}^n \frac{(1-d_i)^k}{d_i} A u_i u_i^\top.
\end{equation*}
