Defining a filtration on free Lie algebra in terms of generators Let $L$ be the free Lie algebra generated by the set $X = \{x_i\}_{i \in \mathbb{N}}$ over a field $k$. A Lie monomial is a bracketed word of elements of $X$ of finite length, and $L$ is spanned by the Lie monomials. I would like to introduce a filtration of $L$  by ideals $L^{(n)}$ in the following way.
Introduce a weight $w$ on the generators  $x_i \in X$  such that $w(x_i) = s$, if $(s-1)p < i \leqslant sp$ (for some fixed prime $p$). For example, the generators $x_1, \ldots , x_p$ are of weight one, and the generators $x_{p+1}, \ldots , x_{2p}$ are of weight two, etc.
What I would like to do, speaking naïvely, is to extend the weight to Lie monomials, that is for an element $[x_{i_1}, \ldots , x_{i_m}] \in L$ (non-zero, and with arbitrary order of bracket)  to define its weight as $\left(\sum_{1 \leqslant j \leqslant m}w(x_{i_j})\right)$.
The problem I have is that the Lie monomials are not linearly independent, so it is not clear to me whether this is well defined or not.
Assuming I can define the weight of a Lie monomial as above, the goal is to define for any $n \geqslant 1$ an ideal $L^{(n)} \subset L$ such that $L^{(n)}$ is spanned by all Lie monomials of weight $\geqslant n$.
I have to admit to not being  very familiar with Lie algebras, so I may be missing something fundamental, but I have tried to think along the following lines.
We can construct a basis of $L$ from the generating set $X$ by means of a Hall basis, the basis is given by basic commutators of the generators $x_i$, and as these basic commutators are linearly independent then we can their weight inductively by $w([u,v]) = w(u) + w(v)$.  In this way we can obtain a basis   $\mathcal{B} = \{ b_i\}_{i\in \mathbb{N}}$ of $L$ where all $b_i$ are basic commutators. A general element of $L$ is a linear combination $\sum_{i\geqslant 0}k_ib_i$, where $k_i \in k$, and $k_i = 0$ for all but finitely many $i$. We can define the weight of a general element  $l \in L$ as $w(0) = \infty$ and $w(l) = \min\{ w(b_i): k_i\neq0  \}$ for non zero $l$.
The issue is that the basis is still somehow inexplicit, so that for a general Lie monomial $[x_{i_1}, \ldots , x_{i_m}]$ I still need to express it as a linear combination of basic commutators in order to determine its weight. Suppose $l = [x_{i_1}, \ldots , x_{i_m}]$ is a Lie monomial such that  $\left(\sum_{1 \leqslant j \leqslant m}w(x_{i_j})\right) = n$. If $l$ is a basic commutator then certainly $w(l) = n$, but if $l$ is not a basic commutator then is it the case that $l$ is necessarily a linear combination of basic commutators of weight $\geqslant n$?
I've started to look at the Poincare-Birkhoff-Witt theorem, to see if the question is more easily considered in the (associative) universal enveloping algebra of $L$, but being unfamiliar with this area I thought I would swallow my pride and see if anyone might be able to provide me with some pointers!
Thanks in advance for any advice. Please do add a comment if anything isn't clear.
 A: Yes, the universal enveloping algebra is really useful here.
Let us denote the free Lie algebra on a set $X$ by $F(X)$.

*

*It follows from the PBW-theorem that for every Lie algebra $L$ the canonical homomorphism $L \to \mathrm{U}(L)$ is injective.


*Given any set $X$, the canonical map $X \to F(X)$ satisfies a certain universal property: for every Lie algebra $L$, every map $X \to L$ extends uniquely to a homomorphism of Lie algebras $F(X) \to L$.
Given any Lie algebra $L$, the canonical homomorphism $L \to \mathrm{U}(L)$ satisfies a similar universal property:
for ever algebra $A$, every homomorphism of Lie algebras $L \to A$ extends uniquely to a homomorphism of algebras $\mathrm{U}(L) \to A$.
We can combine these universal properties:
Let $X$ be a set.
For every algebra $A$, every map $X \to A$ extends uniquely to a homomorphism of algebras $\mathrm{U}(F(X)) \to A$ along the map $X \to F(X) \to \mathrm{U}(F(X))$.
In other words, the algebra $\mathrm{U}(F(X))$ together with the map $X \to F(X) \to \mathrm{U}(F(X))$ is the free algebra on the set $X$.
We have an explicit description of the free algebra on a set $X$:
it is the noncommutative polynomial algebra $⟨X⟩ = ⟨x \mid x ∈ X⟩$.
More explicitly, the algebra $⟨X⟩$ has all words $x_1 \dotsm x_n$ with $n ≥ 0$ and $x_1, \dotsc, x_n ∈ X$ as a vector space basis, and multiplication of two such words is given by concatenation.
The words $x_1 \dotsm x_n$ are noncommutative monomials.
The inclusion map $X \to ⟨X⟩$ induces a homomorphism of Lie algebras $F(X) \to ⟨X⟩$, which in turn induces a homomorphism of algebras $φ \colon \mathrm{U}(F(X)) \to ⟨X⟩$.
This is an isomorphism of algebras since both $X \to \mathrm{U}(F(X))$ and $X \to ⟨X⟩$ share the same universal property and $φ$ is the unique homomorphism of algebras compatible with these maps.
We know that $F(X) \to \mathrm{U}(F(X))$ is injective, so $F(X) \to ⟨X⟩$ is injective.
As a consequence, we get the following explicit model for the free Lie algebra $F(X)$:

Let $X$ be a set.
Let $F(X)$ be the Lie subalgebra of $⟨X⟩$ generated by the set $X$ (i.e., the Lie subalgebra generated by all the variables $x ∈ X$).
The Lie algebra $F(X)$ together with the inclusion map $X \to F(X)$ is the free Lie algebra on $X$.

Suppose now that we have for every element $x$ of $X$ some integer weight $w(x)$.
For every monomial $x_1 \dotsm x_n$ we then define its weight as
$$
  w(x_1 \dotsm x_n) ≔ w(x_1) + \dotsb + w(x_n) \,.
$$
We get an induced vector space decomposition
$$
  ⟨X⟩ = \bigoplus_{p ∈ ℤ} ⟨X⟩_p \,,
$$
where $⟨X⟩_p$ is the linear subspace of $⟨X⟩$ spanned by all monomials of weight $p$.
We can say more generally that the elements of $⟨X⟩_p$ are homogeneous of weight $p$.
This decomposition makes $⟨X⟩$ into a graded algebra, i.e., we have
$$
  ⟨X⟩_p ⋅ ⟨X⟩_q ⊆ ⟨X⟩_{p + q}
$$
for all $p, q ≥ 0$.
This entails that
$$
  [ ⟨X⟩_p, \, ⟨X⟩_q ] ⊆ ⟨X⟩_{p + q}
  \tag{$\ast$}
$$
for all $p, q ≥ 0$.
We have therefore a grading on $⟨X⟩$ as a Lie algebra.
Let now $L ≔ F(X)$ be the free Lie algebra on $X$, regarded as the Lie subalgebra of $⟨X⟩$ generated by the set $X$.
As a vector space, $L$ is spanned by Lie monomials.
The elements of $X$ are homogeneous in $⟨X⟩$, so it follows by induction that every Lie monomial $[x_1, \dotsc, x_n]$ (with whatever bracketing) is homogeneous of weight $w(x_1) + \dotsb + w(x_n)$.
Therefore, $L$ is spanned by homogeneous elements as a vector space.
It follows that the decomposition $⟨X⟩ = \bigoplus_{p ∈ ℤ} ⟨X⟩_p$ restricts to a decomposition
$$
  L = \bigoplus_{p ∈ ℤ} L_p \,,
$$
where $L_p$ is spanned by all Lie monomials of weight $p$.
It follows from $(\ast)$ that we have $[L_p, L_q] ⊆ L_{p + q}$ for all $p, q ∈ ℤ$.
We have overall seen that for every choice of weights $w \colon X \to ℤ$ we get a grading $L = \bigoplus_{p ∈ ℤ} L_p$ (of vector spaces) such that any element $x$ of $X$ is contained in $L_{w(x)}$, and $[L_p, L_q] ⊆ L_{p + q}$ for all $p, q ∈ ℤ$.
This entails that every Lie monomial is homogeneous of the expected degree.
