From 4ec5e40889530f8bfb4d131ec98558d0b7c113dd Mon Sep 17 00:00:00 2001 From: Martin Bies Date: Tue, 23 Jul 2024 16:33:34 +0100 Subject: [PATCH 1/4] [ToricVarieties] Fix typo in documentation --- src/AlgebraicGeometry/ToricVarieties/Proj/constructors.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AlgebraicGeometry/ToricVarieties/Proj/constructors.jl b/src/AlgebraicGeometry/ToricVarieties/Proj/constructors.jl index 3303c3c18ef0..bad5dd0a338a 100644 --- a/src/AlgebraicGeometry/ToricVarieties/Proj/constructors.jl +++ b/src/AlgebraicGeometry/ToricVarieties/Proj/constructors.jl @@ -106,7 +106,7 @@ This function computes the total space of a direct sum of line bundles or diviso Please see [OM78](@cite) for more background information. # Examples -Let us construct the toric Calabi-Yau varieties given by the total space of ``\mathcal{O}_{\mathbb{P}^1}(2)\oplus\mathcal{O}_{\mathbb{P}^1}(-4))`` and ``\omega_{\mathbb{P}^2}``. +Let us construct the toric Calabi-Yau varieties given by the total space of ``\mathcal{O}_{\mathbb{P}^1}(2)\oplus\mathcal{O}_{\mathbb{P}^1}(-4)`` and ``\omega_{\mathbb{P}^2}``. ```jldoctest julia> P1 = projective_space(NormalToricVariety, 1); From 561635574dfc4b0127d0a95b587ef25dd0460ec3 Mon Sep 17 00:00:00 2001 From: Martin Bies Date: Tue, 23 Jul 2024 16:47:35 +0100 Subject: [PATCH 2/4] [ToricVarieties] Add functionality for trivial_line_bundle --- .../ToricVarieties/ToricLineBundles.md | 1 + .../src/IntersectionTheory.jl | 1 + .../standard_constructions.jl | 20 +++++++++++++++++++ src/exports.jl | 1 + 4 files changed, 23 insertions(+) diff --git a/docs/src/AlgebraicGeometry/ToricVarieties/ToricLineBundles.md b/docs/src/AlgebraicGeometry/ToricVarieties/ToricLineBundles.md index 870501c7fbff..b90754678627 100644 --- a/docs/src/AlgebraicGeometry/ToricVarieties/ToricLineBundles.md +++ b/docs/src/AlgebraicGeometry/ToricVarieties/ToricLineBundles.md @@ -31,6 +31,7 @@ the inverse by invoking `inv`. anticanonical_bundle(v::NormalToricVarietyType) canonical_bundle(v::NormalToricVarietyType) structure_sheaf(v::NormalToricVarietyType) +trivial_line_bundle(v::NormalToricVarietyType) ``` diff --git a/experimental/IntersectionTheory/src/IntersectionTheory.jl b/experimental/IntersectionTheory/src/IntersectionTheory.jl index 672f8435ea42..eb021d724560 100644 --- a/experimental/IntersectionTheory/src/IntersectionTheory.jl +++ b/experimental/IntersectionTheory/src/IntersectionTheory.jl @@ -7,6 +7,7 @@ import ..Oscar: basis, betti, chow_ring, codomain, degree, det, dim, domain, dua import ..Oscar.AbstractAlgebra: combinations import ..Oscar.AbstractAlgebra.Generic: FunctionalMap import..Oscar: pullback, pushforward, base, OO, product, compose +import ..Oscar: trivial_line_bundle export a_hat_genus export abstract_bundle diff --git a/src/AlgebraicGeometry/ToricVarieties/ToricLineBundles/standard_constructions.jl b/src/AlgebraicGeometry/ToricVarieties/ToricLineBundles/standard_constructions.jl index f9269ca872eb..d7333a9bb724 100644 --- a/src/AlgebraicGeometry/ToricVarieties/ToricLineBundles/standard_constructions.jl +++ b/src/AlgebraicGeometry/ToricVarieties/ToricLineBundles/standard_constructions.jl @@ -54,3 +54,23 @@ Toric line bundle on a normal toric variety ``` """ @attr ToricLineBundle canonical_bundle(v::NormalToricVarietyType) = inv(anticanonical_bundle(v)) + + +@doc raw""" + trivial_line_bundle(v::NormalToricVarietyType) + +Construct the trivial line bundle on a normal toric variety. + +# Examples +```jldoctest +julia> v = projective_space(NormalToricVariety, 2) +Normal toric variety + +julia> l = trivial_line_bundle(v) +Toric line bundle on a normal toric variety + +julia> is_trivial(l) +true +``` +""" +@attr ToricLineBundle trivial_line_bundle(v::NormalToricVarietyType) = toric_line_bundle(v, trivial_divisor(v)) diff --git a/src/exports.jl b/src/exports.jl index 738cf71f77d2..10cf5126d572 100644 --- a/src/exports.jl +++ b/src/exports.jl @@ -1478,6 +1478,7 @@ export transportation_polytope export trivial_character export trivial_divisor export trivial_divisor_class +export trivial_line_bundle export trivial_morphism export trivial_subgroup, has_trivial_subgroup, set_trivial_subgroup export tropical_matrix From 6724004e0858b3c10635105ec265db13220dd8ed Mon Sep 17 00:00:00 2001 From: Martin Bies Date: Tue, 23 Jul 2024 16:48:27 +0100 Subject: [PATCH 3/4] [ToricVarieties] Remove outdated comment --- .../ToricVarieties/ToricLineBundles/standard_constructions.jl | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/AlgebraicGeometry/ToricVarieties/ToricLineBundles/standard_constructions.jl b/src/AlgebraicGeometry/ToricVarieties/ToricLineBundles/standard_constructions.jl index d7333a9bb724..252498cd7559 100644 --- a/src/AlgebraicGeometry/ToricVarieties/ToricLineBundles/standard_constructions.jl +++ b/src/AlgebraicGeometry/ToricVarieties/ToricLineBundles/standard_constructions.jl @@ -6,7 +6,6 @@ structure_sheaf(v::NormalToricVarietyType) Construct the structure sheaf of a normal toric variety. -For convenience, we also support `structure_sheaf(variety)`. # Examples ```jldoctest @@ -24,7 +23,6 @@ Toric line bundle on a normal toric variety anticanonical_bundle(v::NormalToricVarietyType) Construct the anticanonical bundle of a normal toric variety. -For convenience, we also support `anticanonical_bundle(variety)`. # Examples ```jldoctest @@ -42,7 +40,6 @@ Toric line bundle on a normal toric variety canonical_bundle(v::NormalToricVarietyType) Construct the canonical bundle of a normal toric variety. -For convenience, we also support `canonical_bundle(variety)`. # Examples ```jldoctest From dae843c68f6b65bd4229ad60a70fb29768649b4d Mon Sep 17 00:00:00 2001 From: Dante Luber <82584641+danteluber@users.noreply.github.com> Date: Wed, 24 Jul 2024 10:39:57 +0200 Subject: [PATCH 4/4] tests if a set of tropical vectors are tropically generic (#3938) --- src/TropicalGeometry/matrix.jl | 33 +++++++++++++++++++++++++++++++++ src/exports.jl | 1 + test/TropicalGeometry/matrix.jl | 8 ++++++++ 3 files changed, 42 insertions(+) diff --git a/src/TropicalGeometry/matrix.jl b/src/TropicalGeometry/matrix.jl index ee5e18121df8..eb9f683da93a 100644 --- a/src/TropicalGeometry/matrix.jl +++ b/src/TropicalGeometry/matrix.jl @@ -41,3 +41,36 @@ function det(A::Matrix{<:TropicalSemiringElem}) @req 0 < nrows(A) == ncols(A) "Non-square or empty matrix" return det(matrix(parent(first(A)),A)) end + +@doc raw""" + is_tropically_generic(A::MatrixElem{<:TropicalSemiringElem}) + +Check if a collection of vectors in the tropical torus (given as rows of a matrix `A`) are in tropical general position. + +# Examples +```jldoctest +julia> A = matrix(tropical_semiring(),[1 0;0 1]) +[(1) (0)] +[(0) (1)] + +julia> is_tropically_generic(A) +true +``` +""" +function is_tropically_generic(A::MatrixElem{<:TropicalSemiringElem}) + function helper(A,C,B) + for b in subsets(C,B) + Polymake.tropical.tsgn(A[b,:]) == 0 && return false + end + return true + end + nca = ncols(A) + nra = nrows(A) + if nca == nra + return Polymake.tropical.tsgn(A) != 0 + elseif nra>nca + return helper(A,nra,nca) + else + return helper(transpose(A),nca,nra) + end +end diff --git a/src/exports.jl b/src/exports.jl index 10cf5126d572..47cc86cafc25 100644 --- a/src/exports.jl +++ b/src/exports.jl @@ -882,6 +882,7 @@ export is_total export is_transitive export is_transverse_intersection export is_trivial +export is_tropically_generic export is_two_sided export is_unipotent export is_unit diff --git a/test/TropicalGeometry/matrix.jl b/test/TropicalGeometry/matrix.jl index 400f23ccd46f..15d234bdc7dd 100644 --- a/test/TropicalGeometry/matrix.jl +++ b/test/TropicalGeometry/matrix.jl @@ -9,3 +9,11 @@ end end + +@testset "tropical general position" begin + A = matrix(tropical_semiring(),[1 0;0 1]) + @test is_tropically_generic(A) == true + A = matrix(tropical_semiring(max),[1 5;0 0;0 0]) + @test is_tropically_generic(A) == false + @test is_tropically_generic(transpose(A)) == false +end