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

Spec().an_element() is wrong when the coordinate ring is not Z #20338

Open
RalphieBoy mannequin opened this issue Mar 31, 2016 · 3 comments
Open

Spec().an_element() is wrong when the coordinate ring is not Z #20338

RalphieBoy mannequin opened this issue Mar 31, 2016 · 3 comments

Comments

@RalphieBoy
Copy link
Mannequin

RalphieBoy mannequin commented Mar 31, 2016

The code (schemes/generic/scheme.py) does this:

  return self(self.coordinate_ring().zero_ideal())

if the scheme's coordinate ring is not the integers. The coordinate ring need not be a domain, in which case the zero ideal is not prime (hence not a point in the prime spectrum).

I am not clear on the proper fix. I suspect for random rings, it's not easy to cobble up a prime ideal. At a minimum, the above could be called when the ring is a domain.

Component: PLEASE CHANGE

Keywords: spec, coordinate ring

Issue created by migration from https://trac.sagemath.org/ticket/20338

@RalphieBoy RalphieBoy mannequin added this to the sage-7.2 milestone Mar 31, 2016
@RalphieBoy RalphieBoy mannequin added p: major / 3 labels Mar 31, 2016
@videlec
Copy link
Contributor

videlec commented Mar 31, 2016

comment:1

You might want to do

def _an_element_(self):
    from sage.categories.domains import Domains
    if self.coordinate_ring() in Domains():
          return self(self.coordinate_ring().zero_ideal())
    else:
        raise NotImplementedError

@RalphieBoy
Copy link
Mannequin Author

RalphieBoy mannequin commented Mar 31, 2016

comment:2

Is an_element() always supposed to return "0" in some guise? In any case, if the ring is "known", we can handle it (PID, UFD, domain, ...), no?

@videlec
Copy link
Contributor

videlec commented Mar 31, 2016

comment:3

Replying to @RalphieBoy:

Is an_element() always supposed to return "0" in some guise?

Not at all. This method is intended to be used in testing suites (i.e. when you perform TestSuite(my_object).run()). The less trivial the answer is, the best it is.

In any case, if the ring is "known", we can handle it (PID, UFD, domain, ...), no?

Sure. I was just proposing the laziest solution. You might even want to implement a method some_elements that is also used in the test suites.

@mkoeppe mkoeppe removed this from the sage-7.2 milestone Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants