sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.41k stars 475 forks source link

Cartesian product of modules has no base ring #29225

Closed pjbruin closed 4 years ago

pjbruin commented 4 years ago

In SageMath 9.1.beta4:

sage: M = cartesian_product((ZZ^2, ZZ^3)); M
The Cartesian product of (Ambient free module of rank 2 over the principal ideal domain Integer Ring, Ambient free module of rank 3 over the principal ideal domain Integer Ring)
sage: M.category()
Category of Cartesian products of modules with basis over (euclidean domains and infinite enumerated sets and metric spaces)
sage: M.base_ring()  # should be Integer Ring

Component: commutative algebra

Keywords: module, base ring

Author: Peter Bruin

Branch/Commit: b766a52

Reviewer: Travis Scrimshaw

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

pjbruin commented 4 years ago

Commit: b766a52

pjbruin commented 4 years ago

Branch: u/pbruin/29225-cartesian_product_base_ring

tscrim commented 4 years ago
comment:2

Should we test for is R or == R, as I think we could have equal-but-not-identical rings in Sage:

sage: S5 = SymmetricGroup(5)
sage: S5p = SymmetricGroup(6).subgroup(['(1,2)','(1,2,3,4,5)'])
sage: S5 == S5p
True
sage: S5 is S5p
False
sage: G5 = S5.algebra(ZZ)
sage: G5p = S5p.algebra(ZZ)
sage: G5 is G5p
False
sage: G5 == G5p
False

Now I know this is not a demonstration, but it would be quite reasonable for this to someday return True. I probably am on the side of actually is because the == could have base rings that are subtly different, but I wanted to get your thoughts.

pjbruin commented 4 years ago
comment:3

Replying to @tscrim:

Should we test for is R or == R, as I think we could have equal-but-not-identical rings in Sage:

It is possible to implement classes for rings that have this behaviour, although I could not find them in the Sage library. I think it is safer not to choose one of these equal-but-not-identical rings as the base ring of the product. Working with modules over equal-but-not-identical rings sounds like something that will hardly ever occur in practice, and that will be unnecessarily slow and sensitive to bugs because of coercion between the different copies. In short, I propose sticking with is.

tscrim commented 4 years ago

Reviewer: Travis Scrimshaw

tscrim commented 4 years ago
comment:4

Sounds like we are in agreement. Thank you.

vbraun commented 4 years ago

Changed branch from u/pbruin/29225-cartesian_product_base_ring to b766a52