Reduction of polynomials over number fields modulo a prime ideal
Given a polynomial
julia> K, ζ = cyclotomic_field(7);
julia> Kx, x = K['x'];
julia> f = x^3 + (1 + ζ + ζ^2)*x^2 + (23 + 55ζ^5)x + (ζ + 77)//2
x^3 + (z_7^2 + z_7 + 1)*x^2 + (55*z_7^5 + 23)*x + 1//2*z_7 + 77//2
Next we determine the ring of integers
julia> OK = maximal_order(K);
julia> p = 29;
julia> frakp = prime_decomposition(OK, p)[1][1]
<29, z_7 + 22>
Norm: 29
Minimum: 29
two normal wrt: 29
We can now determine the residue field
julia> F, reduction_map_OK = residue_field(OK, frakp);
julia> F
Prime field of characteristic 29
julia> reduction_map_OK
Map
from maximal order of Cyclotomic field of order 7
with basis AbsSimpleNumFieldElem[1, z_7, z_7^2, z_7^3, z_7^4, z_7^5]
to prime field of characteristic 29
Not that the reduction map has domain extend
function. Not that the domain of the extended map will be the whole
julia> reduction_map_extended = extend(reduction_map_OK, K)
Map
from cyclotomic field of order 7
to prime field of characteristic 29
julia> reduction_map_extended(K(1//3))
10
julia> reduction_map_extended(K(1//29))
ERROR: Element not p-integral
Finally we can reduce
julia> fbar = map_coefficients(reduction_map_extended, f)
x^3 + 28*x^2 + 4*x + 13
julia> base_ring(fbar) === F
true