Consider the free algebra $F = \mathbb Q(a)\langle x, y, z\rangle$ and the ideal $$I = \langle xy - ayx, yz - zy, xz - zx - y\rangle$$ According to the following code $y^2 \in I$.
> k := FunctionField(Rationals(), 1);
> F := FreeAlgebra(k, 3);
> AssignNames(~F, ["x", "y", "z"]);
> x := F.1; y := F.2; z := F.3;
> I := ideal<F | [x*y - k.1*y*x, y*z - z*y, x*z - z*x - y]>;
> Groebner(I);
> Basis(I);
[
x*y - $.1*y*x,
x*z - z*x - y,
y^2,
y*z - z*y
]
but I don't think that's correct. I'd like to know why $y^2$ shows up in the Groebner basis. I don't know the algorithm MAGMA uses, is there a way to just ask MAGMA to give an expression of the form $y^2 = \sum a_ib_ic_i$ with the $b_i$ generators of $I$?
MAGMA is right: we have $y^2 \in I$. Let $g_1 := xy-ayx$, $g_2 := yz-zy$, and $g_3 := xz-zx-y$ be the generators of $I$. Then you can check that
$$y^2 = -\frac{1}{a-1}g_1z + \frac{1}{a-1}zg_1 - \frac{a}{a-1}g_2x + \frac{1}{a-1}xg_2 + \frac{1}{a-1}g_3y - \frac{a}{a-1}yg_3 \;.$$
This nicely shows that this goes wrong if we specialize to $a=1$, i.e., let $x$ and $y$ commute.
Unfortunately, I don't know how to get MAGMA to spit this out. For commutative Gröbner bases there is a
Coordinatescommand but this doesn't work in the noncommutative case.