Generators of associated graded algebra Suppose that $A = \bigcup_{n=0}^{\infty} A_n$ is a filtered algebra over a field $k$.  The associated graded algebra is $\mathrm{gr} A = \bigoplus_{n=0}^{\infty} A_n/A_{n-1}$, where we define $A_{-1} = (0)$.  There is no canonical algebra map from $A$ to $\mathrm{gr} A$, but there is a well-defined function $\gamma : A \to \mathrm{gr} A$ given by
$$
\gamma(x) = x + A_{n-1} \in A_n/A_{n-1},
$$
where $n$ is the unique natural number (or 0) such that $x \in A_n$ but $x \notin A_{n-1}$.  (To forestall nitpicking, let's say that $\gamma(0) = 0 \in A_0$.)  Of course, this map fails to be even additive, but it does exist.
Question:
Given a set of generators $\{x_i\}$ for $A$, when is it the case that the set $\{\gamma(x_i)\}$ generates $\mathrm{gr} A$?
Here is an easy example where this fails to happen.  Let $\mathfrak{h}$ be the 3-dimensional Heisenberg Lie algebra (over $\mathbb{C}$, say), spanned by three elements $X,Y,Z$ with $[X,Y] = Z$ and $Z$ central.  Let $A = U(\mathfrak{h})$ be its universal enveloping algebra with the usual filtration.  Since $XY - YX = Z$, it follows that $A$ can be generated just by $X$ and $Y$.  But Poincare-Birkhoff-Witt tells us that
$\mathrm{gr} A \cong \mathbb{C}[X,Y,Z]$, which is certainly not generated just by $X$ and $Y$.
The problem here is with the relation $XY-YX=Z$: since $Z$ has lower degree than $XY$ and $YX$, it drops out of the relation in the associated graded.
Can anything be said about this, in general?  Are there any nice criteria on the filtration and the generating set (and the relations, obviously) that ensure things don't go wrong in this way?  Also I am amenable to making assumptions on the algebra $A$, for example that it is finitely generated or Noetherian (or ...?), if that helps.  I do not want to increase the size of the generating set.
 A: This question was posted some time ago but it's never been answered properly, so it seems worthwhile to record the answer anyway. In short, when $A$ is finitely generated, the associated graded is generated by the elements you describe if and only if the filtration is inherited from the natural grading of a free associative algebra.
Suppose that $A$ is filtered $A = \bigcup_{i\geq 0} A_i$ with $A_0 = k$ and that $A$ is generated by a finite set of elements, say $x_1,...,x_n$. We may suppose that $x_i \in A_{d_i}\setminus A_{d_i-1}.$ By the universal property of free associative algebras there is a homomorphism from $F = k\langle X_1,...,X_n\rangle$ onto $A$, say $\phi: F \twoheadrightarrow A$ which sends $X_i \mapsto x_i$. Now $F$ is also graded by placing $X_i$ in degree $d_i$ and this defines a filtration $F = \bigcup_{k \geq 0} F_k$ where $F_k$ is the span of monomials $x_{i_1} \cdots x_{i_m}$ with $\sum_{j=1}^m d_{i_j} \leq k$ and $1\leq i_1,...,i_m \leq n$. Note that $\phi$ preserves the filtration.
The image of $\operatorname{gr}\phi$ is the subalgebra of $\operatorname{gr} A$ generated by the elements $x_i + A_{d_i-1}$ and so your question can now be phrased as asking when is $\operatorname{gr} \phi$ surjective? According to Corollary 7.6.14 of McConnell and Robson "Noncommutative Noetherian rings" this is the case if and only if $A_i = \phi(F_i)$. This also tells us that, out of all the filtrations on $A$ satisfying $x_i \in A_{d_i}\setminus A_{d_i-1}$ there is a unique filtration such that $\operatorname{gr} A$ is generated by the elements $x_i + A_{d_i-1}$, and it is the minimal filtration in a precise sense.
Now consider the example of the three dimensional Heisenberg algebra $\mathfrak{h}$ which you mentioned. We can view this as a quotient of the free algebra $F = k\langle X, Y\rangle$ by the ideal generated by $[X,[X,Y]]$ and $[Y, [X, Y]]$, however if you want the element $z := \phi [X, Y]$ to lie in degree 1 of $U(\mathfrak{h})$ (in accordance with the PBW theorem) then you have $\phi(F_1)$ spanned by ${1, \phi(X), \phi(Y)}$, whilst in $U(\mathfrak{h})$ the degree 1 filtered component also contains $z$.
