# How to define the following bracket?

My quetion is about the definition of the so-called Courant Bracket.

Given two generalised vector field, defined as a formal sum of a vector and a one-form, i.e. $X = x + \lambda,\ Y = y + \omega$, the Courant bracket is defined as follows,

$$\left[\vert X, Y \vert \right] := \mathcal{L}_x y + \mathcal{L}_x \omega - \mathcal{L}_y \lambda - \frac{1}{2}\mathrm{d}\left(\iota_x \omega + \iota_y \lambda \right)\, .$$

Now, my problem is to write down a mathematica function defining this bracket. I use the packages EDCRGTCcode, matrixEDC and xCore. I would like to write something that given the generalised vectors, takes the "vector" part (i.e. the first $d$ components, if we are in a manifold of dimension $d$), the "form" part and use them separately.

    Courant[X_, Y_] := Module[{dim, x, y, \[Lambda], \[Omega]},