  
  [1X2 [33X[0;0YFunctionality of the Package[133X[101X
  
  [33X[0;0YThis chapter describes the methods available in the [5XRadiroot[105X package.[133X
  
  
  [1X2.1 [33X[0;0YMethods for Rational Polynomials[133X[101X
  
  [1X2.1-1 IsSeparablePolynomial[101X
  
  [33X[1;0Y[29X[2XIsSeparablePolynomial[102X( [3Xf[103X ) [32X property[133X
  
  [33X[0;0Yreturns  [9Xtrue[109X  if  the rational polynomial [3Xf[103X has simple roots only and [9Xfalse[109X
  otherwise.[133X
  
  [1X2.1-2 IsSolvable[101X
  
  [33X[1;0Y[29X[2XIsSolvable[102X( [3Xf[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XIsSolvablePolynomial[102X( [3Xf[103X ) [32X property[133X
  
  [33X[0;0Yreturns  [9Xtrue[109X  if  the rational polynomial [3Xf[103X has a solvable Galois group and
  [9Xfalse[109X  otherwise.  It signals an error if there exists an irreducible factor
  with degree greater than 15.[133X
  
  [1X2.1-3 SplittingField[101X
  
  [33X[1;0Y[29X[2XSplittingField[102X( [3Xf[103X ) [32X attribute[133X
  [33X[1;0Y[29X[2XIsomorphicMatrixField[102X( [3XF[103X ) [32X function[133X
  [33X[1;0Y[29X[2XRootsAsMatrices[102X( [3Xf[103X ) [32X attribute[133X
  [33X[1;0Y[29X[2XIsomorphismMatrixField[102X( [3XF[103X ) [32X attribute[133X
  
  [33X[0;0YFor  a normed, rational polynomial [3Xf[103X, [10XSplittingField([3Xf[103X[10X)[110X returns the smallest
  algebraic  extension field [3XL[103X of the rationals containing all roots of [3Xf[103X. The
  field  is  constructed with [10XFieldByPolynomial[110X (see Creation of number fields
  in  [5XAlnuth[105X).  The  primitive  element of [3XL[103X is denoted by [10Xa[110X. A matrix field [3XK[103X
  isomorphic  to  [3XL[103X  is  known after the computation and can be accessed using
  [10XIsomorphicMatrixField([3XL[103X[10X[110X.  The  matrices, one for each distinct root of [3Xf[103X, in
  the  list produced by [10XRootsOfMatrices([3Xf[103X[10X)[110X lie in [3XK[103X. [10XIsomorphismMatrixField( [3XL[103X[10X
  )[110X returns an isomorphism of [3XL[103X onto [3XK[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx := Indeterminate( Rationals, "x" );;[127X[104X
    [4X[25Xgap>[125X [27Xf := UnivariatePolynomial( Rationals, [1,3,4,1] );[127X[104X
    [4X[28Xx^3+4*x^2+3*x+1[128X[104X
    [4X[25Xgap>[125X [27XL := SplittingField( f );[127X[104X
    [4X[28X<algebraic extension over the Rationals of degree 6>[128X[104X
    [4X[25Xgap>[125X [27Xy := Indeterminate( L, "y" );;[127X[104X
    [4X[25Xgap>[125X [27XFactorsPolynomialAlgExt( L, f );[127X[104X
    [4X[28X[ y+(-3/94*a^4-24/47*a^3-253/94*a^2-535/94*a-168/47), [128X[104X
    [4X[28X  y+(-3/94*a^4-24/47*a^3-253/94*a^2-441/94*a+20/47), [128X[104X
    [4X[28X  y+(3/47*a^4+48/47*a^3+253/47*a^2+488/47*a+336/47) ][128X[104X
    [4X[25Xgap>[125X [27XIsomorphicMatrixField( L );[127X[104X
    [4X[28X<rational matrix field of degree 6>[128X[104X
    [4X[25Xgap>[125X [27XDisplay(RootsAsMatrices(f)[1]);[127X[104X
    [4X[28X[ [   0,   1,   0,   0,   0,   0 ],[128X[104X
    [4X[28X  [   0,   0,   1,   0,   0,   0 ],[128X[104X
    [4X[28X  [  -1,  -3,  -4,   0,   0,   0 ],[128X[104X
    [4X[28X  [   0,   0,   0,   0,   1,   0 ],[128X[104X
    [4X[28X  [   0,   0,   0,   0,   0,   1 ],[128X[104X
    [4X[28X  [   0,   0,   0,  -1,  -3,  -4 ] ][128X[104X
    [4X[25Xgap>[125X [27XMinimalPolynomial( Rationals, RootsAsMatrices(f)[1]);[127X[104X
    [4X[28Xx^3+4*x^2+3*x+1[128X[104X
    [4X[25Xgap>[125X [27Xiso := IsomorphismMatrixField( L );[127X[104X
    [4X[28XMappingByFunction( <algebraic extension over the Rationals of degree [128X[104X
    [4X[28X6>, <rational matrix field of degree [128X[104X
    [4X[28X6>, function( x ) ... end, function( mat ) ... end )[128X[104X
    [4X[25Xgap>[125X [27XPreImages( iso, RootsAsMatrices( f ) );[127X[104X
    [4X[28X[ -3/47*a^4-48/47*a^3-253/47*a^2-488/47*a-336/47, [128X[104X
    [4X[28X  3/94*a^4+24/47*a^3+253/94*a^2+441/94*a-20/47, [128X[104X
    [4X[28X  3/94*a^4+24/47*a^3+253/94*a^2+535/94*a+168/47 ][128X[104X
  [4X[32X[104X
  
  [33X[0;0YTo  factorise  a  polynomial  over  its  splitting  field  one  has  to  use
  [10XFactorsPolynomialAlgExt[110X (see [5XAlnuth[105X) instead of [10XFactors[110X.[133X
  
  [1X2.1-4 GaloisGroupOnRoots[101X
  
  [33X[1;0Y[29X[2XGaloisGroupOnRoots[102X( [3Xf[103X ) [32X attribute[133X
  
  [33X[0;0Ycalculates  the Galois group [3XG[103X of the rational polynomial [3Xf[103X, which has to be
  separable,  as a permutation group with respect to the ordering of the roots
  of [3Xf[103X given as matrices by [10XRootsAsMatrices[110X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XGaloisGroupOnRoots(f);[127X[104X
    [4X[28XGroup([ (2,3), (1,2) ])[128X[104X
  [4X[32X[104X
  
  [33X[0;0YIf you only want to get the Galois group abstractly, and if [22Xf[122X is irreducible
  of degree at most 15, it is often better to use the function [10XGaloisType[110X (see
  Chapter [14X'Reference:  Polynomials  over  the  Rationals'[114X in the [5XGAP[105X reference
  manual).[133X
  
  
  [1X2.2 [33X[0;0YSolving a Polynomial by Radicals[133X[101X
  
  [1X2.2-1 RootsOfPolynomialAsRadicals[101X
  
  [33X[1;0Y[29X[2XRootsOfPolynomialAsRadicals[102X( [3Xf[103X[, [3Xmode[103X[, [3Xfile[103X]] ) [32X function[133X
  
  [33X[0;0Ycomputes  a  solution by radicals for the irreducible, rational polynomial [3Xf[103X
  up  to  degree  15  if  the  Galois group of [3Xf[103X is solvable, and returns [9Xfail[109X
  otherwise. If it succeeds and [3Xmode[103X is not [10Xoff[110X, the function returns the path
  to  a  file  containing  the description of the roots of [3Xf[103X and generators of
  cyclic radical extensions to produce its splitting field.[133X
  
  [33X[0;0YThe user has several options to specify what happens with the results of the
  computation.  Therefore  the optional second argument [3Xmode[103X, a string, can be
  set to one of the following values:[133X
  
  [4X[32X[104X
    [4X"dvi"[104X
  [4X[32X[104X
  
  [33X[0;0YProvided  [10Xlatex[110X  and  the  dvi  viewer  [10Xxdvi[110X are available, this option will
  display  the  irreducible  radical  expression  for  the  roots  and  cyclic
  extension  generators  in  a new window. The package uses this option as the
  default.[133X
  
  [4X[32X[104X
    [4X"latex"[104X
  [4X[32X[104X
  
  [33X[0;0YA  LaTeX file is generated which contains the encoding for the expression by
  radicals.  This  gives  the user the opportunity to adjust the layout of the
  individual example before displaying the expression.[133X
  
  [4X[32X[104X
    [4X"maple"[104X
  [4X[32X[104X
  
  [33X[0;0YThe  generated  file can be read into Maple [MGH+05] which makes a root of [3Xf[103X
  available as variable [10Xa[110X.[133X
  
  [4X[32X[104X
    [4X"off"[104X
  [4X[32X[104X
  
  [33X[0;0YIn this mode the function does not actually compute a radical expression but
  is  only called for its side effects. Namely, the attributes [10XSplittingField[110X,
  [10XRootsAsMatrices[110X  and  [10XGaloisGroupOnRoots[110X are known for [3Xf[103X afterwards. This is
  slightly  more  effective  than  calling the corresponding operations one by
  one.[133X
  
  [33X[0;0YWith the optional third argument [3Xfile[103X the user can specify a file name under
  which  the  description files will be stored in the directory from which [5XGAP[105X
  was called. Depending on the option for [3Xmode[103X an extension like [10X.tex[110X might be
  added  automatically.  If [3Xfile[103X is not given, the function places description
  files in a new directory [10X/tmp/tmp.[110X[3Xstring[103X with names such as [10XNst[110X and [11XNst.tex[111X;
  the temporary directory is removed at the end of the GAP session.[133X
  
  [33X[0;0YThe  computation  may  take  a  very long time and can get unfeasible if the
  degree of [3Xf[103X is greater than 7.[133X
  
  [1X2.2-2 RootsOfPolynomialAsRadicalsNC[101X
  
  [33X[1;0Y[29X[2XRootsOfPolynomialAsRadicalsNC[102X( [3Xf[103X[, [3Xmode[103X[, [3Xfile[103X]] ) [32X function[133X
  
  [33X[0;0Ydoes essentially the same as [10XRootsOfPolynomialAsRadicals[110X except that it runs
  no  test  on  the input before starting the actual computation. Therefore it
  can be used for polynomials with arbitrary degree, but it may run for a very
  long time until a non-solvable polynomial is recognized as such.[133X
  
  [33X[0;0YDetailed examples for these two functions can be found in the next section.[133X
  
  
  [1X2.3 [33X[0;0YExamples[133X[101X
  
  [33X[0;0YThe  function  [10XRootsOfPolynomialAsRadicals[110X  does  not generate output inside
  [5XGAP[105X. Depending on the chosen mode, various kinds of files can be created. As
  an example the polynomial from the introduction will be considered.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xg := UnivariatePolynomial( Rationals, [1,1,-1,-1,1] );[127X[104X
    [4X[28Xx^4-x^3-x^2+x+1[128X[104X
    [4X[25Xgap>[125X [27XRootsOfPolynomialAsRadicals(g);[127X[104X
    [4X[28X"/tmp/tmp.8zkw5B/Nst.tex"[128X[104X
  [4X[32X[104X
  
  [33X[0;0Ywill cause a dvi file to appear in a new window:[133X
  
  [33X[0;0YAn  expression by radicals for the roots of the polynomial [22Xx^4-x^3-x^2 + x +
  1[122X with the [22Xn[122X-th root of unity [22Xζ_n[122X and[133X
  
  [33X[0;0Y[22Xω_1 = sqrt - 3[122X,[133X
  
  [33X[0;0Y[22Xω_2 = sqrtfrac72 - frac12ω_1[122X,[133X
  
  [33X[0;0Y[22Xω_3 = sqrtfrac72 + frac12ω_1[122X,[133X
  
  [33X[0;0Yis:[133X
  
  [33X[0;0Y[22Xfrac14 - frac14ω_1 + frac12ω_2[122X[133X
  
  [33X[0;0YIf  one  wants  to  work  with  the  roots, it might be helpful to use Maple
  [MGH+05], in which an expression like [22X2^(1/2)[122X is valid.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XRootsOfPolynomialAsRadicals(g, "maple");[127X[104X
    [4X[28X"/tmp/tmp.k9aTCz/Nst"[128X[104X
  [4X[32X[104X
  
  [33X[0;0Ywill create a file with the following content:[133X
  
  [4X[32X[104X
    [4Xw1 := (-3)^(1/2);[104X
    [4Xw2 := ((7/2) + (-1/2)*w1)^(1/2);[104X
    [4Xw3 := ((7/2) + (1/2)*w1)^(1/2);[104X
    [4X[104X
    [4Xa := (1/4) + (1/4)*w1 + (1/2)*w3;[104X
  [4X[32X[104X
  
  [33X[0;0YAfter  those computations several attributes are known for the polynomial in
  [5XGAP[105X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xg := UnivariatePolynomial( Rationals, [1,1,-1,-1,1] );;[127X[104X
    [4X[25Xgap>[125X [27XRootsOfPolynomialAsRadicalsNC( g, "off" );[127X[104X
    [4X[25Xgap>[125X [27XSplittingField( g );[127X[104X
    [4X[28X<algebraic extension over the Rationals of degree 8>[128X[104X
    [4X[25Xgap>[125X [27XGaloisGroupOnRoots( g );[127X[104X
    [4X[28XGroup([ (2,4), (1,2)(3,4) ])[128X[104X
  [4X[32X[104X
  
