Fix an algebraic closure
of
. Thus
is an infinite
field extension of
with the property that every polynomial
splits as a product of linear factors in
. One
choice of
is the subfield of the complex numbers
generated by all roots in
of all polynomials with coefficients
in
. Note that any two choices of
are isomorphic, but there will
be many isomorphisms between them.
An algebraic integer is an element of
.
sage: (1/2).minpoly() x - 1/2We construct a root
sage: k.<a> = NumberField(x^2 - 2) sage: a^2 - 2 0 sage: a.charpoly() x^2 - 2Finally we compute the minimal polynomial of
sage: (a/2 + 3).charpoly() x^2 - 6*x + 17/2
The only elements of
that are algebraic integers are the usual
integers
. However, there are elements of
that have
denominators when written down, but are still algebraic integers. For example,
sage: k.<a> = QuadraticField(5) sage: a^2 5 sage: alpha = (1 + a)/2 sage: alpha.charpoly() x^2 - x - 1 sage: alpha.is_integral() True
sage: k.<a> = NumberField(x^4 - 2) sage: a^4 2 sage: (a^2 + 3).minpoly() x^2 - 6*x + 7
sage: k.<a, b> = NumberField([x^2 - 2, x^3 - 5]) sage: k Number Field in a with defining polynomial x^2 + -2 over its base field
Here and
are roots of
and
, respectively.
sage: a^2 2 sage: b^3 5
We compute the minimal polynomial of the sum and product of
and
. The command absolute_minpoly
gives the minimal polynomial of the element over the rational numbers.
sage: (a+b).absolute_minpoly() x^6 - 6*x^4 - 10*x^3 + 12*x^2 - 60*x + 17 sage: (a*b).absolute_minpoly() x^6 - 200Of course the minimal polynomial of the product is
The following is an alternative more symbolic way to compute the
minimal polynomials above, though it is not provably correct. We
compute to 100 bits precision (via the n command), then
use the LLL algorithm (via the algdep command) to heuristically
find a linear relation between the first
powers of
.
sage: a = 5^(1/3); b = sqrt(2) sage: c = a+b; c 5^(1/3) + sqrt(2) sage: (a+b).n(100).algdep(6) x^6 - 6*x^4 - 10*x^3 + 12*x^2 - 60*x + 17 sage: (a*b).n(100).algdep(6) x^6 - 200
If is a number field, then by the primitive
element theorem there is an
so that
.
Let
be the minimal polynomial of
.
For any fixed choice of
, there is some
such that
. The map
that sends
to
defines an embedding
.
Thus any number field can be embedded (in
possible ways)
in any fixed choice
of an algebraic closure of
.
The field
of rational numbers is a number field of degree
,
and the ring of integers of
is
. The field
of
Gaussian integers has degree
and
. The field
has ring of integers
.
Note that the Golden ratio
satisfies
.
The ring of integers of
is
, where
.
We define the number field
and compute its
ring of integers, which has discriminant
.
sage: K.<i> = NumberField(x^2 + 1) sage: OK = K.ring_of_integers(); OK Order with module basis 1, i in Number Field in i with defining polynomial x^2 + 1 sage: OK.discriminant() -4
Next we compute the order
.
sage: O3 = K.order(3*i); O3 Order with module basis 1, 3*i in Number Field in i with defining polynomial x^2 + 1 sage: O3.gens() [1, 3*i]
Notice that the distriminant is
:
sage: O3.discriminant() -36
We test whether certain elements are in the order.
sage: 5 + 9*i in O3 True sage: 1 + 2*i in O3 False
We will frequently consider orders because they are often much easier
to write down explicitly than . For example, if
and
is an algebraic integer, then
is an order in
, but frequently
.
sage: K.<a> = NumberField(x^3 - 15*x^2 - 94*x - 3674) sage: Oa = K.order(a); Oa Order with module basis 1, a, a^2 in Number Field in a with defining polynomial x^3 - 15*x^2 - 94*x - 3674
Next we compute the maximal order of
with a basis, and
compute that the index of
in
is
.
sage: OK = K.maximal_order() sage: OK.basis() [25/169*a^2 + 10/169*a + 1/169, 5/13*a^2 + 1/13*a, a^2] sage: Oa.index_in(OK) 2197
To prove that
, suppose
, and let
be the minimal monic polynomial of
. For any
positive integer
, the minimal monic polynomial of
is
, i.e., the polynomial obtained from
by
multiplying the coefficient of
by
, multiplying the
coefficient of
by
, multiplying the coefficient of
by
, etc. If
is the least common multiple of
the denominators of the coefficients of
, then the minimal monic
polynomial of
has integer coefficients, so
is
integral and
. This proves that
.
William Stein 2012-09-24