A differential Lie algebra is defined by first using the constructor lieAlgebra with the option lieAlgebra(...,LastWeightHomological=>...) set to true to define a free Lie algebra $F$. Hereby, the last weight is the homological degree, and it must be nonnegative and less than the first degree. Next define the differential Lie algebra $D$ using differentialLieAlgebra with input the list of differentials of the generators with values in $F$. The differential should preserve all weights except the homological degree, which is lowered by 1, and it also changes the sign. All this is checked to be true when differentialLieAlgebra is executed. The value zero for a generator is given as $0_F$, which has any weight and sign (see however weight and sign). The program adds (nonnormalized) relations to the Lie algebra to get the square of the differential to be 0.






There is a unique extension to a derivation $d$ on the free Lie algebra $F$ given the values of $d$ on the generators. This map induces a derivation with square zero on the differential Lie algebra $D$ (which might have some relations). The differential is obtained using differential applied to $D$. The value of the differential $d$ applied to an arbitrary Lie element $x$ in $D$ is obtained as $d(x)$.



It is possible to define quotients of a differential Lie algebra in the same way as for ordinary Lie algebras. The program adds (nonnormalized) relations to obtain that the ideal is invariant under the differential.




The homology as a vector space can be obtained using lieHomology. Bases and dimensions in different degrees are obtained using basis(ZZ,ZZ,VectorSpace) and dims(ZZ,VectorSpace). The output of the latter is a matrix consisting of dimensions of the vector space for different first degrees and last degrees. The basis elements for the homology are represented as cycles in the Lie algebra. The set of boundaries and the set of cycles are subalgebras of the Lie algebra, and they are obtained using boundaries and cycles, and bases and dimensions of them are obtained in the same way as for homology.








It follows from the result above that a basis for the cycles of weight (4,1) is \{b a c, a b c\}.

The product of a cycle and a boundary is a boundary:


In weight (3,1) there are two independent cycles and no boundaries:


In weight (5,1) all elements are boundaries, so the homology is 0, which is seen in the table above. In weight (5,2) there are no cycles.





