Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #4018 #4038

Merged
merged 1 commit into from
Sep 10, 2024
Merged

Fix #4018 #4038

merged 1 commit into from
Sep 10, 2024

Conversation

joschmitt
Copy link
Member

@joschmitt joschmitt commented Aug 21, 2024

(Sorry for the duplicate, #4037 was the wrong branch.)

This fixes #4018 for me.

Apparently, one should not set keep_ordering = true in this case. Otherwise the ordering on the Singular side is set to what is nowadays called internal_ordering, so lex in this case.
I don't understand what the point of keep_ordering is. Does somebody know?

@joschmitt joschmitt requested a review from YueRen August 21, 2024 14:12
@fingolfin
Copy link
Member

Maybe @ederc or @jankoboehm know more?

Copy link

codecov bot commented Aug 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.08%. Comparing base (a7e4188) to head (c38c14b).
Report is 48 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4038      +/-   ##
==========================================
+ Coverage   84.58%   85.08%   +0.49%     
==========================================
  Files         597      613      +16     
  Lines       82237    87693    +5456     
==========================================
+ Hits        69559    74610    +5051     
- Misses      12678    13083     +405     
Files with missing lines Coverage Δ
src/Rings/mpoly-graded.jl 91.36% <100.00%> (ø)
src/Rings/mpoly-ideals.jl 93.21% <100.00%> (-0.11%) ⬇️
src/Rings/mpoly.jl 72.87% <100.00%> (+0.13%) ⬆️

... and 60 files with indirect coverage changes

@joschmitt
Copy link
Member Author

I realize now that my "fix" only works by coincidence, that is, because the ordering we want on the Singular side in this example happens to be the default (degrevlex).
I will try to produce a minimal example of what I mean tomorrow.

@wdecker
Copy link
Collaborator

wdecker commented Aug 21, 2024

Tracing the bug here, I see a couple of things with idealGens, groebner_assure etc which I do not quite understand. I must discuss this with @ederc, @hannes14.
@joschmitt For example, making another change in the function grassmann_pluecker_ideal, the "problem disappears":

return ideal(IdealGens(base,base.(gens(I)), o;
keep_ordering=false,
isReduced=false,
isGB=true))

@joschmitt
Copy link
Member Author

joschmitt commented Aug 21, 2024

I did another fix now. I am more confident of this, but someone who knows about these groebner_assure, singular_assure, ... etc should have a close look.
What seems weird to me (and what caused the problems here) is that the ordering set in G.ord of an IdealGens object G may not agree with the ordering of the Singular ring in G.gens.Sx. So in particular G.gens.O may be a Gröbner basis with respect to G.ord, but the same polynomials in G.gens.S on the Singular side are "not a Gröbner basis" because G.gens.Sx has a different ordering.

Comment on lines -1505 to +1506
G = groebner_assure(I)
cf = Singular.hilbert_series_data(G.S, W)
S = singular_groebner_generators(I, false, true)
cf = Singular.hilbert_series_data(S, W)
Copy link
Member Author

Choose a reason for hiding this comment

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

I assume that we want singular_groebner_generators here and not just groebner_assure. The doc string of groebner_assure explains that one should not rely on the basis being defined on the Singular side.
I also assume that we need a global ordering here; otherwise one can change the true to false.

Comment on lines +386 to +390
S = Singular.map_ideal(f, B.gens.S)
if isdefined(B, :ord) && B.ord == monorder
S.isGB = B.isGB
end
return S
Copy link
Member Author

Choose a reason for hiding this comment

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

This should fix the main problem in #4018: singular_generators would not carry the information that the polynomials form a Gröbner basis with respect to monorder over to the Singular side.

Comment on lines 748 to 752
if I.isGB
if I.isGB && I.ord == monomial_ordering(I.gens.Ox, internal_ordering(I.gens.Sx))
Copy link
Member Author

Choose a reason for hiding this comment

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

This was wrong: the polynomial ring on the Singular side might have a monomial ordering different from I.ord.

@joschmitt joschmitt removed the request for review from YueRen August 22, 2024 06:13
@joschmitt joschmitt marked this pull request as draft August 22, 2024 10:56
@fingolfin
Copy link
Member

We discussed this during triage. The plan is to wait until after the OSCAr workshop in two weeks, during which hopefully the underlying issue can be resolved.

If this for some reason doesn't happen, we can discuss again if we want to merge this for the time being until a "proper" fix can be implemented.

@fingolfin fingolfin removed the triage label Sep 4, 2024
@ederc
Copy link
Member

ederc commented Sep 9, 2024

I think that the fixes @joschmitt provides in this PR are the correct ones. There is, as @wdecker pointed out, another problem with groebner_assure, but we can handle this in a different PR. So for me this PR is good to go.

@ederc
Copy link
Member

ederc commented Sep 9, 2024

For the above mentioned groebner_assure fix see #4077.

@joschmitt joschmitt marked this pull request as ready for review September 9, 2024 18:27
@joschmitt joschmitt closed this Sep 10, 2024
@joschmitt joschmitt reopened this Sep 10, 2024
@joschmitt
Copy link
Member Author

joschmitt commented Sep 10, 2024

At last week's triage meeting, there was talk about an underlying issue and @fingolfin's summary above says that this pull request should wait, at least until the coding sprint next week. I don't want to restart the discussion; if somebody thinks this should be merged "as is", please do so. Otherwise I'm happy to talk about it next week.

@fingolfin
Copy link
Member

Since the "deeper" issue is fixed and @ederc thinks this PR is good to go, I'll merge it now.

@fingolfin fingolfin merged commit 0a1d296 into oscar-system:master Sep 10, 2024
53 of 54 checks passed
@joschmitt joschmitt deleted the js/fix4018 branch September 10, 2024 12:11
HechtiDerLachs pushed a commit to HechtiDerLachs/Oscar.jl that referenced this pull request Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

grassmann_pluecker_ideal saved GB wrong
4 participants