Suppose I have a diagonalizable matrix $A$, such that $D = P^{-1}AP$
Can I apply an element-wise function $f$ and expect that $f(D)=P^{-1}f(A)P$, assuming $f$ is not a linear transofrmation? Or in other words, is $f(P^{-1}AP) = P^{-1}f(A)P$?
Suppose I have a diagonalizable matrix $A$, such that $D = P^{-1}AP$
Can I apply an element-wise function $f$ and expect that $f(D)=P^{-1}f(A)P$, assuming $f$ is not a linear transofrmation? Or in other words, is $f(P^{-1}AP) = P^{-1}f(A)P$?
No; Let $$A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}$$
and let $f$ be elementwise squaring, so
$$f(A) = \begin{pmatrix} 1 & 4 \\ 9 & 16 \end{pmatrix},$$
but
$$ P^{-1}f(A)P = \begin{pmatrix} -0.6391... & -3.9826... \\ -2.1914... & 17.6391... \end{pmatrix} $$
which isn't even diagonal.
I would venture a guess that this isn't true for almost any $A$ and $f$ you could come up with.
However, it is true for the characteristic polynomial, or any polynomial for that matter (which are not element-wise functions). Note that $$D^n = P^{-1}APP^{-1}AP\dots P^{-1}AP = P^{-1}A^nP $$
and so if $f(A) = \sum_{n=1}^N a_n A^n$, then $f(D) = P^{-1}f(A)P$.