It is well known that for compact and connected Lie groups, one can calculate the de Rham cohomology $H^{k}(G)$ using either the subcomplex of left-invariant forms, which leads to the calculation of cohomology groups $H^{k}(\mathfrak{g},\mathbb{R})$, or even better, to the calculation using the subcomplex of bi-invariant forms, which are all closed and the cohomology thus corresponds precisely to the spaces $(\Lambda^{k} \mathfrak{g}^{\ast} )^{\mathfrak{g}}$ of ad-invariant skew-symmetric $k$-forms on Lie algebra $\mathfrak{g}$.
My problem is the following:
Let us forget about Lie group $G$, consider only Lie algebra $\mathfrak{g}$ and its associated cochain complex $(C^{\bullet}(\mathfrak{g},\mathbb{R}),\delta)$, where $C^{k}(\mathfrak{g},\mathbb{R}) = \Lambda^{k} \mathfrak{g}^{\ast}$ and $\delta: \Lambda^{k} \mathfrak{g}^{\ast} \rightarrow \Lambda^{k+1} \mathfrak{g}^{\ast}$ is defined by the usual formula, see e.g. https://en.wikipedia.org/wiki/Lie_algebra_cohomology.
One can still consider a subcomplex $C^{\bullet}_{ad}(\mathfrak{g},\mathbb{R})$ consisting of ad-invariant forms, that is $C^{k}_{ad}(\mathfrak{g},\mathbb{R}) = ( \Lambda^{k} \mathfrak{g}^{\ast})^{\mathfrak{g}}$, and calculate directly that all its elements are $\delta$-closed. It is thus trivial to find the corresponding cohomology groups as $H^{k}_{ad}(\mathfrak{g},\mathbb{R}) = (\Lambda^{k} \mathfrak{g}^{\ast})^{\mathfrak{g}}.$
Let $\eta: (\Lambda^{k} \mathfrak{g}^{\ast})^{\mathfrak{g}} \rightarrow \Lambda^{k} \mathfrak{g}^{\ast}$ be the inclusion. For Lie algebras of compact Lie groups, this map induces an isomorphism $\eta_{\ast}: H^{k}_{ad}(\mathfrak{g},\mathbb{R}) \cong H^{k}(\mathfrak{g},\mathbb{R})$.
However, as this is a purely algebraic setting, I would like to ask:
1) Is it possible that this statement works for a wider class of Lie algebras?
2) Are there some counter-examples where this does not work at all?
3) Is there some way how to prove the statement (for compact Lie groups) directly, without employing the averaging over $G$ to show that entire de Rham cohomology can be calculated either from the subcomplexes of left-invariant or bi-invariant forms on G?
Thanks, Jan
Edit: I may have found myself a counterexample. Consider $3$-dimensional Lie algebra given in basis $(t_{1},t_{2},t_{3})$ in by commutation relations
$[t_{1},t_{2}] = 0, \ \ [t_{2},t_{3}] = t_{1}, \ \ [t_{3},t_{1}] = 0$.
Consider the space $C^{2}(\mathfrak{g},\mathbb{R})$. For $\beta$ in this space, we have
$(\delta \beta)(t_{1},t_{2},t_{3}) = - \beta([t_{1},t_{2}],t_{3}) - \beta([t_{3},t_{1}],t_{2}) - \beta([t_{2},t_{3}],t_{1}) = 0$
This proves that every $2$-cochain is a $2$-cocycle. On the other hand, for $\alpha \in C^{1}(\mathfrak{g},\mathbb{R})$, one has $\delta \alpha = - \alpha(t_{1}) \; t^{2} \wedge t^{3}$, which shows that $H^{2}(\mathfrak{g},\mathbb{R}) \cong span( t^{1} \wedge t^{2}, t^{3} \wedge t^{1} ) \cong \mathbb{R}^{2}$.
On the other hand, the space $( \Lambda^{2} \mathfrak{g}^{\ast})^{\mathfrak{g}}$ is one-dimensional, namely $( \Lambda^{2} \mathfrak{g}^{\ast})^{\mathfrak{g}} = \mathbb{R}( t^{2} \wedge t^{3})$. Moreover, we see that $\eta_{\ast}$ sends $(\Lambda^{2} \mathfrak{g}^{\ast})^{\mathfrak{g}}$ onto a zero class $[0] \in H^{2}(\mathfrak{g},\mathbb{R})$, and is thus definitely not a vector space isomorphism.