Skip to content

Fix radical for ideals in polynomial rings over the integers#5185

Merged
wdecker merged 3 commits intooscar-system:masterfrom
HechtiDerLachs:radical_over_integers
Aug 14, 2025
Merged

Fix radical for ideals in polynomial rings over the integers#5185
wdecker merged 3 commits intooscar-system:masterfrom
HechtiDerLachs:radical_over_integers

Conversation

@HechtiDerLachs
Copy link
Copy Markdown
Collaborator

@HechtiDerLachs HechtiDerLachs commented Aug 13, 2025

Resolves #5175.

@thofma
Copy link
Copy Markdown
Collaborator

thofma commented Aug 13, 2025

It seems that doctests need to be adjusted.

@lgoettgens lgoettgens changed the title Radical over integers Fix radical over integers Aug 13, 2025
return Lnew, hom(L, Lnew, f), hom(Lnew, L, finv, check=false)
end

# The `simplify` routine uses Singular's "elimpart". This does not work
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this comment should be attached to the next method, as the method it documents right now does not call into Singular at all?

@fingolfin
Copy link
Copy Markdown
Member

Looks plausible to me but someone from geometry should review & approve :-)

@wdecker
Copy link
Copy Markdown
Collaborator

wdecker commented Aug 13, 2025

I cannot (yet) see, why the proposed change causes the changes in the doctest example which makes the tests fails. The difference is, that now some redundant generators are removed. @HechtiDerLachs?

@thofma
Copy link
Copy Markdown
Collaborator

thofma commented Aug 13, 2025

I think they just got reordered?

@wdecker
Copy link
Copy Markdown
Collaborator

wdecker commented Aug 13, 2025

I think they just got reordered?

Yes, you are right. But still, what caused this reordering?

@HechtiDerLachs
Copy link
Copy Markdown
Collaborator Author

what caused this reordering?

Before, we were using a preprocessing step which attempted to eliminate variables where applicable. This apparently does not work over the integers, so it has been cut off, leading to different results as the radical is now tentatively computed in a different ring.

@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 14, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.85%. Comparing base (7f7a868) to head (a121cff).
⚠️ Report is 77 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5185   +/-   ##
=======================================
  Coverage   84.84%   84.85%           
=======================================
  Files         710      710           
  Lines       95517    95519    +2     
=======================================
+ Hits        81045    81049    +4     
+ Misses      14472    14470    -2     
Files with missing lines Coverage Δ
src/Rings/mpoly-ideals.jl 91.87% <ø> (ø)
src/Rings/mpolyquo-localizations.jl 75.64% <100.00%> (+0.03%) ⬆️

... and 1 file with indirect coverage changes

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

@HechtiDerLachs HechtiDerLachs added the release notes: use title For PRs: the title of this PR is suitable for direct use in the release notes label Aug 14, 2025
@wdecker
Copy link
Copy Markdown
Collaborator

wdecker commented Aug 14, 2025

what caused this reordering?

Before, we were using a preprocessing step which attempted to eliminate variables where applicable. This apparently does not work over the integers, so it has been cut off, leading to different results as the radical is now tentatively computed in a different ring.

Not quite. The difference arises from how we define the identity map as shown in the example below:

julia> R, (x,y) = polynomial_ring(ZZ, [:x, :y]);

julia> I = ideal(R, [x^2,y^2]);

julia> L, _ = quo(R, I);

julia> f = identity_map(L);

julia> f(x^2)
x^2

julia> g = hom(L, L, [x, y]);

julia> g(x^2)
0

julia> g == f
true

@thofma Any comment?

@HechtiDerLachs
Copy link
Copy Markdown
Collaborator Author

HechtiDerLachs commented Aug 14, 2025

Not quite. The difference arises from how we define the identity map as shown in the example below:

I do not understand the concern. Both versions of the identity map are correct. The difference observed in your example stems from different selections of the representative used for printing. I suspect f to not be of type MPolyAnyMap and use a different dispatch for mapping elements. Yet, I do not see anything that's wrong with this.

The given generators for the radical ideal in one of the doctests appear in different order compared to the earlier version. What's wrong with that? What is the issue? What is the concern?

As far as I can see, we do not even get a mathematically different result in the doctest's examples. While the example provided in the issue now works correctly.

@thofma
Copy link
Copy Markdown
Collaborator

thofma commented Aug 14, 2025

I agree with @HechtiDerLachs. Everything is mathematically correct now, so we should get this in sooner than later.

The thing with identity_map(L) doing funny things is one of the complaints in #5188. It is actually not constructing the object you would expect (try asking kernel of it).

Copy link
Copy Markdown
Collaborator

@wdecker wdecker left a comment

Choose a reason for hiding this comment

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

I did not want to hold up things, but wanted to be sure that there is no hidden problem. I understand now.

@wdecker wdecker merged commit e4d4370 into oscar-system:master Aug 14, 2025
32 of 35 checks passed
@HechtiDerLachs HechtiDerLachs deleted the radical_over_integers branch August 14, 2025 12:15
@thofma
Copy link
Copy Markdown
Collaborator

thofma commented Aug 15, 2025

Thanks @HechtiDerLachs

@fingolfin fingolfin changed the title Fix radical over integers Fix radical for ideals in polynomial rings over the integers Sep 11, 2025
@fingolfin fingolfin added bug Something isn't working bug: wrong result labels Sep 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug: wrong result bug Something isn't working release notes: use title For PRs: the title of this PR is suitable for direct use in the release notes topic: commutative algebra

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Radical in ZZ[x1,x2] gives wrong output

5 participants