Skip to main content

Chapter 2 Invariant Theory

This chapter is co-authored by Francesca Gandini, Al Ashir Intisar, Sumner Strom, and Marcus Cassell. In this chapter we will present an overview of the theory behind the algorithms implemented in the InvariantRing software package in the open-source Computer Algebra System Macaulay2 (M2).
You can access an online version of this chapter with live code cell at https://fragandi.github.io/M2forall. There you can also learn how to set up a virtual machine on Github with Codespaces so that you write and run M2 code from anywhere. A turn-key repository for creating a Codespace for Macaulay2 is available at fragandi/M2-codespace.
We also include some background on orbit sums necessary to implement an algorithm to compute invariants for permutations actions. We have worked with a group of collaborators on the first version of the code for this algorithm at the Macaulay2 Workshop at Tulane University in April 2025 and University of Wisconsin Madison in June 2025. The code is still under development and we welcome contributions, see galettof/InvariantRing.
We finish the chapter with a selection of examples that illustrate the current capabilities of the InvariantRing package. You can run the provided code in your local installation of M2 or go to the online version and execute the code cells on your browser. This works well even on mobile devices!

Section 2.1 A concrete introduction to invariant rings

Subsection 2.1.1 Finite Matrix Groups

We can think of a (linear) action within a group as acting on a vector space concretely by interpreting each group element as a matrix and describing the action as matrix multiplication on vectors. We can then evaluate any polynomial on a vector space of its indeterminants and its image after the group action.

Example 2.1.1.

Consider
\begin{equation*} M = \begin{pmatrix} 1 \amp 0 \\ 0 \amp -1 \\ \end{pmatrix} \end{equation*}
and the vector \(\bar x = \begin{pmatrix} x\\ y\\ \end{pmatrix}\) This gives \(M \bar x = \begin{pmatrix} x \\ -y \\ \end{pmatrix}\text{.}\) Thus for the polynomial
\begin{equation*} f(\bar x) = f(\begin{pmatrix} x \\ y \\ \end{pmatrix}) = x+y \end{equation*}
and we have,
\begin{equation*} f(M\bar x) = f(\begin{pmatrix} x \\ -y \\ \end{pmatrix})= x-y\text{.} \end{equation*}
More formally, for \(G \) a finite group we will consider a linear representation of \(G \) via its action on a finite dimensional vector space \(V \) over a field \(K \) of characteristics zero. In general, most of the results in this chapter hold in the non-modular case i.e., when the characteristics of the field does not divide the order of the group. As of now finite fields are not fully supported by the current version of the InvariantRing package and such functionalities are an active area of development.
If \(V \) is faithful representation of \(G \) of dimension \(m\text{,}\) the image of the representation is isomorphic to \(G \) and so we consider \(G \) as a finite matrix group.

Definition 2.1.2.

Suppose \(|G| < \infty\) and \(G \leq GL_m(\mathbb{K})\text{,}\) then \(G\) is a finite matrix group.

Example 2.1.3.

Let us consider a two-dimensional representation of \(C_2\text{,}\) the cyclic group of order 2.
\begin{equation*} \left\langle \begin{pmatrix} 1 \amp 0 \\ 0 \amp -1 \\ \end{pmatrix} \right\rangle = \left\{ \begin{pmatrix} 1 \amp 0 \\ 0 \amp -1 \\ \end{pmatrix},\begin{pmatrix} 1 \amp 0 \\ 0 \amp 1 \\ \end{pmatrix} \right \} \cong C_2 \end{equation*}

Subsection 2.1.2 Invariant Rings

We will work with a polynomial ring in \(n\) variables over the field \(\mathbb{K}\text{.}\) We use the notation \(\bar x = (x_1, x_2,..., x_n)\) and abuse it by saying \(\mathbb{K}[x_1,x_2,...,x_n]=\mathbb{K}[\bar x]\) and \(f(x_1,x_2,...,x_n)=f(\bar x)\) for \(f \in \mathbb{K}[\bar x]\text{.}\)

Definition 2.1.4.

Let \(G\) be a finite matrix group within \(GL_n(\mathbb{K})\text{.}\) We say that \(f\in \mathbb{K}[\bar x]\) is invariant under the action of \(G\) if and only if
\begin{equation*} f(A\bar x) = f(\bar x), \end{equation*}
for all \(A \in G\text{.}\)

Example 2.1.5.

The polynomials \(f(\bar x)=x\) and \(f(\bar x) = x +y^2\) in \(\mathbb{K}[x,y]\) are invariant under the action of
\begin{equation*} C_2 = \left\langle\begin{pmatrix} 1 \amp 0 \\ 0 \amp -1 \\ \end{pmatrix} \right\rangle \end{equation*}
However the polynoial \(f(\bar x)=x+y\) is not.
We can consider the set of all invariant polynomials under some action of a group \(G \text{.}\) A good exercise is to prove that this set has the structure of a ring.

Definition 2.1.6.

Let \(R= \mathbb{K}[\bar x]\text{.}\) We define the invariant ring for the action of \(G\) on \(R\) as,
\begin{equation*} R^G : = \{f \in R \, \mid f(A\bar x) = f(\bar x), \, \forall A \in G\} \subseteq R. \end{equation*}

Subsection 2.1.3 Reynolds Operator

We have that the invariant ring \(R^G\) is a subring of the ring \(R= \mathbb{K}[\bar x]\text{.}\) However, it is not an ordinary subring. In characteristic zero, we have a projection from \(R\) to \(R^G\) that respects the action of \(G\text{.}\) The idea: "averaging" over the action of \(G\) we get an invariant polynomial.

Definition 2.1.7.

The Reynolds map (averaging map) \(R_G: R \xrightarrow{} R^G\) is given by
\begin{equation*} R_G(f) = \frac{1}{|G|} \sum_{A\in G} f(A \bar x) \end{equation*}

Example 2.1.8.

Example for a Group action \(C_2 = \left\langle\begin{pmatrix} 1 \amp 0 \\ 0 \amp -1 \\ \end{pmatrix}\right\rangle\text{.}\) Consider the polynomial \(x+y\text{,}\) which is not invariant under the action of \(C_2\text{.}\) We have that:
\begin{equation*} R_G(x+y) = \frac{1}{2} ((x+y) + (x-y)) = x\in R^G \end{equation*}
and we can check that \(R_G(x+y)=x\) is indeed invariant.

Section 2.2 Degree bounds and algorithms

Our goal is to find algorithms that provide us with a description of all possible invariants in an efficient way. Formally, we look for minimal generators for the ring of invariants \(R^G\) and more precisely for minimal algebra generators for \(R^G\) as an algebra over the coefficient field \(\mathbb{K}\text{.}\)
For our search to be successful, we need to hope that there are finitely many generators. In our setup (finite groups and characteristic zero) a consequence of Hilbert’s Basis Theorem is that our invariant rings are finitely generated. However, we will run in computational troubles if we do not have a stopping point for our search. The most effective way is to provide a bound the degrees of these generators.

Subsection 2.2.1 Noether Degree Bound

A beautiful theorem of Noether establishes that we have a bound on the degree of a minimal generator independent from the action itself, but just in terms of the order of the group. Moreover, we only need to look at images of monomials under the Reynolds operator.
Noether’s result is a constructive tool that provides us with a computational strategy! We can apply \(R_G\) to all the finitely many monomials in degrees \(\leq |G|\) to get generators for \(R^G\text{.}\) As the number of monomials grows exponentially with the number of variables and the degree, this is more of a theoretical algorithm, but it does tell us that our goal is at least possible!

Subsection 2.2.2 Hilbert Ideal

To describe a more sophisticated approach to the search for minimal algebra generators for an invariant ring, we can actually consider an ideal instead! Note: for any \(\{ f_1,..., f_s\} \subseteq R\text{,}\) the ideal generatd by \(\{f_1,...f_s\}\) and the subalgebra generated by \(\{f_1,...f_s\}\) over \(\mathbb{K}\) are very different objects.

Definition 2.2.2.

Let \(J_G := R(R^G)_+\) be the ideal in \(R\) generated by all positive degree invariants. We call \(J_G\) the Hilbert Ideal for this action of \(G\text{.}\)
Note that the condition that every generator is invariant is not hard to satisfy as if you have a generator that is not invariant, then you can apply the Reynolds operator \(R^G\) to obtain a new generator that is. You can now replace the old generator with this new one and still get the same ideal. What is special here is that a set of ideal generators work as algebra generators! Computationally, algebra generators are much harder to find as there is no guarantee to have finitely many of them. However, the Hilbert Basis Theorem tells us that every ideal is finitely generated.

Subsection 2.2.3 Presentations

When we say that \(\{f_1,...f_s\} \subseteq R\) are minimal generators for a subring \(S\text{,}\) we do not exclude the possibility that there is some relation, some polynomial identity, that they satisfy as elements in the bigger ring \(R\text{.}\) We can describe the relations between the generators via a presentation of the subring.

Definition 2.2.4.

Let \(S = \mathbb{K}[f_1,...f_s] \subset R\text{.}\) A presentation of \(S\) is a map,
\begin{equation*} T := \mathbb{K}[u_1,...u_s] \xrightarrow{\phi}S \end{equation*}
such that \(\frac{T}{\text{ker}(\phi)} \cong S\text{.}\) We call the elements of the presentation ideal \(\text{ker}(\phi)\) the syzygies of \(f_i\)’s.
Algorithms for finding generators for ideals have been intensely studied and especially in relation with the theory of GrΓΆbner bases. We cannot go in the details of these tools, but what is of notice is that they are implemented in Macaulay2 and so we can rely on them in our implementation. In particular, these methods are particularly effective in solving problems in Elimination Theory. Often the goal is to compute an ideal of relations hoping that this is less complicated than the original structure, possibly eliminating some variables.

Subsection 2.2.4 Graph of Linear Actions

We can use Elimination Theory to solve our original problem of finding minimal generators for the ring of invariants. We first need to construct a geometric description of the action of a group \(G\text{.}\)

Definition 2.2.7.

Let \(G\) be a finite matrix group in \(GL_n(\mathbb{K})\text{.}\) For \(A\in G\) consider,
\begin{equation*} V_A = \left\{ ( \bar v, A \bar v) \mid v \in V \right \} \subseteq V \oplus V \end{equation*}
Then \(A_G = \bigcup_{A\in G}V_A\) is the subspace arrangement associated to the action of \(G\text{.}\)
Note that \(V_A\) is a linear subspace. So \(\mathbb{I}(V_A)\text{,}\) the set of polynomials vanishing on \(V_A\text{,}\) is an ideal generated by linear polynomials, we call this a linear ideal.

Example 2.2.8.

Consider
\begin{equation*} V_{\begin{pmatrix} 1 \amp 0 \\ 0 \amp -1 \\ \end{pmatrix}} = \{(x_1,x_2,x_1,-x_2) \mid x_1, x_2 \in V\} = \mathbb{V}(y_1-x_1, y_2+x_2) \end{equation*}

Subsection 2.2.5 Subspace Arrangement Approach

The finite union of the subspaces \(V_A\text{,}\) denoted \(\mathcal{A}\) is a subspace arrangement, called the group action arrangement. Via Elimination Theory, we can use the vanishing ideal of \(\mathcal{A}\) to recover the Hilbert Ideal.
Recent work has shown that the same approach works in the exterior algebra.
The exterior algebra approach has computational potential. Whilst Derksen’s approach leads to an algorithm with a long run time, first experiments suggest that a fast algorithm could be implemented for skew polynomials. We aim to pursue this line of inquiry in the near future.

Section 2.3 Specialized algorithms

For some specific types of actions we have faster and simpler algorithms to find invariants.

Subsection 2.3.1 Abelian Groups and Weight Matrices

Every abelian group \(G\) can be written in its invariant factors decomposition as
\begin{equation*} G \cong \mathbb{Z}_{d_1} \oplus....\oplus \mathbb{Z}_{d_r}, \end{equation*}
for some unique \(d_i\) such that \(d_i \mid d_{1+1}\) where \(i=1, \ldots , r-1\text{.}\) In multiplicative notation,
\begin{equation*} G \cong \left\langle g_1\right\rangle \oplus...\oplus\left\langle g_r \right\rangle, \,\,\,\,\, |g_i| =d_i. \end{equation*}
A diagonal action of \(G\) on \(R= \mathbb{K}[\bar x]\) is given by
\begin{equation*} g_i \cdot x_j = \mu_i^{w_ij}x_j \end{equation*}
for \(\mu_i \) a primitive \(d_i^{th}\) root of unity. We can encod the action in the weight matrix
\begin{equation*} W = (w_{ij})_{ij} = \begin{pmatrix} \mu_{11} \amp \cdots \amp \mu_{1n} \\ \vdots \amp \ddots \amp \\ \mu_{r1} \amp \cdots \amp \mu_{rn} \end{pmatrix} \end{equation*}
where the rows are indexed by the generators \(g_i\) of \(G\) and the columns are indexed by the variables \(x_j\) of \(R\text{.}\)
Interpreting each row has the weight of the action of the generator \(g_i\text{,}\) we have that \(g_i\) acts trivially on the monomial \(\bar x^{\bar \beta}\) precisely when
\begin{equation*} \mu_i^{\sum_j w_{ij} \beta_j} = 1 \end{equation*}
so \((W \bar \beta)_i =0\) modulo \(d_i\) as \(\mu_i\) is a primitve \(d_i^{th}\) root of unity.
We can use this result computationally. As the action is diagonal, the invariant ring is generated by monomials. By Noether Degree Bound we only need to examine all monomials of degree less than the order of the group \(G\text{.}\) Then, by the theorem above, if we can sort the monomials in terms of their weigtht \(W\bar \beta\text{,}\) then the monomials with weight \(\bar 0\) will be invariant.

Subsection 2.3.2 Permutation actions

The symmetric group \(S_n \) acts naturally on \(\{1, ... , n\}\) by permuting its elements. This action allows us to define a representation \(V \cong \mathbb{K}^n\) where on the basis vectors \(\{e_1, ... , e_n\}\text{,}\) the permutation \(\sigma\) acts by \(\sigma \cdot e_i = e_{\sigma(i)}\text{.}\) As \(S_n \) acts on \(V\) by permuting its basis vectors, we have that \(V\) is a permutation representation induced by the permutation action of \(S_n\text{.}\)

Example 2.3.2.

Consider the group \(S_4\text{.}\) The matrix for the action of \((1 \,2\,3\,4) \) is given by
\begin{equation*} M_{(1 \,2\,3\,4)} = \begin{pmatrix} 0 \amp 1 \amp 0 \amp 0 \\ 0 \amp 0 \amp 1 \amp 0 \\ 0 \amp 0 \amp 0 \amp 1 \\ 1 \amp 0 \amp 0 \amp 0 \end{pmatrix} \end{equation*}
and then we have it acting on a vector by matrix multiplication,
\begin{equation*} \begin{pmatrix} 0 \amp 1 \amp 0 \amp 0 \\ 0 \amp 0 \amp 1 \amp 0 \\ 0 \amp 0 \amp 0 \amp 1 \\ 1 \amp 0 \amp 0 \amp 0 \end{pmatrix} \begin{pmatrix} v_1 \\ v_2 \\ v_3\\ v_4 \end{pmatrix} = \begin{pmatrix} v_4 \\ v_1 \\ v_2\\ v_3 \end{pmatrix} \end{equation*}
Now consider the action of the symmetric group \(S_n\) on the polynomial ring \(R=\mathbb{K}[x_1,x_2,...,x_n]\text{.}\) The symmetric polynomials are the invariant polynomials under this action..

Definition 2.3.3.

We call \(f \in R\text{,}\) a symmetric polynomial if
\begin{equation*} f(x_1,x_2,...,x_n) = f(x_{\sigma(1)},x_{\sigma(2)},...,x_{\sigma(n)}) \end{equation*}
for all permutations of \(\sigma \in S_n\text{.}\)
An example of symmetric polynomials is given by the elementary symmetric polynomials.

Definition 2.3.4.

The elementary symmetric polynomials \(e_0,e_1,...,e_n\) in \(\mathbb{K}[x_1,...,x_n]\) are defined by
\begin{equation*} e_{m}=\sum_{|J|=m} \bar x_J = \sum_{j_1 \lt j_2 \lt ... \lt j_m} x_{j_1}x_{j_2}...x_{j_m}, \end{equation*}
with \(e_0=1\text{.}\)
More generally, we can consider a permutation action by some subgroup \(G\) of \(S_n\text{.}\) For any monomial in \(R\text{,}\) we can consider its orbit under the action of \(G\text{.}\)

Definition 2.3.5.

The \(G-orbit\) of any element \(f \in R\) is
\begin{equation*} \text{orb}(f) = \{g \cdot f \mid g \in G\}\text{.} \end{equation*}
Any permutation in \(G\) acts on the orbit \(\text{orb}(f)\) by rearranging its elements. As a result, the orbit sums will give us invariant polynomials.

Definition 2.3.6.

The orbit sum of \(f\) the sum of over the elements of \(\text{orb}(f)\text{.}\)
We can find a set of minimal invariants by computing all orbit sums of all monomials of degree \(\lt |G|\text{.}\) But this is computationally expensive and will lead to a lot of redundant computations. Instead, we will use a result that tells us that we only need to compute the orbit sums of some special monomials. Consider the exponent sequence \(\beta\) of a monomial \(\bar x^{\bar \beta}\) and rearrange it to obtain an integer partition \(\lambda\text{,}\) where \(\lambda_1 \gt \lambda_2 \gt ... \gt \lambda_m\)

Definition 2.3.7.

We call a monomial special if the entries in its associated partition decrease by at most one at each step and the last entry is 0.
The definition of special depends on the number of variables or the number of parts in the integer partition. So \(x_1^n x_2^{n-1}....x_{n-1}^1 x_n^0\) would not be special within \(\mathbb{K}[x_1, ... , x_{n-1}]\text{,}\) but it is special in \(\mathbb{K}[x_1, ... , x_{n}]\text{.}\)
We have that the bound follows from the theorem as the degree of a special momial is at most \(\binom{n}{2}\) and this is larger than \(n\text{,}\) the degree of \(e_n\text{,}\) when \(n \geq 3\text{.}\)
To show that orbits of special monomial generate the ring of invariants, one needs to consider a reduction argument. If you start with a non-special monomial, the entries of its partition are not decreasing by at most 1 and we call the first place where there is a jump a \(gap\) in the partition. Starting from a non-special monomial we can obtain a reduced monomial by decreasing all the largest exponents up to the gap by one. The reduced monomial will be closer to being special as the gap itself will be reduced by 1.

Example 2.3.10.

\(\mathbb{K}[x_1,x_2,x_3,x_4]\)\(x_1^2x_2^4x_3 \text{.}\)\((4,2,1)\)
\begin{equation*} x_1^2x_2^4x_3 \mapsto x_1^2x_2^3 x_3, \end{equation*}
Algorithmically, we can reduce any monomial to a special one by reducing the upper degrees repeatedly until the monomial is special. So the general idea of the proof of Gobel’s theorem is to show that the orbit sum of any monomial can be rewritten as a sum of orbit sums of special monomials or special monomials times some power of \(e_n\text{.}\) In our ongoing work we are using Gobel’s theorem as a tool for reducing the complexity of computing invariants for permutation actions.

Section 2.4 InvariantRings package

We conclude with references to the algorithms implemented in the InvariantRing package and examples of its implementation. Version 2.0 of this package was accepted for publication in volume 14 of Journal of Software for Algebra and Geometry on 2023-09-14, in the article The InvariantRing package for Macaulay2 (DOI: 10.2140/jsag.2024.14.5). That version can be obtained from the journal or from the Macaulay2 source code repository.

Subsection 2.4.1 References for the implemented algorithms

  • An elimination theory algorithm that computes the Hilbert ideal for any linearly reductive group: Derksen, H. and Kemper, G. (2015). Computational Invariant Theory. Heidelberg: Springer. Algorithm 4.1.9, pp 159-164
  • A simple and efficient algorithm for invariants of tori based on: Derksen, H. and Kemper, G. (2015). Computational Invariant Theory. Heidelberg: Springer. Algorithm 4.3.1 pp 174-177
  • An adaptation of the tori algorithm for invariants of finite abelian groups based on: Gandini, F. Ideals of Subspace Arrangements. Thesis (Ph.D.)-University of Michigan. 2019. ISBN: 978-1392-76291-2. pp 29-34.
  • King’s algorithm and the linear algebra method for invariants of finite groups: Derksen, H. and Kemper, G. (2015). Computational Invariant Theory. Heidelberg: Springer. Algorithm 3.8.2, pp 107-109; pp 72-74
  • The algorithms for primary and secondary invariants, and Molien series of finite groups implemented in version 1.1.0 of this package by: Hawes, T. Computing the invariant ring of a finite group. JSAG, Vol. 5 (2013). pp 15-19. DOI: 10.2140/jsag.2013.5.15
The orbit sum approach is under development and will be released with version 3.0 of the package. Our implementation is following the description by Mara D. Neusel, in her book Invariant Theory from the AMS The Student Mathematical Library (2007, Volume 36), DOI: http://dx.doi.org/10.1090/stml/036

Subsection 2.4.2 InvariantRing Library Demos

The InvariantRing package in Macaulay2 provides tools to study and compute invariant rings of group actions. To get started, install the package.

Example 2.4.1. Special Linear Group Actions on two variables.

A classical example: the standard action of \(\text{SL}_2\) on \(\mathbb{Q}^2\text{.}\) The ring R carries a linearly reductive action defined via the matrix SL2std. The invariants and Hilbert ideal are then computed.

Example 2.4.2. Diagonal Actions of Abelian Groups.

This example demonstrates a diagonal action of the abelian group \(C_3 \times C_3\) on a polynomial ring. After defining the diagonal weights, we compute the invariant ring and its Hilbert series.

Example 2.4.3. Linearly Reductive Actions: Permutations and Binary Forms.

Here’s how the symmetric group \(S_2\) acts via a matrix of projection operators. We identify which polynomials are invariant under the group action.
Now we compute the invariants of binary quadratics and quartics using \(\text{SL}_2\) actions. These involve basis substitutions in a ring of forms and are more computationally demanding.

Example 2.4.4. Matrix Invariants and Conjugation Actions.

We define SLβ‚‚ actions on 2\(\times\)2 and 3\(\times\)3 matrices of binary or ternary forms. The conjugation action creates sophisticated invariants under change of basis.
The same process is repeated for 3\(\times\) 3 matrices. This involves 9-dimensional vector spaces and is more computationally demanding.

Example 2.4.5. Finite Group Actions.

Finally, we examine the symmetric group \(S_4\) acting on 4 variables. The current version of the package can use both King’s algorithm and a slower linear algebra method to compute primary and secondary invariants. Future methods using Gobel’s theorem should improve on the speed of this computation.