We want to simplify a polynomial in the variables of (13.1). We begin by setting the variables noncommutative with the following command.
In[5]:= SetNonCommutative[y, Inv[y], Inv[1-y], a, x]
Next we must give the computer a precise idea of what we mean by
``simple" versus ``complicated". This formally corresponds to
specifying an
order on the indeterminates. If
and
are
going to stand
for the inverses of
and
respectively, as the
notation suggests,
then the order
In[6]:= SetMonomialOrder[{ y, Inv[y], Inv[1-y], a, x}]
Suppose that we want to
connect the Mathematica
variables
with the mathematical idea of
the inverse of
and
with the
mathematical idea of the inverse of
. Then just type
3in the defining relations for the inverses involved.
In[7]:= resol = {y ** Inv[y] == 1, Inv[y] ** y == 1,
(1 - y) ** Inv[1 - y] == 1, Inv[1 - y] ** (1 - y) == 1}
Out[7]= {y ** Inv[y] == 1, Inv[y] ** y == 1,
(1 - y) ** Inv[1 - y] == 1, Inv[1 - y] ** (1 - y) == 1}
As an example of simplification,
we simplify the two expressions
and
assuming that
satisfies
and
.
The following command computes a Gröbner
Basis for the union of
and
and simplifies the expressions
and
using the Gröbner Basis.
Experts will note that since we are using an
iterative Gröbner Basis algorithm which may not terminate,
we must set a limit on how many iterations we permit;
here we specify at most 3 iterations.
In[8]:= NCSimplifyAll[{x**x,x+Inv[y]**Inv[1-y]},Join[{x**x-a},resol],3]
Out[8]= {a, x + Inv[1 - y] + Inv[y]}
We name the variable
, because this has more meaning
to the user than would using a single letter.
has the same status as a single letter with regard to
all of the commands which we have demonstrated.
Next we illustrate an extremely valuable simplification
command. The following example performs the same
computation as the previous command, although one does
not have to type in
explicitly. More generally
one does not have
to type in relations involving the definition of inverse explicitly.
Beware, NCSimplifyRationalX1 picks its own order on variables and completely
ignores any order that you might have set.
In[9]:= <<NCSRX1.m
In[10]:= NCSimplifyRationalX1[{x**x**x,x+Inv[z]**Inv[1-z]},{x**x-a},3]
Out[11]= {a ** x, x + Inv[1 - z] + inv[z]}
WARNING: Never use inv[ ] with NCGB since it has special properties given to it in NCAlgebra and these are not recognized by the C++ code behind NCGB