Skip to content

Support univariate Laurent divisibility over non-domains - #42693

Open
cxzhong wants to merge 2 commits into
sagemath:developfrom
cxzhong:codex/laurent-divisibility-cover
Open

Support univariate Laurent divisibility over non-domains#42693
cxzhong wants to merge 2 commits into
sagemath:developfrom
cxzhong:codex/laurent-divisibility-cover

Conversation

@cxzhong

@cxzhong cxzhong commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

This implements the univariate phase of #41318. It is a narrower alternative
to #41327: multivariate Laurent polynomial rings over non-integral domains keep
their existing guard.

For a coefficient ring A, the implementation uses the standard isomorphism
between A[x, x^-1] and A[x, y]/(xy - 1). Before embedding an element in the cover, it
removes its overall Laurent monomial factor, which is a unit. This keeps
Groebner-basis work independent of a harmless global exponent shift.

The change:

  • preserves the existing integral-domain divisibility and ideal-membership
    paths;
  • supports univariate divides and ideal membership over supported
    non-integral domains through the polynomial cover;
  • reuses the ring's existing cover and lazily caches each Laurent ideal's
    extended ideal;
  • handles zero, identical, and monomial-unit cases without Groebner-basis
    work;
  • raises NotImplementedError for unsupported polynomial backends instead of
    silently returning a false negative.

Performance

Measured against the compiled develop baseline on one pinned CPU,
alternating variants across four fresh processes (nine inner rounds each):

Scenario develop This PR Change
integral-domain divides, false 5.644 us 5.677 us +0.6%
integral-domain divides, true 5.518 us 5.482 us -0.7%
integral-domain ideal, cold 15.793 us 15.857 us +0.4%
integral-domain ideal, hot 9.053 us 8.990 us -0.7%
Zmod(8) cover divisibility unsupported 263.7 us new
same case shifted by 10^12 unsupported 256.3 us shift-independent
monomial unit shifted by 10^12 unsupported 5.25 us fast path
Zmod(8) ideal, cold / hot unsupported 292.4 / 19.77 us 14.8x cache benefit

Tests

  • ./sage -t --warn-long 5.0 src/sage/rings/polynomial/laurent_polynomial.pyx src/sage/rings/polynomial/laurent_polynomial_ideal.py src/sage/rings/polynomial/laurent_polynomial_ring_base.py
    -- 767 tests passed.
  • Randomized comparison of normalized and signed cover lifts over Zmod(4),
    Zmod(6), Zmod(8), and Zmod(12): 180 membership cases and 180 known
    multiples passed.
  • git diff --check passed.

Fixes #41318.

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

⌛ Dependencies

None.

@github-actions

Copy link
Copy Markdown

Documentation preview for this PR (built with commit 116873d; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@cxzhong
cxzhong marked this pull request as ready for review August 20, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve handling of Laurent polynomial ring .divides()

1 participant