Skip to content

Tropical polyhedra: Types and basic properties#4001

Merged
benlorenz merged 51 commits intooscar-system:masterfrom
ooinaruhugh:kf/tropical-polytope
Oct 10, 2025
Merged

Tropical polyhedra: Types and basic properties#4001
benlorenz merged 51 commits intooscar-system:masterfrom
ooinaruhugh:kf/tropical-polytope

Conversation

@ooinaruhugh
Copy link
Copy Markdown
Contributor

@ooinaruhugh ooinaruhugh commented Aug 9, 2024

Polymake has support for tropical polyhedra, but what is there does not interface so nicely with OSCAR.
This PR serves to add a proper Julia type TropicalPolyhedron and provide basic functionality, to fix some design decisions about the data type.

This might also be useful in light of #3989 (review).

EDIT: I discussed this PR with @micjoswig and we came up with the following outline.

  • Given a set of n points in tropical projective d-space, we want to compute the induced covector decomposition of the tropical projective space.
  • For tropical polytopes with only finite coordinates, the covector decomposition yields a polyhedral subdivision of the tropical projective torus. This is implemented in polymake and should be taken from there.
  • With infinite coordinates, we obtain an induced covector decomposition in each stratum (which is a tropical projective torus of suitable dimension).
  • For arbitrary point sets, the cells in this decomposition might live in different strata of tropical projective space. In each stratum, this gives a polyhedral complex, which all fit together as a cell complex.
  • Thus, a data type for a tropical polytope needs keep track of data (e.g. PolyhedralComplexes) for each stratum.

In terms of data types: try a map which send a set (describing the stratum) to a polyhedral complex. Beware that polyhedral complexes require the vertices to be numbered consecutively. Because each stratum only sees a subset of the given points, we need an array and a map for translating indices back and forth.

@ooinaruhugh
Copy link
Copy Markdown
Contributor Author

@Sami-Halaseh

@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 9, 2024

Codecov Report

Attention: Patch coverage is 59.04762% with 43 lines in your changes missing coverage. Please review.

Project coverage is 84.82%. Comparing base (5070b99) to head (6f3d94e).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
.../TropicalGeometry/TropicalPolyhedron/properties.jl 61.64% 28 Missing ⚠️
...ropicalGeometry/TropicalPolyhedron/constructors.jl 53.57% 13 Missing ⚠️
src/TropicalGeometry/semiring.jl 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4001      +/-   ##
==========================================
- Coverage   84.88%   84.82%   -0.07%     
==========================================
  Files         697      699       +2     
  Lines       94180    94337     +157     
==========================================
+ Hits        79948    80019      +71     
- Misses      14232    14318      +86     
Files with missing lines Coverage Δ
src/TropicalGeometry/semiring.jl 63.50% <50.00%> (-0.41%) ⬇️
...ropicalGeometry/TropicalPolyhedron/constructors.jl 53.57% <53.57%> (ø)
.../TropicalGeometry/TropicalPolyhedron/properties.jl 61.64% <61.64%> (ø)

... and 8 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ooinaruhugh
Copy link
Copy Markdown
Contributor Author

At the moment, questions that need to be discussed:

  • How to handle the bookkeeping accross the strata? (@lkastner Might have an opinion, e.g. the question Map vs. indexing strata by bitmasks)
  • Regarding the "one polyhedral complex per stratum", vertices need to be renamed. Where to do this, or how to present information on boundary cells?
  • More remote question, this is also a welcome addition for polymake. Thus, implement in polymake first and then make accessible from OSCAR, or directly in OSCAR?

@fingolfin
Copy link
Copy Markdown
Member

What the status of this PR?

@ooinaruhugh
Copy link
Copy Markdown
Contributor Author

This has been pushed to my backlog over the last few months, but I just finished a great deal of work. So thank you for reminding me of this.

At the moment, I just had some prototype code.

@ooinaruhugh ooinaruhugh force-pushed the kf/tropical-polytope branch from 8b01da9 to b52bd86 Compare May 8, 2025 23:00
@micjoswig
Copy link
Copy Markdown
Member

micjoswig commented May 9, 2025

Let's first finalize #4061. Afterwards it will be easier to see how we want to design this.

One aspect to take into account is that @YueRen chose a nonhomogeneous setting. However, the natural interface between tropical convexity and tropical algebraic geometry goes through tropical hyperplane arrangements described by homogeneous linear forms.

@fingolfin
Copy link
Copy Markdown
Member

In the meantime #4061 has been merged a few weeks ago. So if @ooinaruhugh is still interested and has some spare time, perhaps this can be brought forward? :-)

@micjoswig
Copy link
Copy Markdown
Member

The overall goal still stands.

To make progress now, we tackle the following slightly simpler problem. first Input: point configuration in tropical projective space; Output: covector decomposition induced on tropical projective torus (which is an ordinary polyhedral complex). This can be inherited from polymake directly.

@ooinaruhugh ooinaruhugh force-pushed the kf/tropical-polytope branch from b52bd86 to b0c6c19 Compare June 22, 2025 00:46
@ooinaruhugh
Copy link
Copy Markdown
Contributor Author

While testing the polytope_covector_decomposition, I noticed inconsistencies regarding what 'pseudovertices' in polymake are. PSEUDOVERTICES from polymake gives rays for some reason, and POLYTOPE_COVECTOR_DECOMPOSITION does not agree with the visualization of the tropical polytope (from VISUAL).
We need to investigate this on the polymake side.

@ooinaruhugh ooinaruhugh force-pushed the kf/tropical-polytope branch from 3bb1149 to 7510eef Compare June 22, 2025 19:08
@benlorenz
Copy link
Copy Markdown
Member

While testing the polytope_covector_decomposition, I noticed inconsistencies regarding what 'pseudovertices' in polymake are. PSEUDOVERTICES from polymake gives rays for some reason, and POLYTOPE_COVECTOR_DECOMPOSITION does not agree with the visualization of the tropical polytope (from VISUAL). We need to investigate this on the polymake side.

Can you provide an explicit (polymake) example of this discrepancy?

@ooinaruhugh ooinaruhugh force-pushed the kf/tropical-polytope branch from aa47c2d to 6037119 Compare June 23, 2025 22:23
@fingolfin
Copy link
Copy Markdown
Member

ping @ooinaruhugh

@ooinaruhugh
Copy link
Copy Markdown
Contributor Author

The discussed discrepancies meant that we had to fix some parts in polymake regarding tropical polytopes. I'll finish the test cases which reflect how the output of the implemented functions should be mathematically speaking. But we have to wait for v4.14 of polymake in the end. Unless I should implement a temporary workaround that's only going to stay for a short time.

@ooinaruhugh ooinaruhugh force-pushed the kf/tropical-polytope branch from 8b9a54a to f0e3eff Compare July 17, 2025 18:12
ooinaruhugh and others added 6 commits September 30, 2025 10:58
Co-authored-by: Lars Göttgens <lars.goettgens@gmail.com>
Co-authored-by: Yue Ren <yue.ren.kl@gmail.com>
Co-authored-by: Yue Ren <yue.ren.kl@gmail.com>
Co-authored-by: Yue Ren <yue.ren.kl@gmail.com>
@ooinaruhugh ooinaruhugh requested a review from YueRen September 30, 2025 13:01
@ooinaruhugh ooinaruhugh closed this Oct 2, 2025
@ooinaruhugh ooinaruhugh reopened this Oct 2, 2025
Copy link
Copy Markdown
Member

@fingolfin fingolfin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to get this merged. There is a bunch of minor code review comments that could be addressed with a few clicks of "apply suggestions". A couple others seem to be resolved and just need to be marked as such.

There is also the issue of the "polymake hotfix", no idea what the status there is?

Comment thread src/TropicalGeometry/TropicalPolyhedron/constructors.jl Outdated
Comment thread src/TropicalGeometry/TropicalPolyhedron/constructors.jl
Comment thread src/TropicalGeometry/TropicalPolyhedron/constructors.jl Outdated
Comment thread src/TropicalGeometry/TropicalPolyhedron/constructors.jl
Comment thread src/TropicalGeometry/TropicalPolyhedron/properties.jl
Comment thread test/TropicalGeometry/tropical_polyhedra.jl Outdated
Comment thread src/TropicalGeometry/TropicalPolyhedron/properties.jl Outdated
Comment thread src/TropicalGeometry/TropicalPolyhedron/properties.jl Outdated
Comment thread src/TropicalGeometry/TropicalPolyhedron/properties.jl
@benlorenz
Copy link
Copy Markdown
Member

There is also the issue of the "polymake hotfix", no idea what the status there is?

It was released as part of polymake 4.15 and is available as polymake_jll-400.1500.000. This version is already in use by Oscar.
Strictly speaking we could either add a compat entry for polymake_jll to enforce this, or set broken= pmversion < v"400.1500.0" but I don't think this is necessary since there is nothing else that could block this update.

Copy link
Copy Markdown
Member

@YueRen YueRen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ooinaruhugh Looks great, thanks for your contribution! Here just some very minor nitpicks.

Comment thread src/TropicalGeometry/TropicalPolyhedron/constructors.jl Outdated
Comment thread src/TropicalGeometry/TropicalPolyhedron/constructors.jl Outdated
Comment thread src/TropicalGeometry/TropicalPolyhedron/constructors.jl Outdated
Comment thread src/TropicalGeometry/TropicalPolyhedron/constructors.jl Outdated
Comment thread src/TropicalGeometry/TropicalPolyhedron/constructors.jl Outdated
Comment thread src/TropicalGeometry/TropicalPolyhedron/constructors.jl Outdated
Comment thread src/TropicalGeometry/TropicalPolyhedron/constructors.jl Outdated
Comment thread src/TropicalGeometry/TropicalPolyhedron/properties.jl Outdated
Comment thread src/TropicalGeometry/TropicalPolyhedron/properties.jl Outdated
Comment thread src/TropicalGeometry/TropicalPolyhedron/properties.jl Outdated
ooinaruhugh and others added 3 commits October 8, 2025 21:31
Co-authored-by: Max Horn <max@quendi.de>
Co-authored-by: Yue Ren <yue.ren.kl@gmail.com>
Copy link
Copy Markdown
Member

@fingolfin fingolfin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thank you very much!

@fingolfin fingolfin requested a review from YueRen October 8, 2025 21:33
Comment thread src/TropicalGeometry/TropicalPolyhedron/properties.jl Outdated
Co-authored-by: Benjamin Lorenz <benlorenz@users.noreply.github.com>
Copy link
Copy Markdown
Member

@YueRen YueRen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strong approve.

@benlorenz benlorenz merged commit 40020ed into oscar-system:master Oct 10, 2025
34 of 35 checks passed
@lgoettgens lgoettgens added the enhancement New feature or request label Nov 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request release notes: use title For PRs: the title of this PR is suitable for direct use in the release notes topic: tropical geometry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants