Center of of a subalgebra of a lie algebra: Under what conditions is $Z(\mathfrak{h})=Z(\mathfrak{g})\cap \mathfrak{h}$ I am aware this is about the same question as this question. But I do not believe this is a duplicate post. I am looking to understand some properties about the center and am using this question is a good example. I want to know:

(1) Under what conditions is do we have for $\mathfrak{h}\subset \mathfrak{g}$ to imply $Z(\mathfrak{h})=Z(\mathfrak{g})\cap \mathfrak{h}$


(2) How does the argument I link to conclude that $Z(\mathfrak{sl}(n,F))=Z(\mathfrak{gl}(n,F))\cap \mathfrak{sl}(n,F)$

Since (1) is true in the case of $\mathfrak{sl}(n,F)\subset\mathfrak{gl}(n,F)$ I feel trying to understand an argument which shoes this will help tease out what conditions are needed for the general case. There is a question in Humphreys that asks us:

To show that $\mathfrak{sl}(n,F)$ (matrices with trace zero) has center $0$, unless $\operatorname{char}F$ divides $n$, in which case the center is $\mathfrak{s}(n,F)$ (scalar multiples of the identity).

Some facts that will be useful are that the $Z(\mathfrak{gl}(n,F))$ is $\mathfrak{s}(n,F)$. Also  $\mathfrak{gl}(n,F)=\mathfrak{sl}(n,F)+\mathfrak{s}(n,F)$ as vector spaces.
Here is an argument taken from this document of solutions which claims that $Z(\mathfrak{sl}(n,F))=Z(\mathfrak{gl}(n,F))\cap \mathfrak{sl}(n,F)$.:

I will rewrite the argument to show my confusion.
If $c\in Z(\mathfrak{sl}(n,F)$ then $[x,c]=0$ for all $x\in \mathfrak{sl}(n,F)$.
Obviously $c\in \mathfrak{gl}(n,F)=\mathfrak{sl}(n,F)+\mathfrak{s}(n,F)$, but I do not see why this means that $c\in Z(\mathfrak{gl}(n,F)$. I do not see then why it follows that $Z(\mathfrak{sl}(n,F))=Z(\mathfrak{gl}(n,F))\cap \mathfrak{sl}(n,F)$.
 A: Let's first look at the question in your last paragraph. I claim you can easily generalise the argument to:
(*) If $\mathfrak g = \mathfrak h + \mathfrak a$ such that $\mathfrak a$ commutes with $\mathfrak h$, then $Z(\mathfrak h) \subseteq Z(\mathfrak g)$ (and the opposite inclusion is always true anyway).
Namely, let $c \in Z(\mathfrak h)$ and $x \in \mathfrak g$; by assumption, we can write $x=h+a$ for $h \in \mathfrak h, a \in \mathfrak a$ and we have
$$[c, x]=\underbrace{[c,h]}_{0 \text{ bc. } c\in Z(\mathfrak h)}+\underbrace{[c,a]}_{0 \text{ bc. } \mathfrak a \text{ comm. w. } \mathfrak h}=0.$$
This (*) is a sufficient but not necessary criterion which settles question (2).
As for the general question (1), first note that $Z(\mathfrak h) \supseteq Z(\mathfrak g) \cap \mathfrak h$ is always true for $\mathfrak h \subseteq \mathfrak g$, and of course $Z(\mathfrak h) \subseteq \mathfrak h$, so the question boils down to when
$$Z(\mathfrak h) \stackrel{?}\subseteq Z(\mathfrak g).$$
(Examples where this is not the case abound. E.g. take any non-zero $\mathfrak g$ which has centre $0$, and $\mathfrak h =$ the one-dimensional (hence abelian!) subalgebra spanned by a non-zero element.)
Inspecting our argument for (*) from the beginning shows that actually we do not need that $\mathfrak a$ commutes with all of $\mathfrak h$, but only with $Z(\mathfrak h)$; further, we don't need $\mathfrak a$ to be a subalgebra, we just need to write every element $x \in \mathfrak g$ as
(something in $\mathfrak h$ + something that commutes with $Z(\mathfrak h)$).
So a less restrictive sufficient criterion for what we want is:

There is a vector space complement $A$ of $\mathfrak h$ in $\mathfrak g$ such that every element of $A$ commutes with every element of $Z(\mathfrak h)$.

Note this is true for one vector space complement iff it is true for every vector space complement. Namely, as soon as there is $x \in \mathfrak g \setminus \mathfrak h$ and $z \in Z(\mathfrak h)$ such that $[x, z] \neq 0$, we have $z \notin Z(\mathfrak g)$. Another way to express it is to see that $\mathfrak h$ naturally acts on the (vector space) quotient $V:=\mathfrak g/\mathfrak h$ and to say

$Z(\mathfrak h)$ acts trivially on $\mathfrak g/\mathfrak h$.

So there's a criterion. If it's nicer/easier/more useful than just writing $Z(\mathfrak h) = Z(\mathfrak g)$ depends on taste/context.
Finally, as an example for my claim that what we used at the beginning for (2), criterion (*) which we can now phrase as

(*) $\mathfrak h$ acts trivially on $\mathfrak g/\mathfrak h$,

is a sufficient but not necessary criterion: Take $\mathfrak g = \mathfrak{sl}_{n\ge 2}(\mathbb C)$ and $\mathfrak h = $ upper triangular matrices in $\mathfrak g$. You'll find that actually $Z(\mathfrak h) =Z(\mathfrak g) = 0$, but every non-zero element of $\mathfrak h$ acts non-trivially on $\mathfrak{g}/\mathfrak h$ (which can be identified with the strict lower triangular matrices).
