Skip to content

Commit

Permalink
Katrin (#1315)
Browse files Browse the repository at this point in the history
* cornercase: lattice did not handle identical input

triggered by some weird GrpAb stuff of Katrin:
  f:G -> H
then doing
  preimage(f, H)
(why I do not remember), but then no common over structure for H and H
was found

* check parent of group elem in ray_class_group_map

Also from Katrin: she got intersting results due to using elements
in the wrong abelian group: she had a non-trivial group with 10
generators the first 5 being trivial, the RCG had only 5.
disc_exp on her non-trivial elements always resulted in trivial ideals
due to the wrong parent. The code would only use the first 5
coefficients of the group elements...
  • Loading branch information
fieker authored Dec 6, 2023
1 parent a685c6c commit 791e87a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/GrpAb/Lattice.jl
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,10 @@ end
# "overgroup" M. If so, the second return value is M and the third and fourth
# return values describe the map from G to M and H to M respectively.
function can_map_into_overstructure(L::RelLattice{T, D}, G::T, H::T) where {T, D}
if G === H
return true, G, L.make_id(G)::D, L.make_id(G)::D
end

if !(G in keys(L.weak_vertices) && H in keys(L.weak_vertices))
return false, G, L.zero, L.zero
end
Expand Down
12 changes: 10 additions & 2 deletions src/NumFieldOrd/NfOrd/RayClassGrp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ function class_as_ray_class(C::GrpAbFinGen, mC::MapClassGrp, exp_class::Function
local expo_map
let mQ = mQ, exp_class = exp_class
function expo_map(el::GrpAbFinGenElem)
@assert parent(el) === codomain(mQ)
return exp_class(mQ\el)
end
end
Expand Down Expand Up @@ -237,8 +238,9 @@ function empty_ray_class(m::NfOrdIdl)
X = abelian_group(Int[])

local exp
let O = O
let O = O, X = X
function exp(a::GrpAbFinGenElem)
@assert parent(a) === X
return FacElem(Dict(ideal(O,1) => ZZRingElem(1)))
end
end
Expand Down Expand Up @@ -478,8 +480,9 @@ function n_part_class_group(mC::Hecke.MapClassGrp, n::Integer)
if is_coprime(exponent(C), n)
G = abelian_group(ZZRingElem[])
local exp1
let O = O
let O = O, G = G
function exp1(a::GrpAbFinGenElem)
@assert parent(a) === G
return ideal(O, one(O))
end
end
Expand Down Expand Up @@ -507,6 +510,7 @@ function n_part_class_group(mC::Hecke.MapClassGrp, n::Integer)
local exp2
let O = O, G = G
function exp2(a::GrpAbFinGenElem)
@assert parent(a) === G
new_coeff = zero_matrix(FlintZZ, 1, ngens(C))
for i = 1:ngens(G)
new_coeff[1, i+ind-1] = a[i]*diff
Expand Down Expand Up @@ -909,6 +913,7 @@ function ray_class_group(m::NfOrdIdl, inf_plc::Vector{<:InfPlc} = Vector{InfPlc{
local expo
let C = C, O = O, groups_and_maps = groups_and_maps, exp_class = exp_class, eH = eH, H = H, K = K, Dgens = Dgens, X = X, p = p
function expo(a::GrpAbFinGenElem)
@assert parent(a) === X
b = GrpAbFinGenElem(C, sub(a.coeff, 1:1, 1:ngens(C)))
res = exp_class(b)
for i = 1:nG
Expand Down Expand Up @@ -978,6 +983,7 @@ function ray_class_groupQQ(O::NfOrd, modulus::Int, inf_plc::Bool, n_quo::Int)
end

function expon1(a::GrpAbFinGenElem)
@assert parent(a) === domain(mU)
x=mU(a)
return FacElem(Dict{NfOrdIdl, ZZRingElem}(ideal(O,lift(x)) => 1))
end
Expand All @@ -997,6 +1003,7 @@ function ray_class_groupQQ(O::NfOrd, modulus::Int, inf_plc::Bool, n_quo::Int)
end

function expon2(a::GrpAbFinGenElem)
@assert parent(a) === domain(mU)
x=mU(a)
return FacElem(Dict{NfOrdIdl, ZZRingElem}(ideal(O,lift(x)) => 1))
end
Expand All @@ -1016,6 +1023,7 @@ function ray_class_groupQQ(O::NfOrd, modulus::Int, inf_plc::Bool, n_quo::Int)
end

function expon(a::GrpAbFinGenElem)
@assert parent(a) === codomain(mQ)
x=mU(mQ\a)
return FacElem(Dict{NfOrdIdl, ZZRingElem}(ideal(O,x) => 1))
end
Expand Down
4 changes: 4 additions & 0 deletions test/GrpAb/Lattice.jl
Original file line number Diff line number Diff line change
Expand Up @@ -138,5 +138,9 @@
Q2, mQ2 = quo(G, [G[1]], true, L)
b, GG, MHHH, MHH = @inferred Hecke.can_map_into_overstructure(L, Q, Q2)
@test !b

b, GG, _, _ = @inferred Hecke.can_map_into_overstructure(L, Q, Q)
@test b
@test GG === Q
end
end

0 comments on commit 791e87a

Please sign in to comment.