---
title: "Fields with a Labelled Embedding"
canonical: "https://docs.magma-maths.org/v2.30-1/GlobalFields/NumberFields/embedded-number-fields.html"
source: "https://docs.magma-maths.org/v2.30-1/GlobalFields/NumberFields/embedded-number-fields.md"
part: "Global Fields"
chapter: "Number Fields"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "Global Fields", "source": "https://docs.magma-maths.org/v2.30-1/GlobalFields/index-global-fields.md"}
  - {"title": "Number Fields", "source": "https://docs.magma-maths.org/v2.30-1/GlobalFields/NumberFields/index-number-fields.md"}
prev: {"title": "Structure Operations", "source": "https://docs.magma-maths.org/v2.30-1/GlobalFields/NumberFields/operation.md"}
next: {"title": "Element Operations", "source": "https://docs.magma-maths.org/v2.30-1/GlobalFields/NumberFields/operation-element.md"}
intrinsics:
  - {"name": "EmbeddedNumberField", "signature": "EmbeddedNumberField(L, c): FldNum, FldComElt -> FldNumEmb"}
  - {"name": "EmbeddedNumberField", "signature": "EmbeddedNumberField(L, c): FldNum, FldReElt -> FldNumEmb"}
  - {"name": "HasEmbeddedNumberField", "signature": "HasEmbeddedNumberField(L, c): FldNum, FldComElt -> BoolElt, FldNumEmb"}
  - {"name": "HasEmbeddedNumberField", "signature": "HasEmbeddedNumberField(L, c): FldNum, FldReElt -> BoolElt, FldNumEmb"}
  - {"name": "EmbeddedNumberField", "signature": "EmbeddedNumberField(f, r): RngUPolElt, FldReElt -> FldNumEmb"}
  - {"name": "EmbeddedNumberField", "signature": "EmbeddedNumberField(f, r): RngUPolElt, FldComElt -> FldNumEmb"}
  - {"name": "HasEmbeddedNumberField", "signature": "HasEmbeddedNumberField(f, r): RngUPolElt, FldReElt -> BoolElt, FldNumEmb"}
  - {"name": "HasEmbeddedNumberField", "signature": "HasEmbeddedNumberField(f, r): RngUPolElt, FldComElt -> BoolElt, FldNumEmb"}
  - {"name": "EmbeddedNumberField", "signature": "EmbeddedNumberField(f, i): RngUPolElt, RngIntElt -> FldNumEmb"}
  - {"name": "EmbeddedNumberField", "signature": "EmbeddedNumberField(L, i): FldNum, RngIntElt -> FldNumEmb"}
  - {"name": "EmbeddedSplittingField", "signature": "EmbeddedSplittingField(f): RngUPolElt -> FldNumEmb, SeqEnum"}
  - {"name": "Subfield", "signature": "Subfield(L, K): FldNumEmb, FldNum -> FldNumEmb"}
  - {"name": "Composite", "signature": "Composite(K, L): FldNumEmb, FldNumEmb -> FldNumEmb"}
  - {"name": "Intersection", "signature": "Intersection(K, L): FldNumEmb, FldNumEmb -> FldNumEmb"}
  - {"name": "meet", "signature": "K meet L: FldNumEmb, FldNumEmb -> FldNumEmb"}
  - {"name": "IsSubfieldEmb", "signature": "IsSubfieldEmb(K, L): FldNumEmb, FldNumEmb -> BoolElt"}
  - {"name": "ComplexImage", "signature": "ComplexImage(x): FldNumElt -> FldComElt"}
  - {"name": "Embedding", "signature": "Embedding(K): FldNumEmb -> UserProgram"}
  - {"name": "Reconstruction", "signature": "Reconstruction(L, x): FldNumEmb, FldComElt -> BoolElt, FldNumElt"}
  - {"name": "Reconstruction", "signature": "Reconstruction(L, x): FldNumEmb, FldReElt -> BoolElt, FldNumElt"}
examples:
  - "ex-83530f"
---

# 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`.

<a id="function-embeddednumberfield-fldnum-fldcomelt"></a>
### `EmbeddedNumberField(L, c): FldNum, FldComElt -> FldNumEmb`

<a id="function-embeddednumberfield-fldnum-fldreelt"></a>
### `EmbeddedNumberField(L, c): FldNum, FldReElt -> FldNumEmb`

Turns $L$ into a Number Field with a labelled embedding that extends the labelled embedding of its base field and maps its generator to $c$. It reports an error when no embedding fits $c$, as when $c$ is too far from every root. It also reports an error when $c$ is too coarse to distinguish matching embeddings. Use `HasEmbeddedNumberField` to test without an error.

<a id="function-hasembeddednumberfield-fldnum-fldcomelt"></a>
### `HasEmbeddedNumberField(L, c): FldNum, FldComElt -> BoolElt, FldNumEmb`

<a id="function-hasembeddednumberfield-fldnum-fldreelt"></a>
### `HasEmbeddedNumberField(L, c): FldNum, FldReElt -> BoolElt, FldNumEmb`

Returns `true` if exactly one embedding of $L$ extends the labelled embedding of its base field and maps its generator to $c$. Returns `false` when no embedding fits $c$ or when $c$ is too coarse to distinguish matching embeddings. When the answer is `true`, the second value is $L$ as a Number Field with that labelled embedding.

<a id="function-embeddednumberfield-rngupolelt-fldreelt"></a>
### `EmbeddedNumberField(f, r): RngUPolElt, FldReElt -> FldNumEmb`

<a id="function-embeddednumberfield-rngupolelt-fldcomelt"></a>
### `EmbeddedNumberField(f, r): RngUPolElt, FldComElt -> FldNumEmb`

Constructs the Number Field defined by $f$ with a labelled embedding. The embedding extends that of the coefficient field and maps the generator to $r$. It reports an error when no embedding fits $r$ or when $r$ is too coarse to distinguish matching embeddings. Use `HasEmbeddedNumberField` to test without an error.

<a id="function-hasembeddednumberfield-rngupolelt-fldreelt"></a>
### `HasEmbeddedNumberField(f, r): RngUPolElt, FldReElt -> BoolElt, FldNumEmb`

<a id="function-hasembeddednumberfield-rngupolelt-fldcomelt"></a>
### `HasEmbeddedNumberField(f, r): RngUPolElt, FldComElt -> BoolElt, FldNumEmb`

Returns `true` if the Number Field defined by $f$ has exactly one matching embedding. That embedding extends the labelled embedding of its coefficient field and maps its generator to $r$. Returns `false` when no embedding fits $r$ or when $r$ is too coarse to distinguish matching embeddings. When the answer is `true`, the second value is that Number Field with the labelled embedding.

<a id="function-embeddednumberfield-rngupolelt-rngintelt"></a>
### `EmbeddedNumberField(f, i): RngUPolElt, RngIntElt -> FldNumEmb`

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

<a id="function-embeddednumberfield-fldnum-rngintelt"></a>
### `EmbeddedNumberField(L, i): FldNum, RngIntElt -> FldNumEmb`

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

<a id="function-embeddedsplittingfield-rngupolelt"></a>
### `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.

<a id="function-subfield-fldnumemb-fldnum"></a>
### `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.

<a id="function-composite-fldnumemb-fldnumemb"></a>
### `Composite(K, L): FldNumEmb, FldNumEmb -> FldNumEmb`

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

<a id="function-intersection-fldnumemb-fldnumemb"></a>
### `Intersection(K, L): FldNumEmb, FldNumEmb -> FldNumEmb`

<a id="operation-op-meet-fldnumemb-fldnumemb"></a>
### `K meet L: FldNumEmb, FldNumEmb -> FldNumEmb`

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

<a id="function-issubfieldemb-fldnumemb-fldnumemb"></a>
### `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.

<a id="function-compleximage-fldnumelt"></a>
### `ComplexImage(x): FldNumElt -> FldComElt`

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

The image of $x$ in the complex numbers.

<a id="function-embedding-fldnumemb"></a>
### `Embedding(K): FldNumEmb -> UserProgram`

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

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

<a id="function-reconstruction-fldnumemb-fldcomelt"></a>
### `Reconstruction(L, x): FldNumEmb, FldComElt -> BoolElt, FldNumElt`

<a id="function-reconstruction-fldnumemb-fldreelt"></a>
### `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.

<a id="example-ex-83530f"></a>
### `Example: Creating an Embedded Number Field (ex-83530f)`

The approximation $2.0$ is too far from $7^{1/3}$ to identify an embedding. The approximation $1.913$ is close enough.

The polynomial $x^2 - 2x + 1 - 2/10^{12}$ has roots $1 \pm \sqrt{2}/10^6$. An approximation with five significant digits does not distinguish them. An approximation with 20 digits does:

```magma
> _<x> := PolynomialRing(Integers());
> K := NumberField(x^3-7);
> HasEmbeddedNumberField(K,2.0);
false
> HasEmbeddedNumberField(K,1.913);
true Number Field with defining polynomial x^3 - 7 over the Rational
Field
> f := ChangeRing(x^2 - 2*x + 1, Rationals()) - 2/10^12;
> HasEmbeddedNumberField(f, RealField(5)!1.0000);
false
> R := RealField(20);
> ok, M := HasEmbeddedNumberField(f, R!1.0000014142135623731);
> ok;
true
> ComplexImage(M.1);
1.00000141421356237309504880169
> 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());
> K := EmbeddedNumberField(x^6-3,3^(1/6));
> L := EmbeddedNumberField(x^9-3,3^(1/9));
> K meet L;
Number Field with defining polynomial $.1^3 + 9*$.1^2 + 27*$.1 + 18
over the Rational Field
> C := Composite(K,L);
> Degree(C);
18
> IsSubfieldEmb(K,C) and IsSubfieldEmb(L,C);
true
```

Here is an example to work with towers of fields:

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

The labelled embeddings determine the composite. Let $w$ be the cube root of 2 with positive imaginary part. Label $K = \Q(2^{1/3})$ at the complex conjugate of $w$, and label $L = \Q(\sqrt{2})(2^{1/3})$ at $w$. Their composite contains both $w$ and its conjugate. It therefore contains $\zeta_3$ and is $\Q(\sqrt{2}, 2^{1/3}, \zeta_3)$, of degree 12. The displayed images of the generators verify that the composite retains both labelled embeddings:

```magma
> _<x> := PolynomialRing(Integers());
> CC<i> := ComplexField(30);
> w := 2^(1/3) * (-1 + Sqrt(CC!-3))/2;
> w;
-0.629960524947436582383605303639 + 1.09112363597172140356007261419*i
> K := EmbeddedNumberField(x^3-2, ComplexConjugate(w));
> S := EmbeddedNumberField(x^2-2, Sqrt(2));
> _<y> := PolynomialRing(S);
> L := EmbeddedNumberField(y^3-2, w);
> C := Composite(K,L);
> AbsoluteDegree(C);
12
> ComplexImage(C!K.1);
-0.629960524947436582383605303639 - 1.09112363597172140356007261419*i
> ComplexImage(C!L.1);
-0.629960524947436582383605303639 + 1.09112363597172140356007261419*i
```
