From b3c23d188fd074a334a77a20b5e0a5bb3b353f1e Mon Sep 17 00:00:00 2001 From: Yue Ren Date: Wed, 27 Nov 2024 10:32:02 +0000 Subject: [PATCH 1/2] TropicalGeometry: new positive tropicalizations --- docs/doc.main | 1 + docs/oscar_references.bib | 12 +++ docs/src/TropicalGeometry/positive_variety.md | 9 +++ src/TropicalGeometry/TropicalGeometry.jl | 1 + src/TropicalGeometry/positive_variety.jl | 73 +++++++++++++++++++ src/exports.jl | 1 + test/TropicalGeometry/positive_variety.jl | 14 ++++ 7 files changed, 111 insertions(+) create mode 100644 docs/src/TropicalGeometry/positive_variety.md create mode 100644 src/TropicalGeometry/positive_variety.jl create mode 100644 test/TropicalGeometry/positive_variety.jl diff --git a/docs/doc.main b/docs/doc.main index eab856a21930..7ab760925549 100644 --- a/docs/doc.main +++ b/docs/doc.main @@ -248,6 +248,7 @@ "TropicalGeometry/linear_space.md", "TropicalGeometry/groebner_theory.md", "TropicalGeometry/tropicalization.md", + "TropicalGeometry/positive_variety.md", ], "Noncommutative Algebra" => [ diff --git a/docs/oscar_references.bib b/docs/oscar_references.bib index e3e69fe4b169..c134b4309a25 100644 --- a/docs/oscar_references.bib +++ b/docs/oscar_references.bib @@ -2290,6 +2290,18 @@ @Article{SV-D-V87 zbmath = {4069055} } +@Article{SW05, + author = {Speyer, David and Williams, Lauren}, + title = {The {{Tropical Totally Positive Grassmannian}}}, + journal = {Journal of Algebraic Combinatorics}, + volume = {22}, + number = {2}, + pages = {189--210}, + year = {2005}, + month = sep, + doi = {10.1007/s10801-005-2513-3} +} + @Article{SY96, author = {Shimoyama, Takeshi and Yokoyama, Kazuhiro}, title = {Localization and primary decomposition of polynomial ideals}, diff --git a/docs/src/TropicalGeometry/positive_variety.md b/docs/src/TropicalGeometry/positive_variety.md new file mode 100644 index 000000000000..6720a1135190 --- /dev/null +++ b/docs/src/TropicalGeometry/positive_variety.md @@ -0,0 +1,9 @@ +# Positive tropicalizations of linear ideals + +## Introduction +Positive tropial varieties (in OSCAR) are weighted polyhedral complexes and as per the definition in [SW05](@cite). They may arise as tropicalizations of polynomial ideals over an ordered field. Currently, the only ideals supported are linear ideals over rational numbers or rational function fields over rational numbers. + + +```@docs +positive_tropical_variety(::MPolyIdeal, ::TropicalSemiringMap) +``` diff --git a/src/TropicalGeometry/TropicalGeometry.jl b/src/TropicalGeometry/TropicalGeometry.jl index bff650ae63fa..ff15fb281fe7 100644 --- a/src/TropicalGeometry/TropicalGeometry.jl +++ b/src/TropicalGeometry/TropicalGeometry.jl @@ -17,5 +17,6 @@ include("hypersurface.jl") include("curve.jl") include("linear_space.jl") include("variety.jl") +include("positive_variety.jl") include("intersection.jl") include("groebner_fan.jl") diff --git a/src/TropicalGeometry/positive_variety.jl b/src/TropicalGeometry/positive_variety.jl new file mode 100644 index 000000000000..ed087d188c20 --- /dev/null +++ b/src/TropicalGeometry/positive_variety.jl @@ -0,0 +1,73 @@ +@doc raw""" + positive_tropical_variety(I::MPolyIdeal,nu::TropicalSemiringMap) + +Return the positive tropical variety of `I` as a `PolyhedralComplex` as per the definition in [SW05](@cite). Assumes that `I` is generated either by binomials or by linear polynomials and that `I` is defined either over +(a) the rational numbers and that `nu` encodes the trivial valuation, +(b) the rational function field over the rational numbers and that `nu` encodes the t-adic valuation. + +# Examples +```jldoctest +julia> K,t = rational_function_field(QQ,"t") +(Rational function field over QQ, t) + +julia> C = matrix(K,[[-3*t,1*t,-1*t,-2*t,2*t],[-1*t,1*t,-1*t,-1*t,1*t]]) +[-3*t t -t -2*t 2*t] +[ -t t -t -t t] + +julia> R,x = polynomial_ring(K,ncols(C)) +(Multivariate polynomial ring in 5 variables over K, AbstractAlgebra.Generic.MPoly{AbstractAlgebra.Generic.RationalFunctionFieldElem{QQFieldElem, QQPolyRingElem}}[x1, x2, x3, x4, x5]) + +julia> nu = tropical_semiring_map(K,t) +Map into Min tropical semiring encoding the t-adic valuation on Rational function field over QQ + +julia> I = ideal(C*gens(R)) +Ideal generated by + -3*t*x1 + t*x2 - t*x3 - 2*t*x4 + 2*t*x5 + -t*x1 + t*x2 - t*x3 - t*x4 + t*x5 + +julia> TropPlusI = positive_tropical_variety(I,nu) +Min tropical variety + +``` +""" +function positive_tropical_variety(I::MPolyIdeal,nu::TropicalSemiringMap) + if all(isequal(2),length.(gens(I))) + if all(isequal(-1),[prod([sign(c) for c in coefficients(g)]) for g in gens(I)]) + # binomial ideal positive, return regular tropical variety + return tropical_variety(I,nu) + else + # binomial ideal not positive, return empty polyhedral complex in the correct ambient dimension + return polyhedral_complex(IncidenceMatrix(zeros(Int,0,0)),zero_matrix(QQ,0,ambient_dim(TropL))) + end + end + + if all(isequal(1),total_degree.(gens(I))) + # Construct the tropicalization of I + TropL = tropical_linear_space(I,nu) + + # find maximal polyhedra belonging to the positive part + # we check containment in the positive part by testing the initial ideal w.r.t. a relative interior point + positivePolyhedra = Polyhedron{QQFieldElem}[sigma for sigma in maximal_polyhedra(TropL) if is_initial_positive(I,nu,relative_interior_point(sigma))] + + if isempty(positivePolyhedra) + # if there are no positive polyhedra, + # return empty polyhedral complex in the correct ambient dimension + return polyhedral_complex(IncidenceMatrix(zeros(Int,0,0)),zero_matrix(QQ,0,ambient_dim(TropL))) + end + + Sigma = polyhedral_complex(positivePolyhedra) + mult = ones(ZZRingElem, n_maximal_polyhedra(Sigma)) + minOrMax = convention(nu) + return tropical_variety(Sigma,mult,minOrMax) + end + + error("input ideal not supported") +end + +function is_initial_positive(I::MPolyIdeal, nu::TropicalSemiringMap, w::AbstractVector) + inI = initial(I,nu,w) + G = groebner_basis(inI; complete_reduction=true) + + # the Groebner basis is binomial, check binomials have alternating signs + return all(isequal(-1),[prod([sign(c) for c in coefficients(g)]) for g in G]) +end diff --git a/src/exports.jl b/src/exports.jl index 5e85af449871..c7ede6875cca 100644 --- a/src/exports.jl +++ b/src/exports.jl @@ -1319,6 +1319,7 @@ export positive_coroots export positive_hull export positive_root export positive_roots +export positive_tropical_variety export possible_class_fusions export power_sum export powers_of_element diff --git a/test/TropicalGeometry/positive_variety.jl b/test/TropicalGeometry/positive_variety.jl new file mode 100644 index 000000000000..b1457ecc2406 --- /dev/null +++ b/test/TropicalGeometry/positive_variety.jl @@ -0,0 +1,14 @@ +@testset "src/TropicalGeometry/positive_variety.jl" begin + + C = matrix(QQ,[[-3,1,-1,-2,2],[-1,1,-1,-1,1]]) + R,x = polynomial_ring(QQ,ncols(C)) + nu = tropical_semiring_map(QQ) + I = ideal(C*gens(R)) + TropPlusI = positive_tropical_variety(I,nu) + @test n_maximal_polyhedra(TropPlusI) == 5 + + I = ideal([x[1]^2-x[2]^2,x[3]^3-x[4]^3]) + TropPlusI = positive_tropical_variety(I,nu) + @test n_maximal_polyhedra(TropPlusI) == 1 + +end From a5778ed934d4ea927e911cad983e07e2a01c9b09 Mon Sep 17 00:00:00 2001 From: Yue Ren Date: Fri, 24 Jan 2025 08:43:39 +0000 Subject: [PATCH 2/2] TropicalGeometry: make positive_tropical_variety work with old tropicalization --- src/TropicalGeometry/positive_variety.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TropicalGeometry/positive_variety.jl b/src/TropicalGeometry/positive_variety.jl index ed087d188c20..00f27eae6b51 100644 --- a/src/TropicalGeometry/positive_variety.jl +++ b/src/TropicalGeometry/positive_variety.jl @@ -34,7 +34,7 @@ function positive_tropical_variety(I::MPolyIdeal,nu::TropicalSemiringMap) if all(isequal(2),length.(gens(I))) if all(isequal(-1),[prod([sign(c) for c in coefficients(g)]) for g in gens(I)]) # binomial ideal positive, return regular tropical variety - return tropical_variety(I,nu) + return tropical_variety_binomial(I,nu) else # binomial ideal not positive, return empty polyhedral complex in the correct ambient dimension return polyhedral_complex(IncidenceMatrix(zeros(Int,0,0)),zero_matrix(QQ,0,ambient_dim(TropL)))