
\subsection {Using eliminating ordering}

Despite the fact that {\bf bergman} works with graded algebras only,
it can be successfully applied to the non-graded case.  The idea is to 
homogenize the
ideal (using an additional commuting homogenizing variable $h$) and to 
perform calculations
in the eliminating ordering and then dehomogenize the result setting $h=1.$

Let us consider an example suggested by  Prof. I.Kantor.
Let $A$ be  the following algebra:
$$A= < r,l,q| r^2-q^2+lr-r,
rq-qr+lq-q,
lr-rl,
lq+ql-2q,
rr-rl-2lr+2l^2-r+l>$$
It was important to find the minimal polynomial for $q.$ 
Here is the solution achieved by  {\bf bergman}:

\begin{footnotesize}
\begin{verbatim}
2 lisp> (noncommify)
nil
3 lisp> (elimorder)
nil
4 lisp> (simple)
Now input in-variables and ideal generators 
in algebraic form, thus:
        vars v1, ..., vn;
        r1, ..., rm;
where v1, ..., vn are the variables, 
and r1, ..., rm the generators.
algebraic form input>  vars r,l,q,h;
algebraic form input>  r*r-q*q+l*r-r*h,r*q-q*r+l*q-q*h,
algebraic form input>  l*r-r*l,l*q+q*l-2*q*h,
algebraic form input>  r*r-r*l-2*l*r+2*l*l-r*h+l*h,
algebraic form input>  r*h-h*r,q*h-h*q,l*h-h*l;

% 2
-h*q+q*h,
   -h*l+l*h,
   q*l+l*q-2*q*h,
   -h*r+r*h,
   -q*r+r*q+l*q-q*h,
   -4*r*l+2*l^2+l*h+q^2,
   4*l*r-2*l^2-l*h-q^2,
   4*r^2-4*r*h+2*l^2+l*h-3*q^2,

% 3
4*r*q*h-4*l^2*q+10*l*q*h-q^3-9*q*h^2,
   4*r*q^2+12*l^3-10*l*q^2-3*l*h^2-3*q^2*h,

% 4
l*q^3-3*l*q*h^2-q^3*h+3*q*h^3,
   -12*l^3*h-4*l^2*q^2+20*l*q^2*h+3*l*h^3-q^4-6*q^2*h^2,
   -4*l^3*q+12*l^2*q*h-11*l*q*h^2+3*q*h^3,
   12*l^4-8*l^2*q^2-3*l^2*h^2-2*l*q^2*h+q^4,

% 5
-48*l^2*q*h^2+96*l*q*h^3-q^5+10*q^3*h^2-57*q*h^4,

% 6
-48*l^2*q^2*h^2+96*l*q^2*h^3-q^6+10*q^4*h^2-57*q^2*h^4,

% 7
-q^7+13*q^5*h^2-39*q^3*h^4+27*q*h^6,

\end{verbatim}
\end{footnotesize}

If we look at the last element of the obtained  Gr\"{o}bner basis and
put $h=1$ we get the desired equation:
$$q^7-13q^5+39q^3-27q=0$$
The secret is in the command  {\bf elimorder}: now if two words are compared,
they are compared first as the commutative words in pure left lexicographical 
ordering and after that (if commutatively they are equal) as usual. That is 
why if the minimal polynomial exists its homogenized variant should belong to 
the   Gr\"{o}bner basis: if the leading monomial is $q^n$ all other terms 
should contain the letters $h$ and $q$ only, $h$ being in the end because it 
commutes with $q.$ To obtain the minimal polynomial for $l$ it is sufficient 
to put $l$ before the homogenizing variable (which should remain the last) 
in the list of the variables, e.g. {\bf  vars}   r,q,l,h;
