How to rewrite matrix formula for Diagonalizable matrix $A=PDP^{-1}$ I am working on an old exam containing a question about Diagonalizable matrix, I am quite confident about the subject overall but there is one simple thing that bothers me, a lot!
We are given the formula $A=PDP^{-1}$ I know from my memory that this can be rewritten as $D=P^{-1}AP$ to solve for D, but I cannot find out how to do it. I have watched a few examples on Wikipedia and in some PDF file that hinted me in the correct direction. 
What I believe,
For example:
$A=PD$ can be rewritten as $AP^{-1}=D$ if this was regular variables, but they are not, they are matrices, and with matrices, you can only put the "latest" number in front of the equation like this:
$A=PD$ can be rewritten as $P^{-1}A=P^{-1}PD=D$ this works fine but with the formula $A=PDP^{-1}$ I get stuck in an infinite loop of moving things in front of the equation and everything becomes a mess. There is clearly something easy I have missed out. Here are my calculations:
$A=PDP^{-1}$
$P^{-1}A=P^{-1}PDP^{-1}$
$P^{-1}A=DP^{-1}$
Now I want to get rid of $P^{-1}$ from the right-hand side but since I can only but things in front of D, everything gets messy and I get stuck in a never-ending loop of making things more complicated and adding $PP^{-1}=I$ to the equation hoping it would help but it doesn't :(


I know from my memory that this can be rewritten as $D=P^{-1}AP$ to solve for D, but I cannot find out how to do it.

We start with the identity $A=PDP^{-1}$.
Begin by multiplying both sides on the left by $P^{-1}$ and then on the right by $P$, then make use of the properties that


*

*For any invertible matrix $A$, $AA^{-1} = A^{-1}A = I$.

*For all square matrices $A$, we have $AI=IA=A$.

*Matrix multiplication is associative, i.e. $ABC = (AB)C = A(BC)$, where the multiplicative is assumed to be defined for the matrices $A,B,C$.


So, we obtain,
$$\begin{align}
A=PDP^{-1} &\iff P^{-1}AP=P^{-1}PDP^{-1}P \\
&\iff P^{-1}AP=(P^{-1}P)D(P^{-1}P) = IDI = D
\end{align}$$
Thus,
$$P^{-1}AP = D$$
