Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 51 additions & 4 deletions src/NumberTheory/GaloisGrp/GaloisGrp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,17 @@
# @show a, ":*", b, ":=", c
return c
end

function Oscar.divexact(a::BoundRingElem{ZZRingElem}, b::ZZRingElem; check::Bool = true)
c = BoundRingElem(ceil(ZZRingElem, a.val//b), a.p)
# @show a, ":/", b, ":=", c
return c
end

function Oscar.divexact(a::BoundRingElem, b::ZZRingElem; check::Bool = true)
return a #TODO: for power series we can get the degree down!

Check warning on line 98 in src/NumberTheory/GaloisGrp/GaloisGrp.jl

View check run for this annotation

Codecov / codecov/patch

src/NumberTheory/GaloisGrp/GaloisGrp.jl#L97-L98

Added lines #L97 - L98 were not covered by tests
end

function ^(a::BoundRingElem, b::Int)
c = BoundRingElem(a.p.pow(a.val, b), a.p)
# @show a, ":^", b, ":=", c
Expand Down Expand Up @@ -2089,7 +2100,18 @@
@vprint :GaloisGroup 2 "of maximal degree $(total_degree(I)*degree(ts))\n"
@vprint :GaloisGroup 2 "root upper_bound: $(value(B))\n"

c = roots(GC, bound_to_precision(GC, B, extra))
pr = bound_to_precision(GC, B, extra)
# if |I(r)| <= B, then I(r) is an algebraic number and
# N(I) := prod_(G//s) I^sigma(r) is an integer, by assumption on G
# p-adically: I(r) = mu mod p^k implies p^k | N(I(r)-mu)
# so either |N| = N = 0 or larger than p^k
# arithmetic mean:
# prod |I(r) - mu| <= (sum |I(r)-mu|/n)^n for n = |G/s|, the index
# <= (2B/n)^n
# thus if p^k > (2B/n)^n, we're safe. In general this is too large
# (and for complex roots we need s.th. different, for symbolics this
# is a no-op)
c = roots(GC, pr)
c = map(ts, c)

local fd
Expand Down Expand Up @@ -2132,8 +2154,33 @@
push!(cs, e)
fl, l = isinteger(GC, B, e)
if fl
@vprint :GaloisGroup 2 "found descent at $t and value $l\n"
push!(fd, t)
if isa(e, FlintLocalFieldElem) && index(G, s) < 10
#TODO: better strategy, add 10%? use n = min(10, index)?
# Fabian found e with 5 consecutive 0 digits mod 17
# so it can happen...
@vprint :GaloisGroup 2 "found possible descent at $t and value $l, proving now ..."


n = index(G, s)
local _pr = bound_to_precision(GC, (2*B/n)^n, extra)
local _c = roots(GC, _pr)
_c = map(ts, _c)
local _e = evaluate(I, t, _c)
fl, l = isinteger(GC, B, _e)
if fl
@vprint :GaloisGroup 2 "confirmed!\n"
push!(fd, t)
else
@vprint :GaloisGroup 2 "failed, no descent!\n"
if is_normalized_by(s, G)
@vprint :GaloisGroup 2 "no descent here, group is normal, giving up\n"
break
end
end
else
@vprint :GaloisGroup 2 "found descent at $t and value $l\n"
push!(fd, t)
end
end
end
if length(cs) == length(lt)
Expand Down Expand Up @@ -2369,7 +2416,7 @@
k = extension_field(f, check = false, cached = false)[1]
@assert all(x->isone(denominator(x)), coefficients(k.pol))
@assert is_monic(k.pol)
return k
return k#, a, T, ts
end

"""
Expand Down
4 changes: 4 additions & 0 deletions test/NumberTheory/galthy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@
G, C = galois_group((x^3-2)^2*(x^3-5)^2*(x^2-6))
@test order(G) == 36
@test degree(G) == 14

#Fabian Gundlach...
G, C = galois_group(x^8 - 2*x^7 - 48*x^6 + 58*x^5 + 846*x^4 - 4614*x^3 + 6609*x^2 + 48742*x + 493474)
@test order(G) == 32
end

import Oscar.GaloisGrp: primitive_by_shape, an_sn_by_shape, cycle_structures
Expand Down
Loading