<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<!-- %% -->
<!-- %A  algfld.msk                 GAP documentation             Alexander Hulpke -->
<!-- %% -->
<!-- %A  @(#)<M>Id: algfld.msk,v 1.6 2006/10/19 10:32:09 gap Exp </M> -->
<!-- %% -->
<!-- %Y  (C) 1998 School Math and Comp. Sci., University of St Andrews, Scotland -->
<!-- %Y  Copyright (C) 2002 The GAP Group -->
<!-- %% -->
<Chapter Label="Algebraic extensions of fields">
<Heading>Algebraic extensions of fields</Heading>

If we adjoin a root <M>\alpha</M> of an irreducible polynomial <M>f \in K[x]</M> to
the field <M>K</M> we get an <E>algebraic extension</E> <M>K(\alpha)</M>, which is again
a field. We call <M>K</M> the <E>base field</E> of <M>K(\alpha)</M>.
<P/>
By Kronecker's construction, we may identify <M>K(\alpha)</M> with
the factor ring <M>K[x]/(f)</M>, an identification that also provides a method
for computing in these extension fields.
<P/>
It is important to note that different extensions of the same field are
entirely different (and its elements lie in different families), even if
mathematically one could be embedded in the other one.
<P/>
Currently &GAP; only allows extension fields of fields <M>K</M>, when <M>K</M>
itself is not an extension field.


<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<Section Label="Creation of Algebraic Extensions">
<Heading>Creation of Algebraic Extensions</Heading>

<#Include Label="AlgebraicExtension">
<#Include Label="IsAlgebraicExtension">

</Section>


<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<Section Label="Elements in Algebraic Extensions">
<Heading>Elements in Algebraic Extensions</Heading>

<Index>Operations for algebraic elements</Index>
According to Kronecker's construction, the elements of an algebraic
extension are considered to be polynomials in the primitive element.
The elements of the base field are represented as polynomials of degree zero.
&GAP; therefore displays elements of an algebraic extension as polynomials
in an indeterminate <Q>a</Q>, which is a root of the defining polynomial of the
extension.
Polynomials of degree zero are displayed with a leading exclamation mark to
indicate that they are different from elements of the base field.
<P/>
The usual field operations are applicable to algebraic elements.
<P/>
<Example><![CDATA[
gap> a^3/(a^2+a+1);
-1/2*a^3+1/2*a^2-1/2*a
gap> a*(1/a);
!1
]]></Example>
<P/>
The external representation of algebraic extension elements are the
polynomial coefficients in the primitive element <C>a</C>,
the operations <Ref Oper="ExtRepOfObj"/> and <Ref Oper="ObjByExtRep"/>
can be used for conversion.
<P/>
<Example><![CDATA[
gap> ExtRepOfObj(One(a));
[ 1, 0, 0, 0 ]
gap> ExtRepOfObj(a^3+2*a-9);
[ -9, 2, 0, 1 ]
gap> ObjByExtRep(FamilyObj(a),[3,19,-27,433]);
433*a^3-27*a^2+19*a+3
]]></Example>
<P/>
&GAP; does <E>not</E> embed the base field in its algebraic extensions and
therefore lists which contain elements of the base field and of the
extension are not homogeneous and thus cannot be used as polynomial
coefficients or to form matrices. The remedy is to multiply the
list(s) with the value of the attribute <Ref Attr="One"/> of the extension
which will embed all entries in the extension.
<P/>
<Example><![CDATA[
gap> m:=[[1,a],[0,1]];
[ [ 1, a ], [ 0, 1 ] ]
gap> IsMatrix(m);
false
gap> m:=m*One(e);
[ [ !1, a ], [ !0, !1 ] ]
gap> IsMatrix(m);
true
gap> m^2;
[ [ !1, 2*a ], [ !0, !1 ] ]
]]></Example>

<#Include Label="IsAlgebraicElement">

</Section>


<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<Section Label="Finding Subfields">
<Heading>Finding Subfields</Heading>

<#Include Label="IdealDecompositionsOfPolynomial">

</Section>
</Chapter>


