# Revision history [back]

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