# Automorphism Groups

Automorphisms of an algebraic field and the group they form can be calculated. Furthermore, field invariants that relate to the automorphism group can be determined.

## `Automorphisms(F): FldAlg -> [ Map ]`

```magma
Abelian: BoolElt                              Default: false
verbose: AutomorphismGroup                    Default: Verbose : 3
```

Given an algebraic field $F$, return the automorphisms of $F$ as a sequence of maps. If the extension is known to be abelian, the parameter `Abelian` should be set to `true` in which case a much more efficient algorithm [[Acciaro and Klüners, 1999](../../references.md#cite-ackl1), [Klüners, 1997](../../references.md#cite-kl2)] will be employed. If $F$ is not a normal extension, the automorphisms are obtained by a variation of the polynomial factorisation algorithm.

## `AutomorphismGroup(F): FldAlg -> GrpPerm, PowMap, Map`

```magma
Abelian  : BoolElt                              Default: false
UseGalois: BoolElt                              Default: false
verbose  : AutomorphismGroup                    Default: Verbose : 3
```

Given an algebraic field $F$, that is either a simple normal extension of ${\mathbb{Q}}$ or simple abelian extension of ${\mathbb{Q}}$, return the automorphism group $G$ of $K$ as a permutation group of degree $n$, where $n$ is the degree of the extension. If the extension is known to be abelian, the parameter `Abelian` should be set to `true` in which case a much more efficient algorithm [[Acciaro and Klüners, 1999](../../references.md#cite-ackl1), [Klüners, 1997](../../references.md#cite-kl2)] will be employed. If `UseGalois` is set, `GaloisGroup` will be called and the result will be derived from that. If $F$ is not a normal extension of ${\mathbb{Q}}$ an error will occur. In addition to returning $G$, the function also returns the power structure $Aut$ of all automorphisms of $F$, and the transfer map $\phi$ from $G$ into $Aut$.

## `Example: Automorphisms (ex-7b9102)`

We consider the extension obtained by adjoining a root of the irreducible polynomial $x^4 - 4x^2 + 1$ to ${\mathbb{Q}}$.

```magma
> Q := RationalField();
> R<x> := PolynomialRing(Q);
> K<w> := NumberField(x^4 - 4*x^2 + 1);
> A := Automorphisms(K);
> A;
[
    Mapping from: FldNum: K to FldNum: K,
    Mapping from: FldNum: K to FldNum: K,
    Mapping from: FldNum: K to FldNum: K,
    Mapping from: FldNum: K to FldNum: K
]
> for phi in A do phi(w); end for;
w
w^3 - 4*w
-w^3 + 4*w
-w

```

Taking the same field $K$ we use instead the function `AutomorphismGroup`:

```magma
> G, Aut, tau := AutomorphismGroup(K);
> for x in G do tau(x)(w); end for;
w
w^3 - 4*w
-w^3 + 4*w
-w

```

## `AutomorphismGroup(K, F): FldAlg, FldAlg -> GrpPerm, PowMap, Map`

## `AutomorphismGroup(K, F): FldRat, FldAlg -> GrpPerm, PowMap, Map`

## `AutomorphismGroup(K, F): FldAlg, FldRat -> GrpPerm, PowMap, Map`

Computes the group of $K$ automorphisms of $F$ as a permutation group together with a list of all automorphisms and a map between the permutation group and explicit automorphisms of the field.

This function computes the automorphism group of $F$ over ${\mathbb{Q}}$ first.

## `DecompositionGroup(p): RngIntElt -> GrpPerm`

## `DecompositionGroup(p): RngOrdIdl -> GrpPerm`

For an ideal $p$ of the maximal order of some absolute normal field $F$ with group of automorphisms $G$, compute the decomposition group, i.e. the subgroup $U$ of the automorphism group such that:

$$
U := \{ s \in G | s(p) = p \}
$$

If $F$ is not a normal extension of ${\mathbb{Q}}$ an error will occur.

## `RamificationGroup(p, i): RngOrdIdl, RngIntElt -> GrpPerm`

For an ideal $p$ of the maximal order $M$ of some absolute normal field $F$ with group of automorphisms $G$, compute the $i$-th ramification group, i.e. the subgroup $U$ of the automorphism group such that:

$$
U := \{ s \in G | s(x) - x \in p^{i+1} \text{for all }x\text{ in }M \}
$$

If $F$ is not a normal extension of ${\mathbb{Q}}$ an error will occur.

## `RamificationGroup(p): RngOrdIdl -> GrpPerm`

This is just an abbreviation for `RamificationGroup(p, 1)`.

## `InertiaGroup(p): RngOrdIdl -> GrpPerm`

This is just an abbreviation for `RamificationGroup(p, 0)`.

## `FixedField(K, U): FldAlg, GrpPerm -> FldNum, Map`

Given a normal field $K$ over ${\mathbb{Q}}$ and a subgroup $U$ of `AutomorphismGroup(K)`, this returns the largest subfield of $K$ that is fixed by $U$.

This function is inverse to [`FixedGroup`](#function-rngord-fixedgroup).

If $K$ is not a normal extension of ${\mathbb{Q}}$ an error will occur.

## `FixedField(K, S): FldAlg, [Map] -> FldAlg, Map`

Given a field $K$ and a sequence of automorphisms of $K$, this returns the largest subfield of $K$ that is fixed by the given automorphisms.

## `FixedGroup(K, L): FldAlg, FldAlg -> GrpPerm`

Given a normal field $K$ over ${\mathbb{Q}}$ and a subfield $L$, compute the subgroup $U$ of the `AutomorphismGroup(K)` that fixes $L$.

This function is inverse to [`FixedField`](#function-rngord-fixedfield).

If $K$ is not a normal extension of ${\mathbb{Q}}$ an error will occur.

## `FixedGroup(K, L): FldAlg, [FldAlgElt] -> GrpPerm`

Given a normal field $K$ over ${\mathbb{Q}}$ and a sequence of number field elements $L$, compute the subgroup $U$ of the `AutomorphismGroup(K)` that fixes $L$.

If $K$ is not a normal extension of ${\mathbb{Q}}$ an error will occur.

## `FixedGroup(K, a): FldAlg, FldAlgElt -> GrpPerm`

Given a normal field $K$ over ${\mathbb{Q}}$ and a number field element $a$, compute the subgroup $U$ of the `AutomorphismGroup(K)` that fixes $a$.

This function is inverse to [`FixedField`](#function-rngord-fixedfield).

If $K$ is not a normal extension of ${\mathbb{Q}}$ an error will occur.

## `DecompositionField(p): RngOrdIdl -> FldNum, Map`

This is an abbreviation for `FixedField(K, DecompositionGroup(p))` where $K$ is the number field of the order of $p$.

## `RamificationField(p, i): RngOrdIdl, RngIntElt -> FldNum, Map`

This is an abbreviation for `FixedField(K, RamificationGroup(p, i))` where $K$ is the number field of the order of $p$.

## `RamificationField(p): RngOrdIdl -> FldNum, Map`

This is an abbreviation for `FixedField(K, RamificationGroup(p))` where $K$ is the number field of the order of $p$.

## `InertiaField(p): RngOrdIdl -> FldNum, Map`

This is an abbreviation for `FixedField(K, InertiaField(p))` where $K$ is the number field of the order of $p$.

## `Example: Ramification (ex-3b0e83)`

We will demonstrate the various groups and fields. In order to do so, we first construct a non-trivial normal field.

```magma
> o := MaximalOrder(ext<Rationals()|>.1^4-3);
> os := MaximalOrder(SplittingField(NumberField(o)));
> P := Decomposition(os, 2)[1][1];
> G, M := RayClassGroup(P^3);
> G;
Abelian Group isomorphic to Z/2
Defined on 1 generator
Relations:
    2*G.1 = 0

```

Since $G$ is cyclic and the module $P$ invariant under the automorphisms of $os$, the class field corresponding to $G$ will be normal over $Q$. It Galois group over $Q$ will be an extension of $D_4$ by $C_2$.

```magma
> A := AbelianExtension(M);
> O := MaximalOrder(EquationOrder(A));
> Oa := AbsoluteOrder(O);
> Ka := NumberField(Oa);
> Gal, _, Map := AutomorphismGroup(Ka);
> Gal;
Permutation group Gal acting on a set of cardinality 16
Order = 16 = 2^4
    (1, 2, 7, 5)(3, 8, 6, 10)(4, 12, 14, 9)(11, 16, 13, 15)
    (1, 3, 7, 6)(2, 8, 5, 10)(4, 13, 14, 11)(9, 16, 12, 15)
    (1, 4)(2, 9)(3, 11)(5, 12)(6, 13)(7, 14)(8, 15)(10, 16)

```

Now, let us pick some ideals. The only interesting primes are the primes dividing the discriminant, which in this case will be the primes over $2$ and $3$.

```magma
> P2 := Decomposition(Oa, 2)[1][1];
> P3 := Decomposition(Oa, 3)[1][1];

```

First, the valuation of the different of $Oa$ at $P2$ should be $\sum_{i=0}^\infty (\#G(P2, i)-1)$ where $G(P2, i)$ is the $i$-th ramification group.

```magma
> s := 0; i := 0;
> repeat
>   G := RamificationGroup(P2, i);
>   s +:= #G-1;
>   print i, "-th ramification group is of order ", #G;
>   i +:= 1;
> until #G eq 1;
0 -th ramification group is of order  8
1 -th ramification group is of order  8
2 -th ramification group is of order  2
3 -th ramification group is of order  2
4 -th ramification group is of order  2
5 -th ramification group is of order  2
6 -th ramification group is of order  1
> s;
18
> Valuation(Different(Oa), P2);
18

```

According to the theory, $P2$ should be totally ramified over the inertia field and unramified over $Q$:

```magma
> K2 := InertiaField(P2);
> M2 := MaximalOrder(K2);
> K2r := RelativeField(K2, Ka);
> M2r := MaximalOrder(K2r);
> p2 := M2 meet (MaximalOrder(K2r)!!P2);
> IsInert(p2);
true
> IsTotallyRamified(M2r!!P2);
true

```

Now we try the same for $P3$. Since $3$ is split in $Ka$, we may consider an additional field: the decomposition field. It should be the maximal subfield if $K$ such that $3$ is neither inert ($f=1$) nor ramified ($e=1$), therefore $3$ has to split totally.

```magma
> D3 := DecompositionField(P3);
> D3M := MaximalOrder(D3);
> IsTotallySplit(3, D3M);
true

```

The inertia field is the maximal subfield such that $3$ is unramified. It has to be an extension of $D3$.

```magma
> I3 := InertiaField(P3);
> I3;
Number Field with defining polynomial $.1^4 +
    80346384509631057182412*$.1^3 +
    2256835583037881432653115137736209396615693022*$.\\
    1^2 + 2795818092855476469056989739955845736579291605177\\
    3809455107173769804*$.1 +
    2207787685682553980385342263526644079975418801375161428\\
    41147104301325760481728833650060994 over the Rational
Field
> Discriminant($1);
10700005925626216180895747020647047166414333000723923591882\\
57829873417638072117114945163507537844711544617147344227643\\
21408503489566949866295669400825222748660907808235401444104\\
29329493645714658394673579309893726532999745496689571082958\\
8286937125090034449967033769822464

```

This (polynomial) discriminant is huge, in fact it is so large that we should avoid the factorisation. We already know the discriminant of $Ka$. The discriminant of $I3$ has to be a divisor - so we can use the `Discriminant` parameter to `MaximalOrder`: (We are going to need the `MaximalOrder` for the following embedding.)

```magma
> I3M := MaximalOrder(EquationOrder(I3):
> Discriminant := Discriminant(Oa));
> I3M := MaximalOrder(I3);

```

$D3$ should be a subfield of $I3$, so lets verify it:

```magma
> IsSubfield(D3, I3);
true Mapping from: FldNum: D3 to FldNum: I3

```

As a side-effect, Magma is now aware of the embedding and will use it. Without the `IsSubfield` call, the `RelativeField` function will fail.

```magma
> I3r := RelativeField(D3, I3);
> I3rM := MaximalOrder(I3r);
> K3r := RelativeField(D3, Ka);
> K3rM := MaximalOrder(K3r);
> IsInert(K3rM!!P3 meet D3M, I3rM);
true

```

The last step: verify that $P3$ is totally ramified over $I3$:

```magma
> K3r := RelativeField(I3, Ka);
> K3rM := MaximalOrder(K3r);
> IsTotallyRamified(K3rM!!P3 meet I3M, K3rM);
true

```

Using the decomposition group, we can get the splitting behaviour of any prime in any subfield of $Ka$.

```magma
> L := SubgroupLattice(Gal);
> [ IsNormal(Gal, L[x]) : x in [1..#L]];
[ true, true, true, true, false, false, false, false, true,
true, true, true, true, true, true, false, false, false,
false, true, true, true, true, true, true, true, true ]
> U := L[5];
> k := FixedField(Ka, U);
> kM := MaximalOrder(EquationOrder(k) :
>                    Discriminant := Discriminant(Oa));
> kM := MaximalOrder(k);
> Kr := RelativeField(k, Ka);
> KrM := MaximalOrder(Kr);
> P43 := Decomposition(Oa, 43)[1][1];
> V := DecompositionGroup(P43);

```

The splitting behaviour is determined by the double coset decomposition of $Gal$ with respect to $U$ and $V$:

```magma
> f, I := CosetAction(Gal, U);
> orbs := Orbits(f(V));
> reps := [];
> for o in orbs do
>   _, x := IsConjugate(I, 1, Rep(o));
>   Append(~reps, x @@ f);
> end for;
> reps;
[
    Id(G),
    (1, 2, 7, 5)(3, 8, 6, 10)(4, 12, 14, 9)(11, 16, 13, 15),
    (1, 7)(2, 5)(3, 6)(4, 14)(8, 10)(9, 12)(11, 13)(15, 16),
    (1, 8)(2, 6)(3, 5)(4, 15)(7, 10)(9, 13)(11, 12)(14, 16),
]
> #reps;
4

```

So there will be at least $4$ prime ideals over $43$ in $k$:

```magma
> L := [ ];
> for i in reps do
>   Append(~L, kM meet KrM !! Map(i)(P43));
> end for;
> [ IsPrime(x) : x in L];
[ true, true, true, true ]
> LL := Decomposition(kM, 43);#LL;
4
> [ Position(L, x[1]) : x in LL];
[ 4, 3, 1, 2 ]

```

## `FrobeniusElement(K, p): FldNum, RngIntElt -> GrpPermElt`

Compute a Frobenius element at $p$ in the Galois group of the Galois closure of $K$. This is a permutation on the roots of a polynomial defining $K$, which can be recovered as `DefiningPolynomial(A)` for any Artin representation $A$ of $K$; the Frobenius element is well-defined up to conjugacy and modulo inertia.

## `Example: Nf Sig FrobeniusElement (ex-87fbb9)`

We take a polynomial whose Galois group is $D_5$ and compute Frobenius elements at $p=2$ and $p=5$. They in two different conjugacy classes of 5-cycles in the Galois group.

```magma
> load galpols;
> f:=PolynomialWithGaloisGroup(5,2);
> assert IsIsomorphic(GaloisGroup(f),DihedralGroup(5));
> K:=NumberField(f);
> FrobeniusElement(K,2);
(1, 5, 4, 3, 2)
> FrobeniusElement(K,5);
(1, 3, 5, 2, 4)

```
