Skip to content

Commit

Permalink
Fix preimage map of residue field (#1285)
Browse files Browse the repository at this point in the history
  • Loading branch information
thofma authored Nov 14, 2023
1 parent d29e6a6 commit 60a055c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Map/NfOrd.jl
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,11 @@ function NfOrdToFqFieldMor(O::NfOrd, P::NfOrdIdl)
for i in 2:d
add!(zz.elem_in_nf, zz.elem_in_nf, powers[i - 1] * lift(ZZ, coeff(y, i - 1)))
end
zz.elem_in_nf = mod(zz.elem_in_nf, p)
if is_defining_polynomial_nice(nf(O)) && contains_equation_order(O)
zz.elem_in_nf = mod(zz.elem_in_nf, p)
else
zz = mod(zz, p)
end
@assert _image(zz) == y
return zz
end
Expand Down
16 changes: 16 additions & 0 deletions test/NfOrd/ResidueField.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,21 @@
@test (mF3\(a4) - b) in P
end
end

# 1284

P, x = polynomial_ring(ZZ)
K, a = number_field(x^5 + x^3 - x^2 - x - 1)
M = Order(K, [1, 121*a, a^2 - 17*a, a^3 - 72*a, a^4 - 76*a])
P = prime_ideals_over(M, 11)

for i in 1:1000
for p in P
k, h = residue_field(M, p, false)
y = Hecke.primitive_element(k)
tmp = preimage(h, y)
@test h(tmp) == y
end
end
end

0 comments on commit 60a055c

Please sign in to comment.