
% This LaTeX-file is to accompany the Invar package in the electronic
% Share Library of Maple. Hope there are no problems with "amsfnts" in
% \documentstyle[..].
% The paper also appeared as an IWR preprint in Heidelberg. It gives some
% mathematical background, definitions of what the package does and two
% larger examples.

\documentstyle[12pt,amsfnts]{article}

\newcommand{\stick}{\rule{0mm}{3.5mm}}
\newcommand{\Id}{\mbox{\it Id}}
\newcommand{\Inv}{{\em Invar\/}}
\newcommand{\inv}{{\tt invring}}
\newcommand{\maple}{{\em Maple\/}}

\newcommand{\indi}[1]{\mbox{$#1_{i}$}}

\newcommand{\towhat}[2]{\mbox{$#1_{1},\ldots,#1_{#2}$}}
\newcommand{\ton}[1]{\towhat{#1}{n}}
\newcommand{\polyring}{\mbox{$K\left[\ton{x}\right]$}}
\newcommand{\kn}{\mbox{$K^{n}$}}

\newcommand{\poin}{Poincar\'{e} series}
\newcommand{\CM}{{\em Cohen-Macaulay}}

\newcommand{\en}[1]{{\tt #1},}

\newtheorem{theorem}{Theorem}

\title{The \Inv\ Package for Calculating Rings of Invariants}
\author{Gregor Kemper
\thanks{The author is supported by the Graduiertenkolleg ``Modellierung und 
wissenschaftliches Rechnen in Mathematik und Naturwissenschaften'' which is 
financed by the DFG and the Land Baden-W\"urttemberg.}
}

\date{June 15, 1993}%!!!

\begin{document}

\maketitle

%\begin{abstract}
\Inv\ is a program package based on the computer-algebra system \maple\ 
(\cite{ma}) which calculates the ring of invariants of a permutation group or 
of a finite linear group over $\Bbb Q$ or a number field. ``Calculates'' means 
that the program computes a \CM\ basis for the ring of invariants and its 
syzygies, yielding a presentation for the ring of invariants.

Some applications of this can be found in \cite{sl}. My personal motivation for 
writing it was that I am doing some explicit calculation on {\em Noether's 
problem} (See Section~\ref{Z4} and \cite{ke}). Theorems and algorithms are 
stated in this paper without proof. Neither shall I give too many syntactical 
details, which can be found by using the on-line help provided for the package.

%In this paper I give the basic definitions and state the main theorem on rings 
%of invariants of finite linear groups (Section~\ref{intro}). 
%Section~\ref{install} gives information about where to get \Inv\ and how to 
%install it. In Section~\ref{what}, I will say {\em what} the package does, and 
%in Section~\ref{how}, {\em how}. Section~\ref{ex} then gives two examples for 
%the usage of \Inv. There are no proofs included here. Neither shall I give too 
%many syntactical details, which can be found by using the on-line help 
%provided for the package.
%\end{abstract}

\tableofcontents

\section{The Ring of Invariants} \label{intro}

Let $K$ be a field of characteristic 0 and $G\leq GL_{n}\left(K\right)$ a {\em 
finite} subgroup of the general linear group of dimension $n$. For 
$i=1,\ldots,n$ define the function
\[
x_{i}: \kn\rightarrow K,\ 
\left( \begin{array}{c} \xi_{1} \\ \vdots \\ \xi_{n} \end{array} \right)
\mapsto \xi_{i}.
\]
$G$ acts on the ring \polyring\ of polynomials in the \indi{x}'s by
\[
G\times\polyring\rightarrow\polyring,\ \left(S,f\right)\mapsto S\left(f\right)
\]
with
\[
\left(\stick S\left(f\right)\right)\left({\bf x}\right)=f\left(S^{t}\cdot {\bf 
x}\right)\ \mbox{for}\ {\bf x}\in \kn,
\]
where $S^{t}$ is the transpose. For permutation matrices $S$ this just amounts 
to applying the permutation to the indeterminates \indi{x} in a polynomial $f$.

Let
\[
I=\polyring^{G}=\{f\in\polyring\ \mid\ S\left(f\right)=f\ \forall S\in G\}
\]
be the ring of invariants of $G$, the object of our interest.\\

We state the main theorem for rings of invariants of finite linear groups which 
says everything about the structure of $I$. For a proof see \cite{HR} or 
\cite{Larry}.

\begin{theorem} \label{main}
Keep the above notation and let $\bar{K}$ be an algebraic closure of $K$. Then 
we have
\begin{itemize}

\item[(a)]
There are invariants $\ton{s}\in I$, homogeneous in the \indi{x}'s, which 
satisfy the following property (P):

For all $\ton{\xi}\in\bar{K}$ holds
\[
\indi{s}\left(\ton{\xi}\right)=0\ \forall i=1,\ldots,n\ \Leftrightarrow\  
\xi_{1}=\ldots=\xi_{n}=0.
\]

\item[(b)]
For homogeneous invariants $\ton{s}\in I$ the following statements are 
equivalent:
\begin{itemize}
\item[(i)]
The \indi{s}'s satisfy the property (P).
\item[(ii)]
The \indi{s}'s are algebraically independent over $K$ and I is a free module of 
finite rank over $K[\ton{s}]$ having a basis of homogeneous invariants.
\end{itemize}

\item[(c)]
Let (ii) from (b) be satisfied, i.e. 
$I={\displaystyle\bigoplus_{i=1}^{m}}A\cdot\indi{f}$ with 
$A=K\left[\ton{s}\right]$ and $\indi{f}\in I$ homogeneous. Write \indi{\delta} 
for the total degree $\partial\left(\indi{s}\right)$  of \indi{s} and 
$\indi{\gamma}=\partial\left(\indi{f}\right)$, then the \poin\ 
$P_{I}\left(\lambda\right)$ of $I$ is
\[
P_{I}\left(\lambda\right)=\frac{\lambda^{\gamma_{1}}+\ldots+\lambda^{\gamma_{m}
}}{\left(1-\lambda^{\delta_{1}}\right)\cdots\left(1-\lambda^{\delta_{n}}\right)
}.
\]

\end{itemize}
\end{theorem}

\bigskip
Point (ii) from (b) can be paraphrased as ``$I$ is a \CM\ algebra.'' The 
\indi{s}'s and \indi{f}'s from (c) are said to be a \CM\ basis of $I$. The 
\indi{s}'s are called {\em primary generators}.

The \poin\ can be calculated (or in this case even be defined) by {\em 
Molien}'s formula
\begin{equation} \label{molien}
P_{I}\left(\lambda\right)=\frac{1}{|G|}\cdot\sum_{S\in 
G}\frac{1}{det\left(\Id-\lambda S\right)}.
\end{equation}

\section{Installation} \label{install}

\Inv\ runs with {\em Maple V} and later versions. The package can be obtained 
directly from the author (The email address is at the end of this paper) or 
from the electronic share library of \maple\, which can be accessed via 
anonymous ftp. The sites are \\

\begin{tabular}{lll}
Internet address & Symbolic address & Site location \\ \\
129.132.101.33 & neptune.inf.ethz.ch & Zurich, Switzerland \\
129.97.140.58 & daisy.waterloo.edu & Waterloo, Canada
\end{tabular}
\\

What you need to get is the main file {\tt invar} and maybe the test file {\tt 
invar.test}. Suppose you have them sitting in the current working directory. 
Then you call \maple\ and do the following:

\begin{verbatim}
> read invar; # or read `invar.m`; if you have the .m file
> with(invar):
> ?invar
\end{verbatim}
Now you should get on-line help for the package, and you can start using it. If 
you type
\begin{verbatim}
> read `invar.test`;
\end{verbatim}
you should get a series of {\tt okay}'s.


\section{What the Package Does} \label{what}

The main objective of the package is to calculate \CM\ bases. The main routine 
is \inv. Just type
\begin{verbatim}
invring(G);
\end{verbatim}
and everything will happen automatically. The argument $G$ defines the group 
which is either given as a permutation group or a finite linear group. In the 
first case, it is defined by a generating set of permutations given in disjoint 
cycle notation. Then the ground field $K$ is $\Bbb Q$. In the second case, $G$ 
is given by a generating set of matrices over $K$. Here the ground field $K$ 
may be an algebraic number field $\Bbb Q\left(\vartheta\right)$ which is 
defined by the minimal polynomial of $\vartheta$ over $\Bbb Q$. Elements of $K$ 
are then represented as polynomials in $\vartheta$ with rational coefficients. 
For syntactical details consider the on-line help for the package.

Before saying what \inv\ does, let's just mention that it is not the only 
routine in the package. Although most other routines are called by \inv, they 
are well available to the user and documented in the on-line help. Some of them 
occur in the example in Section~\ref{Z4}. The package is designed to be a sort 
of toolbox for working with invariants. \\

So here is what happens when \inv\ enters the stage. You can compare the steps 
described here to the listings given in Section~\ref{ex}.

\subsection{Make the Group Linear} \label{firststep}
If $G$ is given as a permutation group the permutations are transformed into 
permutation matrices, making $G$ a linear group, too.

\subsection{Split off Unit Characters} \label{onesoff}
$G$ may contain the unit representation with some multiplicity. For example, 
this is always the case if $G$ comes from a permutation group: All permutation 
matrices act trivially on the vector $\left(1,\ldots,1\right)^{t}$. In this 
step the unit characters contained in $G$ are split off. More precisely: \inv\ 
computes a basis \towhat{v}{r} for the vector space $V\leq \kn$ of vectors 
fixed by all elements of $G$ and a basis \towhat{w}{n-r} for a $G$-invariant 
complement $W$ of $V$. The action of $G$ on $W$ defines a linear group $G'$. 
Whereas \ton{x} is a dual basis to the standard basis of \kn, let 
\towhat{s}{r}, \towhat{y}{n-r} be a dual basis to \towhat{v}{r}, 
\towhat{w}{n-r}. Then $G$ acts trivially on the \indi{s}'s, so
\[
I=\left(K\left[\towhat{w}{n-r}\right]^{G'}\right)\left[\stick\towhat{s}{r}\right],
\]
and the \indi{s}'s are algebraically independent over 
$I'=K\left[\towhat{w}{n-r}\right]^{G'}$.

We can now safely take the \indi{s}'s as the first primary generators of $I$ (I 
call them ``outer primaries'' since they won't appear in any relation) and turn 
to the calculation of $I'$. So the \indi{y}'s are introduced as new variables 
and $G'$ takes the place of $G$. Of course all this only happens if there {\em 
are} unit characters contained in $G$.

There are two enormous computational benefits to this step: First, there are 
(potentially) fewer variables to be calculated with, and second, the relations 
will become much simpler.

\subsection{Find Primary Generators} \label{primaries}
\inv\ computes the \poin\ $P_{I'}$ of $I'$ and goes through its representations 
that might mirror a \CM\ basis according to Theorem~\ref{main}(c), starting 
with the one containing the lowest degrees \indi{\delta}. For these successive 
forms of the \poin\ \inv\ tries to find a system $s_{r+1},\ldots,s_{n}$ of 
primary generators having degrees 
$\partial\left(\indi{s}\right)=\indi{\delta}$. Only if this attempt is 
unsuccessful (which seems to be exceedingly rare) does \inv\ proceed to the 
next form at all. Otherwise the primaries are found and step~\ref{primaries} is 
completed.

Now the problem is that it is not certain whether to a given form of the \poin\ 
there corresponds a system of primary generators (see the example given in 
\cite{sl}). So what should ``unsuccessful'' mean here? In this implementation 
the algorithm abandons a form of the \poin\ and passes to the next one after 
ten unsuccessful guesses for primaries. Now if the user isn't quite satisfied 
with this policy, he/she can make the system interactively seek counsel after 
each unsuccessful guess. For details consider the on-line help.

In my experience it never took more than six guesses to find a system of 
primaries. In most cases even the first guess was a lucky one!

\subsection{Find Secondary Generators} \label{secondaries}
Now the primary generators have been found and the degrees 
$\gamma_{i}=\partial\left(f_{i}\right)$ are known from the \poin. So in this 
step \inv\ finds the \indi{f}'s from Theorem~\ref{main}(c). These in turn will 
be products of some homogeneous invariants \indi{t}, and the number of the 
\indi{t}'s will be minimal. Equivalently, the \indi{t}'s will form a set of 
minimal cardinality $l$ which, together with $\{\ton{s}\}$, generates $I$ as a 
$K$-algebra. Let us call the \indi{t}'s {\em secondary generators}.

\subsection{Calculate Relations} \label{laststep}
At last, \inv\ calculates a minimal system of relations (``syzygies'') between 
the generators. With this, all products $t_{i}\cdot f_{j}$ will be known in 
terms of the \CM\ basis. Let \ton{S} and \towhat{T}{l} be indeterminates over 
$K$. Then the relations computed by \inv\ form a set of minimal cardinality 
which generates the kernel of
\[
K[\ton{S},\towhat{T}{l}]\rightarrow I,\ S_{i}\mapsto s_{i},\ T_{i}\mapsto 
t_{i}.
\]
Thus, we get a presentation for $I$.

The user can prevent \inv\ from performing step~\ref{laststep}.

\section{The Algorithms} \label{how}

For most of the steps~\ref{firststep} through \ref{laststep} mentioned in the 
last section, it seems worthwhile to spend some words on the algorithms used.

\subsection{Making the Group Linear}
There really isn't anything to say about this \ldots

\subsection{Splitting off Unit Characters}
The matrix $P=\frac{1}{|G|}\sum_{S\in G}S$ defines a $G$-invariant projection 
onto the subspace $V$ of $K^{n}$ of vectors fixed by all $S\in G$. So the basis 
\towhat{v}{r} consists of a maximal linearly independent set of columns of $P$. 
Easy representation theory shows that $r$ equals the trace of $P$. Now the 
complementary basis \towhat{w}{n-r} is formed in the same way from $\Id-P$. The 
\indi{s}'s, \indi{y}'s and $G'$ are formed as in \ref{onesoff}.

\subsection{Finding Primary Generators} \label{fprim}
Having calculated the \poin\ by {\em Molien}'s formula it is easy to find its 
consecutive forms as in Theorem~\ref{main}(c), starting with the lowest 
possible values for the \indi{\delta}'s. Now the question is how to pick 
invariants \indi{s} of degrees \indi{\delta} as candidates for primary 
generators. The set $I_{d}$ of invariants of some given degree $d$ is a finite0 
dimensional $K$-vectorspace. So first a basis of $I_{d}$ is calculated for all 
$d=\delta_{i}$ by writing down a general polynomial of degree $d$ with unknown 
coefficients and then solving the system of linear equations arising from the 
condition that this polynomial be invariant under the generators of $G$. For 
every candidate \indi{s} you can now pick any linear combination of the basis 
elements of $I_{\delta_{i}}$ which yields an unthinkably large amount of 
possibilities! The program now browses through these possibilities 
systematically, starting with the simple ones and trying to avoid trivialities 
such as testing $s1,s1+s2$ just after having tried $s1,s2$.

For each guess for primaries, condition (P) of Theorem~\ref{main}(a) is 
checked. This is done by setting $x_{1}=1$ and then checking by a Gr\"obner 
basis calculation if the specialized \indi{s}'s have a common zero 
$\left(\xi_{2}\ldots,\xi_{n}\right)$. If this is the case, they don't qualify 
and the search must go on. If on the other hand the specialized \indi{s}'s have 
{\em no} common zero, we can conclude that for each common zeroes of the 
original \indi{s}'s we have $\xi_{1}=0$. So now we specialize $x_{1}=0$ and 
$x_{2}=1$ and do the same thing again and so on. If we get to the point where 
all variables are specified, then the candidates satisfy (P) and we are happily 
through with this step.

\subsection{Finding Secondary Generators} \label{fsec}
In this step two sets $B$ and $T$ of invariants are formed such that
\[
I'=\bigoplus_{f\in B}K\left[s_{r+1},\ldots,s_{n}\right]\cdot f,
\]
and $B$ consists of products of elements of $T$. The number of invariants in 
$B$ and their degrees \indi{\gamma} are known by the \poin. To find $B$ and 
$T$, the program proceeds from the smallest \indi{\gamma} upward and builds 
them up (starting with $B=T=\emptyset$), as follows:

First, take all products $p$ of elements of $T$ which have the desired degree 
\indi{\gamma}. Then test whether $p\in\sum_{f\in B}K\left[\ton{s}\right]\cdot 
f$. This is done by taking all products $f\cdot s_{r+1}^{\alpha_{r+1}}\cdots 
s_{n}^{\alpha_{n}}$ ($f\in B,\ \alpha_{i}\geq0$) of total degree \indi{\gamma}, 
and putting an unknown coefficient in front of them. The sum of all these 
expressions is then equated to $p$, yielding a system of linear equations in 
the unknown coefficients introduced before. If there is a solution, then 
$p\in\sum_{f\in B}K\left[\ton{s}\right]\cdot f$. If not, take $p$ as the next 
element of $B$.

This way we try to get a basis element $f$ of degree \indi{\gamma} as a product 
of secondary generators. Only if this wasn't successful, form a basis for 
$I_{\gamma_{i}}$ as in \ref{fprim}. Then perform the above test for each 
element $p$ of the basis until one has been found to be ``new''. This $p$ is 
then included not only in $B$ but also in $T$ and thus becomes a secondary 
generator. \\

It can easily be shown that this algorithm yields a basis $B$ for $I$ as a free 
module over $K\left[\ton{s}\right]$ and a set $T$ of minimal cardinality which 
together with the primaries generates $I$ as a $K$-algebra.

\subsection{Calculating Relations}
We know everything about calculating in the \CM\ algebra $I$ if we know the 
representation of each $p=t\cdot f$ with $t\in T$ and $f\in B$ in terms of the 
\CM\ basis. So in this step all these products $p$ are calculated, once again 
proceeding from those of low total degree to those of higher ones. The 
algorithm used for getting the representations in terms of the \CM\ basis is 
the same as in \ref{fsec}: The system of linear equations in the membership 
test now always has a solution, and by substituting this into the sum which was 
equated to $p$, we get the desired representation of $p$:
\[
p=F\left(\ton{s},\towhat{t}{r}\right).
\]
This yields the relation $p-F\left(\ton{s},\towhat{t}{r}\right)=0$.

Now following this algorithm stupidly would be a waste of time since it happens 
that a relation for some $p$ can be derived from the relations that have 
already been calculated. And what does ``derived'' mean? Here we stick to the 
concept of defining an algebra by a presentation: Let \ton{S} and \towhat{T}{l} 
be indeterminates over $K$ and let \towhat{r}{m} be the relations that have 
already been calculated. Then we search the ideal
\[
\left(\towhat{r}{m}\right)\unlhd K\left[\ton{S},\towhat{T}{l}\right]
\]
for a relation which answers our question about the representation of $p$. 
Since this relation must be of the same total degree as $p$ itself, we have a 
strongly restrictive condition on how it may be formed from the \indi{r}'s. 
This way, trying to find such a relation again boils down to solving a system 
of linear equations.\\

The output of this step is the set $R$ of those relations that could not be 
derived from others. It can be shown that the cardinality of $R$ is minimal 
indeed!

\section{Examples} \label{ex}

We now give two examples of \Inv\ at work. The following listings are taken 
from a \maple\ session using the version \maple{\em V Release 2}.

\subsection{Sloane's Group of Order 192} \label{sloane}
In \cite{sl}, Sloane calculates a \CM\ basis for a linear group $G$ of order 
192. Let's do the same using \Inv! $G$ is defined over $\Bbb 
Q\left(i,\sqrt{2}\right)$ which is generated over $\Bbb Q$ by $a=i+\sqrt{2}$. 
We have
\[
i=\frac{1}{6}\left(a+a^{3}\right),\ \sqrt{2}=\frac{1}{6}\left(5a-a^{3}\right),
\]
and the minimal polynomial of $a$ is $a^{4}-2 a^{2}+9$. So we can start the 
calculation.

\begin{verbatim}
> interface(screenwidth=63); gc(0):
> libname:=libname,`.`:
> with(invar):
> 
> # The two generators given by Sloane
> gen1:=array([[2^(1/2)/2,2^(1/2)/2],[2^(1/2)/2,-2^(1/2)/2]]);
                        [      1/2        1/2  ]
                        [ 1/2 2      1/2 2     ]
                gen1 := [                      ]
                        [      1/2         1/2 ]
                        [ 1/2 2     - 1/2 2    ]

> gen2:=array([[1, 0],[0,I]]);
                                [ 1  0 ]
                        gen2 := [      ]
                                [ 0  I ]

> sub:=[I = (a+a^3)/6, 2^(1/2) = (5*a-a^3)/6]:
> # The function  lingroup  is used to define a linear group
> G:=lingroup(subs(sub,map(convert,{gen1,gen2},listlist)),
                                              a^4-2*a^2+9);
     G :=  lingroup(

                                    3
         {[[1, 0], [0, 1/6 a + 1/6 a ]],

                              3                 3
             [[5/12 a - 1/12 a , 5/12 a - 1/12 a ],

                                 3                   3
                 [5/12 a - 1/12 a , - 5/12 a + 1/12 a ]]},

          4      2
         a  - 2 a  + 9)

> # Now call invring. It prints out plenty of information
> # for the user's entertainment.
> invring(G);

CALCULATING THE INVARIANT RING OF
   G = lingroup({[[1, 0], [0, 1/6*a+1/6*a^3]], [[5/12*a-1/12*a^3,
        5/12*a-1/12*a^3], [5/12*a-1/12*a^3, -5/12*a+1/12*a^3]]},
        a^4-2*a^2+9)


Calculating all elements of the group G ...
It has 192 elements.

Splitting off unit-characters ...
There is none.

Finding primary generators ...

Calculating the poincare-series ...
It is
                 2    4             2   2     2           2
   P(s) = 1/((- s  + s  + 1) (s - 1)  (s  + 1)  (s + 1 + s )

           4    8                2         2     4    8
       (2 s  + s  + 1) (1 - s + s ) (s + 1)  (- s  + s  + 1))


Try the representation
                                   1
                   P(s) = ------------------
                                8        24
                          (1 - s ) (1 - s  )


Calculating the space of invariants of degree 8.
There is one linearly independent invariant ("I8_1").

Calculating the space of invariants of degree 24.
There are 2 linearly independent invariants
                   ("I24_1" through "I24_2").

Trying invariants   s1 = I8_1   s2 = I24_1
OH HAPPY DAY: They qualify!!
   (No common zeroes other than [0,..,0])

The primaries are (by their symbolic names):
   s1 of degree 8
   s2 of degree 24

Done with finding primary generators

Finding secondary generators ...

We'll get a basis of invariants of degrees 0.

It starts with 1 (ever so amazing!)

The secondary generators are:

The invariant ring is  a free module over Q[{primaries}]
with basis
    1    of degree 0

Ready with finding secondary generators!

Finding relations between secondary generators ...

The relations are:

Ready with finding relations!

Time used:   144.767   seconds
\end{verbatim}
So it turns out that there are no secondary generators and hence no relations: 
The ring of invariants is isomorphic to a polynomial ring! \Inv\ introduces 
symbolic names \indi{s} for the generators. To retrieve their actual values as 
polynomials in the \indi{x}'s, there is the function {\tt valueof}.
\begin{verbatim}
> valueof(s1);
                       8        4   4     8
                     x2  + 14 x1  x2  + x1

> valueof(s2);
         16   8          12   12         8   16     24     24
   759 x1   x2  + 2576 x1   x2   + 759 x1  x2   + x2   + x1
\end{verbatim}
These are exactly the invariants given in \cite{sl}.

\subsection{Noether's Problem for $Z_{4}$} \label{Z4}
We take the cyclic group $G$ of order four with its standard permutation 
representation and solve {\em Noether's problem} for it. In other words, we try 
to find (no more than) four rational functions, invariant under $G$, which 
generate the field of invariants. One of them will be 
$s_{1}=x_{1}+\ldots+x_{4}$. So we first calculate the {\em ring} of invariants 
and then attack the problem of the {\em field} of invariants.

\begin{verbatim}
> interface(screenwidth=63); gc(0):
> 
> libname:=libname,`.`:
> with(invar):
> 
> # The global variable protocol_level can be used
> # to reduce the information printed by invar.
> protocol_level:=0:
> # Some permutation groups such as Z4 are defined within
> # the package.
> invring(Z4);
Splitting off unit-characters ...
Finding primary generators ...
The primaries are (by their symbolic names):
   s1 of degree 1  (outer primary)
   s2 of degree 2
   s3 of degree 2
   s4 of degree 4

Finding secondary generators ...
The secondary generators are:
   t1 of degree 3
   t2 of degree 3
   t3 of degree 4

Finding relations between secondary generators ...
\end{verbatim}
So now our task is to find three rational invariants $f_{i}=g_{i}/h_{i}$ with 
$g_{i},h_{i}\in \Bbb Q\left[y_{1},y_{2},y_{3}\right]$ ($i=1\ldots3$) such that 
all \indi{s} ($i>1$) and \indi{t} can be expressed as rational functions in the 
\indi{f}. We will take homogeneous invariants and call 
$\partial\left(f_{i}\right)=\partial\left(g_{i}\right)-\partial\left(h_{i}
\right)$ the degree of \indi{f}. The strategy is to choose an $f_{1}$ of degree 
1 and $f_{2}$ and $f_{3}$ of degree 0 such that the degrees of \indi{g} and 
\indi{h} ($i=2,3$) are as small as possible. But on the other hand we must try 
to keep $f_{2}$ and $f_{3}$ algebraically independent. It can be proved that 
this strategy is ``likely'' to produce a generating set. So an obvious choice 
would be (with the notation from the above listing)
\[
f_{1}=t_{1}/s_{2},\ f_{2}=s_{3}/s_{2},\ f_{3}=t_{2}/t_{1}.
\]
But maybe we can get $f_{3}$ better! Suppose $\chi$ is a linear character of 
$G$ and $g_{3}$ and $h_{3}$ are both pseudo-invariants of weight $\chi$, i.e. 
$\sigma\left(g_{3}\right)=\chi\left(\sigma\right)\cdot g_{3}\ \forall\sigma\in 
G$, and the same for $h_{3}$. Then the quotient $f_{3}$ is an invariant, and 
maybe $g_{3}$ and $h_{3}$ can have smaller degrees than 3, with $f_{3}$ still 
algebraically independent from  $f_{2}$. Let us explore this idea for the 
linear character $\chi$ with values $\pm 1$!

\begin{verbatim}
> # restore the usual amount of information printed
> protocol_level:=1:
> # The function  classes  calculates the conjugacy classes
> # of the current group
> classes():
Calculating the conjugacy classes of G ...
G has conjugacy classes of lengths   [1, 1, 1, 1]

> # A character is defined by giving a list of its values
> # matching the list of conjugacy classes.
> # Here chi is the determinant.
> 
> chi:=map(m->linalg[det](array(m)),");
                     chi := [-1, 1, 1, -1]
\end{verbatim}
Let $\chi$ be a linear character of $G$, then the $\chi$-weighted \poin\ is 
given by {\em Molien}'s formula~(\ref{molien}), but with each summand weighted 
by $\chi\left(\sigma\right)$. The $d$'th coefficient of its Taylor expansion is 
the dimension of the space of pseudo-invariants of weight $\chi$ and of degree 
$d$. So this is how we can check if we have a chance for a better $f_{3}$.

\begin{verbatim}
> # The function  poincare  calculates the
> # weighted poincare series
> taylor(poincare(chi,s),s);
Calculating the poincare-series ...
It is
                               3    2
                           s (s  - s  + s + 1)
           P(s) = - --------------------------------
                           3   2              2
                    (s - 1)  (s  + 2 s + 1) (s  + 1)


                    2      3      4      5      6
             s + 2 s  + 2 s  + 4 s  + 5 s  + O(s )

> # So we will get g3 and h3 of degree 2!
> # The function  invarspace  calculates a basis for the space
> # of pseudo-invariants of given degree
> 
> invarspace(2,chi):
Calculating the space of pseudo-invariants of degree 2.
There are 2 linearly independent invariants
                     ("I2_1" through "I2_2").

> # Now we want to represent the quotient in terms of the
> # Cohen-Macaulay basis.  repfrac  does this.
> 
> repfrac("[1]/"[2]);
fraction extended by a factor of degree 1
Solving a system of 8 linear equations in 2 unknowns ...
Solving a system of 8 linear equations in 2 unknowns ...
                                t1
                          - ---------
                            5 t1 + t2

> g3:=numer("): h3:=denom(""):
> 
> # Write down the definition of the fi's in terms of the si's
> # and ti's
> f_by_s:={f1=t1/s2,f2=s3/s2,f3=g3/h3}:
\end{verbatim}
Now we want to check if the \indi{s}'s and \indi{t}'s can indeed be expressed 
by the \indi{f}'s. We have the following equations at hand:
\begin{itemize}
\item
$g_{i}-f_{i} h_{i}=0$ ($i=1\ldots3$), with \indi{g} and \indi{h} polynomials in 
the \indi{s}'s and \indi{t}'s,
\item
the relations which were calculated by \inv,
\item
$u\cdot h_{1} h_{2} h_{3}-1=0$ with an auxiliary variable $u$, just to express 
that the \indi{h}'s are nonzero.
\end{itemize}
So we use the Gr\"obner basis algorithms in \maple\ to get the answer from 
these equations.

\begin{verbatim}
> # The function  rel  retrieves  the relations
> eq:=[t1-f1*s2,s3-f2*s2,g3-f3*h3,u*s2*h3-1,
>                          map(x->x[1],rel())[]]:
> with(grobner):
> bas:=gbasis(eq,{u,s2,s3,s4,t1,t2,t3},plex,'ord'):
> # We don't print the Groebner basis here, but it turns out
> # that it does have linear polynomials in the si's and ti's.
> # Thus the representation of the si's and ti's as rational
> # functions in the fi's is indeed possible!
> 
> s_by_f:=solve({bas[]},{u,s2,s3,s4,t1,t2,t3}):
> # It's somewhat long, though:
> lprint(s_by_f);
{t3 = 1/4*f1^4*(572*f2^2*f3^4+550*f3^3*f2^2+215*f2^2*f3^2+40*f3
*f2^2+3*f2^2-1482*f2*f3^4-1412*f2*f3^3-554*f2*f3^2-104*f2*f3-8*
f2+65*f3^4+82*f3^3+29*f3^2+4*f3)/f3^4/(f2^6-2*f2^5-f2^4+4*f2^3-
f2^2-2*f2+1), t1 = -f1^3*(1+6*f3+13*f3^2)/f3^2/(f2^3-f2^2-f2+1)
, s3 = -f2*f1^2*(1+6*f3+13*f3^2)/f3^2/(f2^3-f2^2-f2+1), t2 = f1
^3*(1+11*f3+43*f3^2+65*f3^3)/f3^3/(f2^3-f2^2-f2+1), u = -f3^5*(
f2^6-2*f2^5-f2^4+4*f2^3-f2^2-2*f2+1)/f1^5/(1+12*f3+62*f3^2+156*
f3^3+169*f3^4), s4 = 1/4*f1^4*(156*f2^2*f3^4+150*f3^3*f2^2+61*
f2^2*f3^2+12*f3*f2^2+f2^2+26*f2*f3^4+12*f2*f3^3+2*f2*f3^2-13*f3
^4-6*f3^3-f3^2)/f3^4/(f2^6-2*f2^5-f2^4+4*f2^3-f2^2-2*f2+1), s2
 = -f1^2*(1+6*f3+13*f3^2)/f3^2/(f2^3-f2^2-f2+1)}
> 
> # Let us check that these relations are true!
> # The following function returns 0 when fed with an 
> # si or ti, if the relations are true.
> 
> s->normal(valueof(normal(subs(s_by_f,f_by_s,s)-s))):
> map(",[s2,s3,s4,t1,t2,t3]);
                       [0, 0, 0, 0, 0, 0]
> # Great !!
\end{verbatim}



\begin{thebibliography}{9999}

\bibitem[H-R]{HR}
M. Hochster and J. Roberts, {\em Rings of invariants of reductive groups acting 
on regular rings are Cohen-Macaulay}, Advances in Math. {\bf 13} (1974), 
115-175.

\bibitem[Ke]{ke}
G. Kemper, {\em Das Noethersche Problem f\"ur $L_{2}(7)$}, IWR Preprint {\bf 
93-26} (1993)

\bibitem[M-G]{Larry}
J.M. McShane and L.C. Grove, {\em Polynomial Invariants of Finite Groups}, 
Algebras, Groups and Geometries, to appear 1993.

\bibitem[Ma]{ma}
B. Char, K. Geddes, G. Gonnet, M. Monagan and S. Watt, {\em Maple Reference 
Manual (5th Edn.)}, Waterloo Maple Publishing, Waterloo, Ontario, 1990

\bibitem[Sl]{sl}
N. Sloane, {\em Error-correcting Codes and Invariant Theory: New Applications 
of a Nineteenth-Century Technique}, Amer. Math. Monthly {\bf 84} (1977), 
82-107.

\end{thebibliography}

\bigskip
\begin{center}
Gregor Kemper\\IWR\\Im Neuenheimer Feld 368\\6900 Heidelberg\\Germany\\ \ \\
email {\tt kemper@kalliope.iwr.uni-heidelberg.de}
\end{center}

\end{document}
