How to prove if $B$ commutes with a positive semidefinite matrix $A$, then $B$ commutes with $\sqrt A$.
The logic of notes I refer to is like this: first if A is positive semidefinite, then $$\sqrt A=\text{polynomial of } A\\ =P\begin{pmatrix}\sqrt{\lambda_1}&&\\&\sqrt{\lambda_2}\\&&\ddots\end{pmatrix}P^T.$$ And by this theorem we can deduce that if $B$ commutes with a positive semidefinite matrix $A$, then $B$ commutes with $\sqrt A$. Using the fact that if $B$ commutes with $A$, then B commutes with some polynomials of $A$. But actually I don't quite understand what is a polynomial of a matrix. And how can we show that if $B$ commutes with $A$, then B commutes with some polynomials of $A$.