Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix and unify docs about maximal lattices #1307

Merged
merged 3 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
10 changes: 7 additions & 3 deletions src/QuadForm/Herm/Lattices.jl
Original file line number Diff line number Diff line change
Expand Up @@ -680,12 +680,13 @@ function _maximal_integral_lattice(L::HermLat, p, minimal = true)
end

function is_maximal_integral(L::HermLat, p)
@req order(p) == fixed_ring(L) "The ideal does not belong to the fixed ring of the lattice"
valuation(norm(L), p) < 0 && return false, L
return _maximal_integral_lattice(L, p, true)
end

function is_maximal_integral(L::HermLat)
!is_integral(norm(L)) && error("The lattice is not integral")
!is_integral(norm(L)) && return false, L
S = base_ring(L)
f = factor(discriminant(S))
ff = factor(norm(volume(L)))
Expand All @@ -703,6 +704,8 @@ function is_maximal_integral(L::HermLat)
end

function is_maximal(L::HermLat, p)
@req order(p) == fixed_ring(L) "The ideal does not belong to the fixed ring of the lattice"
@req valuation(norm(L), p) >= 0 "The norm of the lattice is not locally integral"
#iszero(L) && error("The lattice must be non-zero")
v = valuation(norm(L), p)
x = elem_in_nf(p_uniformizer(p))^(-v)
Expand All @@ -715,7 +718,7 @@ function is_maximal(L::HermLat, p)
end

function maximal_integral_lattice(L::HermLat)
!is_integral(norm(L)) && error("The lattice is not integral")
@req is_integral(norm(L)) "The norm of the lattice is not integral"
S = base_ring(L)
f = factor(discriminant(S))
ff = factor(norm(volume(L)))
Expand All @@ -730,7 +733,8 @@ function maximal_integral_lattice(L::HermLat)
end

function maximal_integral_lattice(L::HermLat, p)
valuation(norm(L), p) < 0 && error("Lattice is not locally integral")
@req order(p) == fixed_ring(L) "The ideals does not belong to the fixed ring of the lattice"
simonbrandhorst marked this conversation as resolved.
Show resolved Hide resolved
@req valuation(norm(L), p) >= 0 "The norm of the lattice is not locally integral"
_, L = _maximal_integral_lattice(L, p, false)
return L
end
Expand Down
37 changes: 24 additions & 13 deletions src/QuadForm/Lattices.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1989,45 +1989,56 @@ end
is_maximal_integral(L::AbstractLat, p::NfOrdIdl) -> Bool, AbstractLat

Given a lattice `L` and a prime ideal `p` of the fixed ring $\mathcal O_K$ of
`L`, return whether the completion of `L` at `p` is maximal integral. If it is
not the case, the second returned value is a lattice in the ambient space of `L`
whose completion at `p` is a minimal overlattice of $L_p$.
`L`, return whether the completion of `L` at `p` has integral norm and has no
proper overlattice satisfying this property.
simonbrandhorst marked this conversation as resolved.
Show resolved Hide resolved

If the norm of `L` is not integral at `p`, the second output is `L` by default.
Otherwise, either `L` is maximal at `p` and the second output is `L`, or the
second output is a lattice `M` in the ambient space of `L` whose completion
at `p` is a minimal overlattice of $L_p$ with integral norm.
"""
is_maximal_integral(::AbstractLat, p)

@doc raw"""
is_maximal_integral(L::AbstractLat) -> Bool, AbstractLat

Given a lattice `L`, return whether `L` is maximal integral. If it is not,
the second returned value is a minimal overlattice of `L` with integral norm.
Given a lattice `L`, return whether `L` has integral norm and has no proper
overlattice satisfying this property.

If the norm of `L` is not integral, the second output is `L` by default.
Otherwise, either `L` is maximal and the second output is `L`, or the second
output is a minimal overlattice `M` of `L` with integral norm.
"""
is_maximal_integral(::AbstractLat)

@doc raw"""
is_maximal(L::AbstractLat, p::NfOrdIdl) -> Bool, AbstractLat

Given a lattice `L` and a prime ideal `p` in the fixed ring $\mathcal O_K$ of
`L`, check whether the norm of $L_p$ is integral and return whether `L` is maximal
at `p`. If it is locally integral but not locally maximal, the second returned value
is a lattice in the same ambient space of `L` whose completion at `p` has integral norm
and is a proper overlattice of $L_p$.
`L` such that the norm of $L_p$ is integral, return whether `L` is maximal
integral at `p`.

If `L` is locally maximal at `p`, the second output is `L`, otherwise it is
a lattice `M` in the same ambient space of `L` whose completion at `p` has
integral norm and is a proper overlattice of $L_p$.
"""
is_maximal(::AbstractLat, p)

@doc raw"""
maximal_integral_lattice(L::AbstractLat, p::NfOrdIdl) -> AbstractLat

Given a lattice `L` and a prime ideal `p` of the fixed ring $\mathcal O_K$ of
`L`, return a lattice `M` in the ambient space of `L` which is maximal integral
at `p` and which agrees with `L` locally at all the places different from `p`.
`L` such that the norm of $L_p$ is integral, return a lattice `M` in the
ambient space of `L` which is maximal integral at `p` and which agrees
with `L` locally at all the places different from `p`.
"""
maximal_integral_lattice(::AbstractLat, p)

@doc raw"""
maximal_integral_lattice(L::AbstractLat) -> AbstractLat

Given a lattice `L`, return a lattice `M` in the ambient space of `L` which
is maximal integral and which contains `L`.
Given a lattice `L` with integral norm, return a maximal integral overlattice
`M` of `L`.
"""
maximal_integral_lattice(::AbstractLat)

Expand Down
11 changes: 6 additions & 5 deletions src/QuadForm/Quad/Lattices.jl
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ function guess_max_det(L::QuadLat, p)
end

function is_maximal_integral(L::QuadLat, p)
@req order(p) == base_ring(L) "Rings do not match"
@req order(p) == base_ring(L) "The ideal does not belong to the base ring of the lattice"
#if iszero(L)
# return true, L
#end
Expand Down Expand Up @@ -532,8 +532,8 @@ function is_maximal_integral(L::QuadLat)
end

function maximal_integral_lattice(L::QuadLat, p)
@req base_ring(L) == order(p) "Second argument must be an ideal of the base ring of L"
@req valuation(norm(L), p) >= 0 "The normal of the lattice must be locally integral"
@req base_ring(L) == order(p) "The ideal does not belong to the base ring of the lattice"
@req valuation(norm(L), p) >= 0 "The norm of the lattice is not locally integral"

ok, LL = is_maximal_integral(L, p)
while !ok
Expand All @@ -544,7 +544,8 @@ function maximal_integral_lattice(L::QuadLat, p)
end

function is_maximal(L::QuadLat, p)
@req order(p) == base_ring(L) "Asdsads"
@req order(p) == base_ring(L) "The ideal does not belong to the base ring of the lattice"
@req valuation(norm(L), p) >= 0 "The norm of the lattice is not locally integral"
#if iszero(L)
# return true, L
#end
Expand Down Expand Up @@ -576,7 +577,7 @@ function maximal_integral_lattice(V::QuadSpace)
end

function maximal_integral_lattice(L::QuadLat)
@req is_integral(norm(L)) "Lattice must be integral"
@req is_integral(norm(L)) "The norm of the lattice is not integral"
for p in bad_primes(L; even = true)
L = maximal_integral_lattice(L, p)
end
Expand Down
36 changes: 17 additions & 19 deletions src/QuadForm/Quad/ZLattices.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1142,14 +1142,13 @@ function _maximal_integral_lattice(L::ZZLat)
end

@doc raw"""
maximal_even_lattice(L::ZZLat, p) -> ZZLat
maximal_even_lattice(L::ZZLat, p::IntegerUnion) -> ZZLat

Given an even lattice `L` and a prime number `p` return an overlattice of `M`
which is maximal at `p` and agrees locally with `L` at all other places.

Recall that $L$ is called even if $\Phi(x,x) \in 2 \mathbb Z$ for all $x in L$.
Given an integer lattice `L` with integral scale and a prime number `p` such that
$L_p$ is even, return an overlattice `M` of `L` which is maximal even at `p` and
which agrees locally with `L` at all other places.
"""
function maximal_even_lattice(L::ZZLat, p)
function maximal_even_lattice(L::ZZLat, p::IntegerUnion)
while true
ok, L = is_maximal_even(L, p)
if ok
Expand All @@ -1161,10 +1160,7 @@ end
@doc raw"""
maximal_even_lattice(L::ZZLat) -> ZZLat

Return a maximal even overlattice `M` of the even lattice `L`.

Recall that $L$ is called even if $\Phi(x,x) \in 2 \mathbb Z$ for all $x in L$.
Note that the genus of `M` is uniquely determined by the genus of `L`.
Given an even integer lattice `L`, return a maximal even overlattice `M` of `L`.
"""
function maximal_even_lattice(L::ZZLat)
@req iseven(L) "The lattice must be even"
Expand All @@ -1175,29 +1171,31 @@ function maximal_even_lattice(L::ZZLat)
end

function maximal_integral_lattice(L::ZZLat)
@req denominator(norm(L)) == 1 "The quadratic form is not integral"
@req denominator(norm(L)) == 1 "The norm of the lattice is not integral"
L2 = rescale(L, 2)
LL2 = maximal_even_lattice(L2)
return rescale(LL2, QQ(1//2))
end


@doc raw"""
is_maximal_even(L::ZZLat, p) -> Bool, ZZLat
is_maximal_even(L::ZZLat, p::IntegerUnion) -> Bool, ZZLat

Return if the (`p`-locally) even lattice `L` is maximal at `p` and an even overlattice `M`
of `L` with $[M:L]=p$ if `L` is not maximal and $1$ else.
Given an integer lattice `L` with integral scale and a prime number `p`,
return whether $L_p$ is even and has no proper overlattice satisfying this
property.

Recall that $L$ is called even if $\Phi(x,x) \in 2 \mathbb{Z}$ for all $x in L$.
If $L_p$ is not even, the second output is `L` by default. Otherwise, either
`L` is maximal at `p` and the second output is `L`, or the second output is
an overlattice `M` of `L` such that $M_p$ is even and $[M:L] = p$.
"""

function is_maximal_even(L::ZZLat, p)
function is_maximal_even(L::ZZLat, p::IntegerUnion)
@req denominator(scale(L)) == 1 "The bilinear form is not integral"
@req p != 2 || mod(ZZ(norm(L)),2) == 0 "The bilinear form is not even"
p != 2 || mod(ZZ(norm(L)), 2) == 0 || return false, L

# o-maximal lattices are classified
# see Kirschmer Lemma 3.5.3
if valuation(det(L), p)<= 1
if valuation(det(L), p) <= 1
return true, L
end
G = change_base_ring(ZZ, gram_matrix(L))
Expand Down
Loading