# Chain of fields in sage

I would like to construct the field Fp(alpha,beta) where alpha is a root of x^p-x-1 (over Fp[x]) and beta is a root of the polynomial x^p-x-alpha^(p-1) (over Fp(alpha)[x]).

I have tried the following

 F0.<x>=GF(p)['x']
f1=x^p-x-1
R1.<alpha1>=F0.quotient(f1)['alpha1']
F1.<x>=Frac(R1)

f2=x^p-x-alpha1^(p-1)
R2.<alpha2>=F1.quotient(f2)['alpha2']
F2.<x>=Frac(R2)


but I think it creates the field F1 well, but it goes wrong for R2... It also feels like there should be a much more straightforward way to do this in sage. What would be the proper way to do this ?

edit retag close merge delete

Sort by » oldest newest most voted

Please let me use $u$ and $v$ for the elements of the fields involved.

First solution:

p = 13
R.<U> = PolynomialRing( GF(p) )
F.<u> = GF( p^p, modulus = U^p - U - 1 )
RF.<V> = PolynomialRing( F )
FF.<v> = F.extension( V^p - V - u^(p-1) )


Then FF is the required field.

Second solution.

We can try to construct the last field at once. Let us observe, that the minimal equation satisfied by $x=u^{p-1}=1+1/u$ is: $$x^p+\dots+x^2+x-1 =0\ .$$ For instance:

sage: (u^(p-1)) . minpoly()
x^13 + x^12 + x^11 + x^10 + x^9 + x^8 + x^7 + x^6 + x^5 + x^4 + x^3 + x^2 + x + 12


(This is my reason for avoiding $x$.)

Indeed: $$\sum_{1\le k\le p}\left(1+\frac 1u\right)^k = \left(1+\frac 1u\right)\frac{\left(1+\frac 1u\right)^p-1}{\left(1+\frac 1u\right)-1} =\underbrace{\left(1+\frac 1u\right)}_{u^{p-1}}\frac{\left(1^p+\frac 1{u^p}\right)-1}{\left(1+\frac 1u\right)-1} =\frac{u^{p-1}}{u^{p-1}}=1\ .$$ So the code would be:

p = 13
R.<V> = PolynomialRing( GF(p) )
FF.<v> = GF( p^(p*p), modulus = sum( [ (V^p-V)^k for k in [1..p] ] ) - 1 )

u = 1/(v^p-v-1)
u.minpoly()


The last two lines recover $u$ in the constructed field, we have:

sage: u.minpoly()
x^13 + 12*x + 12

more

I have to construct a chain like that, with 5 different elements. When i use the extend function for the 4th time it gives "NotImplementedError"...

( 2017-04-29 15:42:59 +0100 )edit