# Related Functions

This section list some related functions that are either useful in the context of class fields for function fields or are necessary for their computation. They will most certainly change their appearance.

## `StrongApproximation(m, S): DivFunElt, [<PlcFunElt, FldFunElt>] -> FldFunElt`

```magma
Strict   : BoolElt                      Default: false
Exception: DivFunElt                    Default: false
Raw      : BoolElt                      Default: false
```

Given an effective divisor $m$ and a sequence $S$ of pairs $(Q_i, e_i)$ of places and elements, find an element $a$ and a place $Q_0$ such that

$$
v_{Q_i}(a-e_i) \geq v_{Q_i}(m),
$$

and $a$ is integral everywhere outside $Q_i$ ($0\leq i\le n$).

If `Exception` is not `false`, it has to be a place that will be used for $Q_0$.

If `Strict` is `true`, the element $a$ will be chosen such

$$
v_{Q_i}(a-e_i) = v_{Q_i}(m)
$$

If `Raw` is `true`, different rather technical return values are computed that are used internally.

## `StrongApproximation(S, Z, V): [PlcFunElt], [FldFunGElt], [RngIntElt] -> FldFunElt`

```magma
Strict: BoolElt                    Default: false
```

Given a sequence $S$ of either finite or infinite places of a function field, a sequence $Z$ of elements of a function field and a sequence $V$ of integers, return an element $z$ such that $z - Z[i]$ has valuation at least $V[i]$ at $S[i]$ and positive valuation at all other places of same finiteness as those in $S$ which do not appear in $S$. If the parameter `Strict` is set to `true` then $z$ will be computed such that $v_{S[i]}(z - Z[i]) = V[i]$.

## `ChineseRemainderTheorem(S, Z, V): [PlcFunElt], [FldFunGElt], [RngIntElt] -> FldFunElt`

## `CRT(S, Z, V): [PlcFunElt], [FldFunGElt], [RngIntElt] -> FldFunElt`

```magma
IntegralOutside: BoolElt                    Default: false
```

Given a sequence $S$ of either finite or infinite places of a function field, a sequence $Z$ of elements of a function field and a sequence $V$ of integers, return an element $z$ such that $z - Z[i]$ has valuation at least $V[i]$ at $S[i]$. If the parameter `IntegralOutside` is set to `true` then $z$ will be computed such that it is integral at all other places of same finiteness as those in $S$ which do not appear in $S$.

## `Example: Strong Approximation (ex-8bc2d0)`

We first have to define a function field and some places:

```magma
> k<w> := GF(4);
> kt<t> := PolynomialRing(k);
> ktx<x> := PolynomialRing(kt);
> K := FunctionField(x^3-w*t*x^2+x+t);
> lp := Places(K, 2);

```

We will now try to find an element $x$ in $K$ such that $v_{p_i}(x-e_i) \geq m_i$ for $p_i =$`lp[i]`, $m_i = i$ and random elements $e_i$:

```magma
> e := [Random(K, 3) : i in lp];
> m := [i : i in [1..#lp]];
> D := &+ [ m[i]*lp[i] : i in [1..#lp]];
> x := StrongApproximation(D, [<lp[i], e[i]> : i in [1..#lp]]);
> [Valuation(x-e[i], lp[i]) : i in [1..#lp]];
[ 1, 2, 3, 4, 5, 6 ]

```

Note, that we only required $\geq$ for the valuations, to enforce $=$ we would need to pass the `Strict` option. This will double the running time.

## `NonSpecialDivisor(m): DivFunElt -> DivFunElt, RngIntElt`

```magma
Exception: DivFunElt                    Default: 
```

Given an effective divisor $m$, find a place $P$ coprime to $m$ and an integer $r\geq 0$ such that $rP-m$ is a non special divisor and return $r$ and $P$.

If `Exception` is specified, it must be an effective divisor $n$ coprime to $m$. In this case the function finds $r>0$ such that $rn-m$ is non special and returns $r$ and $n$.

## `NormGroup(F): FldFun -> DivFunElt, GrpAb`

```magma
Cond : DivFunElt                     Default: 
AS   : RngWittElt                    Default: 
Extra: RngIntElt                     Default: 5
```

Given a global function field, try to compute its norm group. The norm group is defined to be the group generated by norms of unramified divisors. This group can be related to a subgroup of some ray class group.

Provided $F$ is abelian, this function will compute a divisor $m$ and a sub group $U$ of the ray class group modulo $m$ such that $F$ is isomorphic to the ray class field thus defined.

This function uses a heuristic algorithm. It will terminate after the size of the quotient by the norm group is less or equal than the degree for `Extra` many places.

If `Cond` is given, it must be an effective divisor that will be used as the potential conductor of $F$. Note: if `Cond` is too small, ie. a proper divisor of the true conductor, the result of this function will be wrong. However, if the conductor is not passed in, the discriminant divisor is used as a starting point. As this is in general far too large, the function will be much quicker if a better (smaller) starting point is passed in.

If `AS` is given, it must be a Witt vector $e$ of appropriate length and $F$ should be the corresponding function field. This allows a much better initial guess for the conductor than using the discriminant.

## `Sign(a, p): FldFunElt, PlcFunElt -> RngElt`

Given a function $a$ in some global function field and a place $p$ such that $a$ is integral at $p$ (has non-negative valuation) return the sign of $a$, ie. the first non-zero coefficient if the expansion of $a$ at $p$. The sign function is not unique. Magma choses a sign function when creating the residue class field map.

## `ChangeModel(F, p): FldFun, PlcFunElt -> FldFun`

Given a global function field $F$ and a place $p$, return a new function field $G$ that is ${\mathbb{F}}_q$-isomorphic to $F$ and has $p$ as the only infinite place.

## `ArtinSchreierReduction(u, P): FldFunGElt, PlcFunElt -> RngIntElt, FldFunElt`

Return the valuation of $u - (z^p - z)$ at $P$ and an element $z$ such that this valuation is either positive or not congruent to $0 \mod p$ where $p$ is the characteristic of the field of $u$.
