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

Cleanup some code related to dim(I) == -inf checks #4571

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fingolfin
Copy link
Member

Also remove two redundant dim checks. The removed code in monomial_basis was never triggered.

@fingolfin fingolfin added the release notes: not needed PRs introducing changes that are wholly irrelevant to the release notes label Feb 10, 2025
Copy link
Collaborator

@HechtiDerLachs HechtiDerLachs left a comment

Choose a reason for hiding this comment

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

I'm not 100% sure about all the changes made, sorry. But thanks for the attempt.

@@ -2555,7 +2555,6 @@ end
@attr Union{Int, NegInf} function dim(R::MPolyQuoLocRing{<:Any, <:Any, <:MPolyRing, <:MPolyRingElem, <:Union{MPolyComplementOfPrimeIdeal, MPolyComplementOfKPointIdeal}})
P = prime_ideal(inverted_set(R))
I = saturated_ideal(modulus(R))
dim(I) === -inf && return -inf
Copy link
Collaborator

Choose a reason for hiding this comment

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

This catches the case where the sum below is -Inf - (-Inf). Not sure this can ever happen, though.

@HechtiDerLachs
Copy link
Collaborator

Now that I look at the title again: If anything, it should be "Replace dim(I) == -Inf by is_one(I)". Just as pointed out by @joschmitt and myself in the code, too.

@wdecker
Copy link
Collaborator

wdecker commented Feb 10, 2025

I do not understand the title of this PR:

julia> R, (x,) = polynomial_ring(QQ, [:x])
(Multivariate polynomial ring in 1 variable over QQ, QQMPolyRingElem[x])

julia> I = ideal(R, [one(R)])
Ideal generated by
1

julia> dim(I)
-infinity

julia> is_zero(I)
false

julia> is_one(I)
true

@fingolfin fingolfin marked this pull request as draft February 10, 2025 23:15
@fingolfin fingolfin changed the title Replace dim(I) == -inf by is_zero(I) Replace dim(I) == -inf by is_one(I) Feb 10, 2025
@fingolfin fingolfin changed the title Replace dim(I) == -inf by is_one(I) Cleanup some code related to dim(I) == -inf checks Feb 10, 2025
@fingolfin
Copy link
Member Author

Revised now. Sorry my confusion and the confusion it caused others :-(

@fingolfin fingolfin marked this pull request as ready for review February 10, 2025 23:23
@fingolfin
Copy link
Member Author

@HechtiDerLachs OK to merge?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release notes: not needed PRs introducing changes that are wholly irrelevant to the release notes triage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants