# Invariant Rings of Finite Groups

## Creation

Let $G$ be a finite matrix or permutation group acting on the polynomial ring $P = K[x_1, \ldots, x_n]$ over the field $K$. Magma allows the construction of the invariant ring $R=K[V]^G$. The invariant ring $R$ is a special structure which contains references to the group $G$ and polynomial ring $P$. When the invariant ring $R$ is created using the `InvariantRing` function, no explicit calculations are done until specifically invoked (e.g., by the [`PrimaryInvariants`](primary.md#function-rnginvar-primaryinvariants) function). The elements of $R$ are the polynomials of $P$ which are invariant under the action of $G$. Note that the parent of such polynomials is still $P$ – the invariant ring $R$ is just a special structure which contains all the information about the invariant ring. The category of invariant rings is `RngInvar`.

### `InvariantRing(G): GrpMat -> RngInvar`

### `InvariantRing(G, K): GrpPerm, Fld -> RngInvar`

Construct the invariant ring $R=K[V]^G$ of the finite matrix or permutation group $G$ over the field $K$. For a matrix group $G$, $G$ alone should be supplied, while for a permutation group $G$, $G$ should be supplied, together with the field $K$. The appropriate multivariate polynomial ring $P$ is automatically constructed. No other explicit calculations are done (e.g. computation of primary invariants).

## Access

The following functions allow simple access to basic properties of invariant rings.

### `Group(R): RngInvar -> Grp`

Given the invariant ring $R=K[V]^G$ of the group $G$ over the field $K$, return the group $G$.

### `CoefficientRing(R): RngInvar -> Grp`

### `CoefficientField(R): RngInvar -> Rng`

Given the invariant ring $R=K[V]^G$ of the group $G$ over the field $K$, return the coefficient field $K$.

### `PolynomialRing(R): RngInvar -> RngMPol`

Given an invariant ring $R=K[V]^G$ of the group $G$ of degree $n$ over the field $K$, return the polynomial ring $P = K[x_1, \ldots, x_n]$ in which the invariants of $R$ lie. $P$ has the print names `"x1", "x2"`, etc. – the angle bracket notation or the $.$ operator should be used to assign the variables of $P$ to actual Magma variables.

### `f in R: RngMPol, RngInvar -> FldFunUElt, ModMPolElt`

Return whether the polynomial $f$ is in $R=K[V]^G$. Note that the parent of $f$ is always the polynomial ring $P$, never $R$, so a `true` result does not mean that the parent of $f$ is $R$.
