I'm going through a linear algebra related proof, and don't understand the following steps. Can someone help me figure out what's going on? In the steps below, $Q\Lambda Q^T$ is an eigenvalue decomposition of a positive-definite symmetric matrix where $Q^{-1} = Q^T$ (I think). The steps are as follows:
(1) $ f(t) = \text{trace}\left(Z^{-1}(I+tQ\Lambda Q^T)^{-1}\right) $
(2) $ f(t) = \text{trace}\left(Z^{-1}Q(I+t\Lambda)^{-1}Q^T\right) $
(3) $ f(t) = \text{trace}\left(Q^T Z^{-1}Q(I+t\Lambda)^{-1}\right)$
My question is twofold: first, how did they get from step (1) to (2)? Can you factor out matrices when the entire thing is inverted? Second, from (2) to (3), what allows the $Q^T$ to get moved to the left side of $Z^{-1}$ ?
I haven't learnt linear algebra in a long long time so any help would be much appreciated!