On Feb 10, 12:17 pm, Charles Bouillaguet
<charles.bouillag...@gmail.com> wrote:
> Why doesn't the first call to R in IntegralDomains() decide wether this is 
> true or not ?

Since in this case it just boils down to exactly the same check that
is necessary for `R in Fields()`, that's definitely an option.
However, in general deciding whether a ring is an integral domain
might be rather hard, or more generally, I bet that there are
categories with subcategories for which membership is undecidable. In
that case, the only way to read a question like `R in
IntegralDomains()` would be "Do you happen to know for sure that R is
an integral domain" or "Did this ring get constructed in a way that
guarantees it's an integral domain"?

In that light, the first answer may not be so disturbing. However, the
fact that an answer changes due to a seemingly unrelated query (and
which could happen in completely unrelated code, just because both
happen to use the same ring constructor at some point!) is definitely
disturbing. It means one always has to argue about sage with in mind
that every parent is essentially a global variable, and one you don't
necessarily get to initialize yourself either!

For this particular example the symptom can be remedied by ensuring
that membership testing on `IntegralDomain()` also returns
mathematical truth rather than "known fact by construction", which can
get fouled up if membership testing for `Field()` changes. However,
the underlying cause (post #13370 -- before that it's simply that
IntegralDomain looks in a cache that it doesn't update itself) that
something people might expect to be a constant, category membership,
apparently isn't!

Insisting that "parent in given_category", or for that matter
"is_subcategory(parent.category(),given_category)" cannot be relied on
but instead always has to be computationally investigated seems to
seriously reduce its usefulness.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to