If is a Lie algebra, then a subspace of is said to be a Lie subalgebra if it is closed under the Lie bracket. That is, is a Lie subalgebra of if for all , it follows that (where is the Lie bracket in ).

For example, the vector space of all complex matrices is a Lie algebra with Lie bracket given by the matrix commutator: . The subspace consisting of all traceless complex matrices is a Lie subalgebra of since the trace of a matrix commutator always vanishes.

A Lie subalgebra is said to be an ideal of if for all and , it follows that . It is obvious that every Lie algebra has at least two ideals: namely and itself. These ideals are considered "trivial." For a slightly better example: note that the subalgebra is a non-trivial ideal of if .