Skip to content

Commit

Permalink
TropicalGeometry: new positive tropicalizations
Browse files Browse the repository at this point in the history
  • Loading branch information
YueRen committed Jan 17, 2025
1 parent e36a504 commit 2b70c6a
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/doc.main
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@
"TropicalGeometry/linear_space.md",
"TropicalGeometry/groebner_theory.md",
"TropicalGeometry/tropicalization.md",
"TropicalGeometry/positive_variety.md",
],

"Noncommutative Algebra" => [
Expand Down
12 changes: 12 additions & 0 deletions docs/oscar_references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
9 changes: 9 additions & 0 deletions docs/src/TropicalGeometry/positive_variety.md
Original file line number Diff line number Diff line change
@@ -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)
```
1 change: 1 addition & 0 deletions src/TropicalGeometry/TropicalGeometry.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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")
73 changes: 73 additions & 0 deletions src/TropicalGeometry/positive_variety.jl
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions src/exports.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1317,6 +1317,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
Expand Down
14 changes: 14 additions & 0 deletions test/TropicalGeometry/positive_variety.jl
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 2b70c6a

Please sign in to comment.