1Function: nfmodprinit
2Section: number_fields
3C-Name: nfmodprinit0
4Prototype: GGDn
5Help: nfmodprinit(nf,pr, {v = variable(nf.pol)}): transform the prime ideal pr
6 into modpr format necessary for all operations mod pr in the number field nf.
7 Variable v is used to display finite field elements (see ffgen).
8Doc: transforms the prime ideal \var{pr} into \tet{modpr} format necessary
9 for all operations modulo \var{pr} in the number field \var{nf}.
10 The functions \tet{nfmodpr} and \tet{nfmodprlift} allow to project
11 to and lift from the residue field. The variable $v$ is used to display
12 finite field elements (see \kbd{ffgen}).
13 \bprog
14 ? K = nfinit(y^3-250);
15 ? P = idealprimedec(K, 5)[2];
16 ? modP = nfmodprinit(K, P, 't);
17 ? K.zk
18 %4 = [1, 1/5*y, 1/25*y^2]
19 ? apply(t->nfmodpr(K,t,modP), K.zk)
20 %5 = [1, t, 2*t + 1]
21 ? %[1].mod
22 %6 = t^2 + 3*t + 4
23 ? K.index
24 %7 = 125
25 @eprog\noindent For clarity, we represent elements in the residue
26 field $\F_5[t]/(T)$ as polynomials in the variable $t$. Whenever the
27 underlying rational prime does not divide \kbd{K.index}, it is actually
28 the case that $t$ is the reduction of $y$ in $\Q[y]/(\kbd{K.pol})$
29 modulo an irreducible factor of \kbd{K.pol} over $\F_p$. In the above
30 example, $5$ divides the index and $t$ is actually the reduction of $y/5$.
31