Skip to content

Commit

Permalink
Change non-scheme proj functions to something else
Browse files Browse the repository at this point in the history
For biproducts, naming the output triple
    [obj], inj, pr
seems to be common. Among the changes was changing "proj" to "pr" in the
triples
    [obj], inj, proj
  • Loading branch information
paemurru committed Feb 23, 2024
1 parent 400fc1e commit cb13aad
Show file tree
Hide file tree
Showing 17 changed files with 233 additions and 233 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ normal_toric_varieties_from_glsm(charges::ZZMatrix)

```@docs
Base.:*(v::NormalToricVarietyType, w::NormalToricVarietyType)
proj(E::ToricLineBundle...)
projectivization(E::ToricLineBundle...)
total_space(E::ToricLineBundle...)
```

Expand Down
4 changes: 2 additions & 2 deletions docs/src/CommutativeAlgebra/affine_algebras.md
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ julia> D2, (a, b, c) = graded_polynomial_ring(QQ, ["a", "b", "c"]);
julia> V2 = [p2(w-y), p2(x), p2(z)];
julia> proj = hom(D2, C2, V2)
julia> pr = hom(D2, C2, V2)
Ring homomorphism
from graded multivariate polynomial ring in 3 variables over QQ
to quotient of multivariate polynomial ring by ideal (-x*z + y^2, -w*z + x*y, -w*y + x^2)
Expand All @@ -391,7 +391,7 @@ defined by
b -> x
c -> z
julia> nodalCubic = kernel(proj)
julia> nodalCubic = kernel(pr)
Ideal generated by
-a^2*c + b^3 - 2*b^2*c + b*c^2
Expand Down
16 changes: 8 additions & 8 deletions experimental/LieAlgebras/src/LieAlgebraModuleHom.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ end

@doc raw"""
matrix(h::LieAlgebraModuleHom) -> MatElem
Return the transformation matrix of `h` w.r.t. the bases of the domain and codomain.
Note: The matrix operates on the coefficient vectors from the right.
Expand Down Expand Up @@ -201,7 +201,7 @@ end
@doc raw"""
hom(V1::LieAlgebraModule, V2::LieAlgebraModule, imgs::Vector{<:LieAlgebraModuleElem}; check::Bool=true) -> LieAlgebraModuleHom
Construct the homomorphism from `V1` to `V2` by sending the `i`-th basis element of `V1`
Construct the homomorphism from `V1` to `V2` by sending the `i`-th basis element of `V1`
to `imgs[i]` and extending linearly.
All elements of `imgs` must lie in `V2`.
Currently, `V1` and `V2` must be modules over the same Lie algebra.
Expand Down Expand Up @@ -260,7 +260,7 @@ julia> h = hom(V1, V2, matrix(QQ, 3, 1, [0, 0, 0]))
Lie algebra module morphism
from standard module of dimension 3 over gl_3
to abstract Lie algebra module of dimension 1 over gl_3
julia> [(v, h(v)) for v in basis(V1)]
3-element Vector{Tuple{LieAlgebraModuleElem{QQFieldElem}, LieAlgebraModuleElem{QQFieldElem}}}:
(v_1, 0)
Expand Down Expand Up @@ -403,7 +403,7 @@ function canonical_projection(V::LieAlgebraModule, i::Int)
@req fl "Module must be a direct sum"
@req 1 <= i <= length(Vs) "Index out of bound"
j = sum(dim(Vs[l]) for l in 1:(i - 1); init=0)
proj = hom(
projection = hom(
V,
Vs[i],
[
Expand All @@ -413,15 +413,15 @@ function canonical_projection(V::LieAlgebraModule, i::Int)
];
check=false,
)
return proj
return projection
end

@doc raw"""
hom_direct_sum(V::LieAlgebraModule{C}, W::LieAlgebraModule{C}, hs::Matrix{<:LieAlgebraModuleHom}) -> LieAlgebraModuleHom
hom_direct_sum(V::LieAlgebraModule{C}, W::LieAlgebraModule{C}, hs::Vector{<:LieAlgebraModuleHom}) -> LieAlgebraModuleHom
Given modules `V` and `W` which are direct sums with `r` respective `s` summands,
say $M = M_1 \oplus \cdots \oplus M_r$, $N = N_1 \oplus \cdots \oplus N_s$, and given a $r \times s$ matrix
Given modules `V` and `W` which are direct sums with `r` respective `s` summands,
say $M = M_1 \oplus \cdots \oplus M_r$, $N = N_1 \oplus \cdots \oplus N_s$, and given a $r \times s$ matrix
`hs` of homomorphisms $h_{ij} : V_i \to W_j$, return the homomorphism
$V \to W$ with $ij$-components $h_{ij}$.
Expand Down Expand Up @@ -471,7 +471,7 @@ end
Given modules `V` and `W` which are tensor products with the same number of factors,
say $V = V_1 \otimes \cdots \otimes V_r$, $W = W_1 \otimes \cdots \otimes W_r$,
and given a vector `hs` of homomorphisms $a_i : V_i \to W_i$, return
and given a vector `hs` of homomorphisms $a_i : V_i \to W_i$, return
$a_1 \otimes \cdots \otimes a_r$.
This works for $r$th tensor powers as well.
Expand Down
2 changes: 1 addition & 1 deletion experimental/LieAlgebras/test/LieAlgebraModuleHom-test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
@test canonical_injection(V, i) * canonical_projection(V, i) == identity_map(Vs[i])
end
@test sum(
proj * inj for (proj, inj) in zip(canonical_projections(V), canonical_injections(V))
pr * inj for (pr, inj) in zip(canonical_projections(V), canonical_injections(V))
) == identity_map(V)
end

Expand Down
4 changes: 2 additions & 2 deletions experimental/QuadFormAndIsom/src/embeddings.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1005,8 +1005,8 @@ function _classes_isomorphic_subgroups(q::TorQuadModule,
push!(blocks, compose(__f, j))
push!(ni, ngens(domain(__f)))
end
D, inj, proj = biproduct(domain.(blocks))
phi = hom(D, q, TorQuadModuleElem[sum([blocks[i](proj[i](a)) for i in 1:length(pds)]) for a in gens(D)])
D, inj, pr = biproduct(domain.(blocks))
phi = hom(D, q, TorQuadModuleElem[sum([blocks[i](pr[i](a)) for i in 1:length(pds)]) for a in gens(D)])
@hassert :ZZLatWithIsom 1 is_isometry(phi)

list_can = Vector{Tuple{TorQuadModuleMap, AutomorphismGroup{TorQuadModule}}}[]
Expand Down
11 changes: 6 additions & 5 deletions experimental/QuadFormAndIsom/src/hermitian_miranda_morrison.jl
Original file line number Diff line number Diff line change
Expand Up @@ -228,19 +228,20 @@ function _get_product_quotient(E::Hecke.RelSimpleNumField, Fac::Vector{Tuple{Abs
push!(Ps, P)
end

G, proj, inj = biproduct(groups...)
# Is this correct? The order is usually "G, inj, pr", not "G, pr, inj"
G, pr, inj = biproduct(groups...)

function dlog(x::Vector{<:Hecke.RelSimpleNumFieldElem})
if length(x) == 1
return sum(inj[i](dlogs[i](x[1])) for i in 1:length(Fac))
return sum(inj[i](dlogs[i](x[1])) for i in 1:length(Fac))
else
@hassert :ZZLatWithIsom 1 length(x) == length(Fac)
return sum(inj[i](dlogs[i](x[i])) for i in 1:length(Fac))
end
end

function exp(x::FinGenAbGroupElem)
v = elem_type(E)[exps[i](proj[i](x)) for i in 1:length(Fac)]
v = elem_type(E)[exps[i](pr[i](x)) for i in 1:length(Fac)]
@hassert :ZZLatWithIsom 1 dlog(v) == x
return v
end
Expand All @@ -263,10 +264,10 @@ end
# (D^{-1}L^#/L)_p is not unimodular.
#
# According to [BH23], the quotient D^{-1}L^#/L is unimodular at p
# if and only if
# if and only if
# - either L is unimodular at p, and D and p are coprime
# - or L is P^{-a}-modular where P is largest prime ideal
# over p fixed the canonical involution, and a is the valuation of D at P.
# over p fixed the canonical involution, and a is the valuation of D at P.

function _elementary_divisors(L::HermLat, D::Hecke.RelNumFieldOrderIdeal)
Ps = collect(keys(factor(D)))
Expand Down
26 changes: 13 additions & 13 deletions experimental/QuadFormAndIsom/src/lattices_with_isometry.jl
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ minimal_polynomial(Lf::ZZLatWithIsom) = minimal_polynomial(isometry(Lf))
@doc raw"""
genus(Lf::ZZLatWithIsom) -> ZZGenus
Given a lattice with isometry $(L, f)$, return the genus of the underlying
Given a lattice with isometry $(L, f)$, return the genus of the underlying
lattice $L$.
# Examples
Expand Down Expand Up @@ -1301,7 +1301,7 @@ Integer lattice of rank 5 and degree 5
[0 0 1 0 0]
[0 0 0 1 0]
julia> Lh, proj = direct_product(Lf, Lg)
julia> Lh, pr = direct_product(Lf, Lg)
(Integer lattice with isometry of finite order 10, AbstractSpaceMor[Map: quadratic space -> quadratic space, Map: quadratic space -> quadratic space])
julia> Lh
Expand All @@ -1321,9 +1321,9 @@ Integer lattice of rank 10 and degree 10
```
"""
function direct_product(x::Vector{ZZLatWithIsom})
Vf, proj = direct_product(ambient_space.(x))
Vf, pr = direct_product(ambient_space.(x))
Bs = block_diagonal_matrix(basis_matrix.(x))
return lattice(Vf, Bs; check=false), proj
return lattice(Vf, Bs; check=false), pr
end

direct_product(x::Vararg{ZZLatWithIsom}) = direct_product(collect(x))
Expand Down Expand Up @@ -1385,7 +1385,7 @@ Integer lattice of rank 5 and degree 5
[0 0 1 0 0]
[0 0 0 1 0]
julia> Lh, inj, proj = biproduct(Lf, Lg)
julia> Lh, inj, pr = biproduct(Lf, Lg)
(Integer lattice with isometry of finite order 10, AbstractSpaceMor[Map: quadratic space -> quadratic space, Map: quadratic space -> quadratic space], AbstractSpaceMor[Map: quadratic space -> quadratic space, Map: quadratic space -> quadratic space])
julia> Lh
Expand All @@ -1403,14 +1403,14 @@ Integer lattice of rank 10 and degree 10
[ 0 0 0 0 0 0 0 1 0 0]
[ 0 0 0 0 0 0 0 0 1 0]
julia> matrix(compose(inj[1], proj[1]))
julia> matrix(compose(inj[1], pr[1]))
[1 0 0 0 0]
[0 1 0 0 0]
[0 0 1 0 0]
[0 0 0 1 0]
[0 0 0 0 1]
julia> matrix(compose(inj[1], proj[2]))
julia> matrix(compose(inj[1], pr[2]))
[0 0 0 0 0]
[0 0 0 0 0]
[0 0 0 0 0]
Expand All @@ -1419,9 +1419,9 @@ julia> matrix(compose(inj[1], proj[2]))
```
"""
function biproduct(x::Vector{ZZLatWithIsom})
Vf, inj, proj = biproduct(ambient_space.(x))
Vf, inj, pr = biproduct(ambient_space.(x))
Bs = block_diagonal_matrix(basis_matrix.(x))
return lattice(Vf, Bs; check=false), inj, proj
return lattice(Vf, Bs; check=false), inj, pr
end

biproduct(x::Vararg{ZZLatWithIsom}) = biproduct(collect(x))
Expand Down Expand Up @@ -1529,7 +1529,7 @@ Integer lattice of rank 4 and degree 5
julia> H = hermitian_structure(M)
Hermitian lattice of rank 1 and degree 1
over relative maximal order of Relative number field of degree 2 over maximal real subfield of cyclotomic field of order 5
with pseudo-basis
with pseudo-basis
(1, 1//1 * <1, 1>)
(z_5, 1//1 * <1, 1>)
Expand Down Expand Up @@ -1592,11 +1592,11 @@ Finite quadratic module
Abelian group: Z/6
Bilinear value module: Q/Z
Quadratic value module: Q/2Z
Gram matrix quadratic form:
Gram matrix quadratic form:
[5//6]
julia> qf
Isometry of Finite quadratic module: Z/6 -> Q/2Z defined by
Isometry of Finite quadratic module: Z/6 -> Q/2Z defined by
[1]
julia> f = matrix(QQ, 5, 5, [ 1 0 0 0 0;
Expand All @@ -1608,7 +1608,7 @@ julia> f = matrix(QQ, 5, 5, [ 1 0 0 0 0;
julia> Lf = integer_lattice_with_isometry(L, f);
julia> discriminant_group(Lf)[2]
Isometry of Finite quadratic module: Z/6 -> Q/2Z defined by
Isometry of Finite quadratic module: Z/6 -> Q/2Z defined by
[5]
```
"""
Expand Down
16 changes: 8 additions & 8 deletions experimental/QuadFormAndIsom/src/spaces_with_isometry.jl
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ Quadratic space of dimension 2
[1 1]
[0 -1]
julia> Vf3, proj = direct_product(Vf1, Vf2)
julia> Vf3, pr = direct_product(Vf1, Vf2)
(Quadratic space with isometry of finite order 2, AbstractSpaceMor[Map: quadratic space -> quadratic space, Map: quadratic space -> quadratic space])
julia> Vf3
Expand All @@ -615,9 +615,9 @@ with gram matrix
```
"""
function direct_product(x::Vector{T}) where T <: QuadSpaceWithIsom
V, proj = direct_product(space.(x))
V, pr = direct_product(space.(x))
f = block_diagonal_matrix(isometry.(x))
return quadratic_space_with_isometry(V, f; check = false), proj
return quadratic_space_with_isometry(V, f; check = false), pr
end

direct_product(x::Vararg{QuadSpaceWithIsom}) = direct_product(collect(x))
Expand Down Expand Up @@ -676,7 +676,7 @@ Quadratic space of dimension 2
[1 1]
[0 -1]
julia> Vf3, inj, proj = biproduct(Vf1, Vf2)
julia> Vf3, inj, pr = biproduct(Vf1, Vf2)
(Quadratic space with isometry of finite order 2, AbstractSpaceMor[Map: quadratic space -> quadratic space, Map: quadratic space -> quadratic space], AbstractSpaceMor[Map: quadratic space -> quadratic space, Map: quadratic space -> quadratic space])
julia> Vf3
Expand All @@ -697,19 +697,19 @@ with gram matrix
[0 0 2 -1]
[0 0 -1 2]
julia> matrix(compose(inj[1], proj[1]))
julia> matrix(compose(inj[1], pr[1]))
[1 0]
[0 1]
julia> matrix(compose(inj[1], proj[2]))
julia> matrix(compose(inj[1], pr[2]))
[0 0]
[0 0]
```
"""
function biproduct(x::Vector{T}) where T <: QuadSpaceWithIsom
V, inj, proj = biproduct(space.(x))
V, inj, pr = biproduct(space.(x))
f = block_diagonal_matrix(isometry.(x))
return quadratic_space_with_isometry(V, f; check = false), inj, proj
return quadratic_space_with_isometry(V, f; check = false), inj, pr
end

biproduct(x::Vararg{QuadSpaceWithIsom}) = biproduct(collect(x))
Expand Down
6 changes: 3 additions & 3 deletions experimental/Schemes/ProjectiveModules.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ function is_projective(M::SubquoModule; check::Bool=true)
R = base_ring(M)
r = ngens(M)
Rr = FreeMod(R, r)
proj = hom(Rr, M, gens(M))
pr = hom(Rr, M, gens(M))

if check
iszero(annihilator(M)) || return false, proj, nothing
iszero(annihilator(M)) || return false, pr, nothing
end

K, inc = kernel(proj)
K, inc = kernel(pr)
s = ngens(K)
Rs = FreeMod(R, s)
a = compose(hom(Rs, K, gens(K)), inc)
Expand Down

0 comments on commit cb13aad

Please sign in to comment.