# Fields with a Labelled Embedding

A Number Field has several diffenent embeddings into the complex numbers. An embedded Number Field is a Number Field such that one of these embeddings is labelled. These fields form a category named `FldNumEmb`.

## Creation Functions

Functions are provided to create fields of the special type `FldNumEmb`.

### `EmbeddedNumberField(L, c): FldNum, FldComElt -> BoolElt, FldNumEmb`

### `EmbeddedNumberField(L, c): FldNum, FldReElt -> BoolElt, FldNumEmb`

Attempts to turn $L$ into a Number Field with labelled embedding, such that its generator is mapped to a complex number with approximation $c$. It returns `true` if such an embedding can be identified, otherwise `false`.

### `EmbeddedNumberField(f, r): RngUPolElt, FldReElt -> BoolElt, FldNumEmb`

### `EmbeddedNumberField(f, r): RngUPolElt, FldComElt -> BoolElt, FldNumEmb`

Attempts to construct a Number Field with defining polynomial $f$ and a labelled embedding, such that its generator is mapped to a complex number with approximation $r$. It returns `true` if such an embedding can be identified, otherwise `false`.

### `EmbeddedNumberField(f, i): RngUPolElt, RngIntElt -> FldNumEmb`

Constructs a Number Field with defining polynomial $f$ and labelled embedding with number $i$.

### `EmbeddedNumberField(L, i): FldNum, RngIntElt -> FldNumEmb`

Constructs a Number Field with labelled embedding with number $i$ and the same defining polynomial as $L$.

### `EmbeddedSplittingField(f): RngUPolElt -> FldNumEmb, SeqEnum`

Constructs the splitting field of $f$ as number field with labelled embedding. The second return value are the roots of $f$ in the splitting field.

### `Subfield(L, K): FldNumEmb, FldNum -> FldNumEmb`

Turns the subfield $K$ of the Number Field $L$ with labelled embedding into a number field with labelled embedding.

## Composition and Intersection

Number fields with a fixed embedding into the complex numbers have a unique composition and intersection as subfields of the complex numbers. The following functions are availabe to work in the subfield lattice.

### `Composite(K, L): FldNumEmb, FldNumEmb -> FldNumEmb`

The unique composite of $K$ and $L$ as a number field with labelled embedding.

### `Intersection(K, L): FldNumEmb, FldNumEmb -> FldNumEmb`

### `K meet L: FldNumEmb, FldNumEmb -> FldNumEmb`

The unique intersection of $K$ and $L$ as a number field with labelled embedding.

### `IsSubfieldEmb(K, L): FldNumEmb, FldNumEmb -> BoolElt`

Returns `true` if the image of $K$ in the complex numbers is a subfield of the image of $L$ and `false` otherwise.

## Embedding and Reconstruction

The following functions are available to work with elements of a number field with a labelled embedding.

### `ComplexImage(x): FldNumElt -> FldComElt`

```magma
Precision: RngIntElt                    Default: 30
```

The image of $x$ in the complex numbers.

### `Embedding(K): FldNumEmb -> UserProgram`

```magma
Precision: RngIntElt                    Default: 30
```

The labelled embeding of $K$ into the complex numbers as a user program.

### `Reconstruction(L, x): FldNumEmb, FldComElt -> BoolElt, FldNumElt`

### `Reconstruction(L, x): FldNumEmb, FldReElt -> BoolElt, FldNumElt`

```magma
UseLLLOrder: BoolElt                    Default: false
```

Attempts to reconstruct $x$ as an element in $L$. Returns `true` if successful and `false` otherwise. If the option `UseLLLOrder` is set, and LLL basis of the maximal order will be used.

### `Example: Fldemb Eg 1 (ex-83530f)`

Here is a basic example:

```magma
> _<x> := PolynomialRing(Integers());
> K := NumberField(x^3-7);
> suc, L := EmbeddedNumberField(K,7^(1/3));
> ComplexImage(L.1 + L.1^2);
5.57223689279536061843719014967
> Reconstruction(L,1/2 + 7^(1/3) + 5 * 7^(2/3));
true 1/2*(10*L.1^2 + 2*L.1 + 1)
> Reconstruction(L,Sqrt(-1));
false

```

Intersection and composition can be used as follows:

```magma
> _<x> := PolynomialRing(Integers());
> suc, K := EmbeddedNumberField(x^6-3,3^(1/6));
> suc, L := EmbeddedNumberField(x^9-3,3^(1/9));
> K meet L;
> Composite(K,L);

```

Here is an example to work with towers of fields:

```magma
> _<x> := PolynomialRing(Integers());
> suc, K := EmbeddedNumberField(x^2-2,Sqrt(2));
> suc, L := EmbeddedNumberField(Polynomial([-K.1,0,1]),2^(1/4));
> ComplexImage(L.1);
1.18920711500272106671749997056
> ComplexImage(L!(K.1));
1.41421356237309504880168872421

```
