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.