Suppose $k$ is some algebraically closed field whose characteristic does not divide $n$. Why can we identify the lie algebras $\mathfrak{pgl}_n\simeq\mathfrak{sl_n}$ of the projective linear group and special linear group?
I know $$ \operatorname{Lie}(PGL_n)\simeq\operatorname{Lie}(GL_n)/\operatorname{Lie}(Z(GL_n))\simeq\mathfrak{gl}_n/\{cI_n:c\in k\} $$
but I'm having trouble seeing why this last quotient is isomorphic to $\mathfrak{sl}_n$, and why $\operatorname{char}(k)\nmid n$ is needed. This came up while looking at the structure of $PGL_2$ to study $1$-dimensional semisimple algebraic groups.