Re: [sage-devel] Should ZZ^2 be a submodule of CC^2?

2018-01-19 Thread Vincent Delecroix
To my mind, (ZZ^2).span([[1/2,0]]) should not even work...

On 19 January 2018 at 09:59, Simon Brandhorst  wrote:
>
>
> On Friday, January 19, 2018 at 9:16:16 AM UTC+1, vdelecroix wrote:
>>
>> I think that it should be False in both situations. "is_submodule"
>> should only be used in the context where we have an ambient free
>> module, like ZZ^d and two ZZ-submodules U and V.
>
> I disagree - the question makes perfect sense if U and V do not lie in the
> same ambient module but in the same ambient vectorspace.
> (ZZ^2).span([[1,0]]).is_submodule((ZZ^2).span([[1/2,0]]))
> Should definitely return True.
>
> --
> 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 https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Should ZZ^2 be a submodule of CC^2?

2018-01-19 Thread Simon Brandhorst


On Friday, January 19, 2018 at 9:16:16 AM UTC+1, vdelecroix wrote:

> I think that it should be False in both situations. "is_submodule" 
> should only be used in the context where we have an ambient free 
> module, like ZZ^d and two ZZ-submodules U and V. 
>
I disagree - the question makes perfect sense if U and V do not lie in the 
same ambient module but in the same ambient vectorspace.  
(ZZ^2).span([[1,0]]).is_submodule((ZZ^2).span([[1/2,0]]))
Should definitely return True.

-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Should ZZ^2 be a submodule of CC^2?

2018-01-19 Thread Simon Brandhorst
Maybe the question then splits into two parts:

1) Is ZZ^2 a subset of CC^2 ? (Use this for __richcmp__)

2) Is ZZ^2 a submodule of CC^2 in the category of modules over ZZ? That is 
do we view CC^2 as a ZZ-module? 

(It is a ZZ-module in a natural way by the inclusion ZZ ---> CC) So 
basically should is_submodule test A.base_ring() is B.base_ring() or just 
A.base_ring().is_subring(B.base_ring())?

>From my point of view both possibilities are mathematically consistent. It 
is merely a question how rigid we want to be - it is a convention. Though 
at the moment we are inconsistent. (QQ vs CC)

-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Should ZZ^2 be a submodule of CC^2?

2018-01-19 Thread Vincent Delecroix
Dear Simon,

I think that it should be False in both situations. "is_submodule"
should only be used in the context where we have an ambient free
module, like ZZ^d and two ZZ-submodules U and V. In particular, this
situation implies that U and V are defined over the same base ring.
And even more U.ambient_module() is V.ambient_module().

Here is pseudo code for what I mean


def is_submodule(self, other):
if self.ambient_module() is not other.ambient_module():
raise ValueError
here test containment as subsets of the ambient module

If you want to consider comparisons of modules over different base
ring via coercion, you seriously have to worry: GF(3) has a coercion
map from ZZ.

Vincent

On 19 January 2018 at 08:54, Simon Brandhorst  wrote:
> Dear all,
>
> I am working on ticket
>
> #23978  Rich comparison for Modules
>
> As part of it I also rewrote the is_submodule function.
>
>
> Currently, we have
>
>
> sage: (ZZ^2).is_submodule(CC^2)
> False
> sage: (ZZ^2).is_submodule(QQ^2)
> True
>
> Should that behavior change to
>
>
> sage: (ZZ^2).is_submodule(CC^2)
> True
> sage: (ZZ^2).is_submodule(QQ^2)
> True
> ?
>
> I would say yes:
>
> Since
> sage: (CC^2).has_coerce_map_from(ZZ^2)
> True
> we already view `ZZ^2` in a canonical(=coercible) way as a submodule of
> CC^2.
>
>
> Reasons against:
> - Abstractly a complex vector space does not have a natural integral
> structure.
> But then we are working with modules with a distinguished basis. Not sure
> about the conventions there ?
>
> --
> 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 https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Should ZZ^2 be a submodule of CC^2?

2018-01-18 Thread Simon Brandhorst
Dear all,

I am working on ticket 
#23978   Rich comparison for Modules

As part of it I also rewrote the is_submodule function. 


Currently, we have


sage: (ZZ^2).is_submodule(CC^2)
False
sage: (ZZ^2).is_submodule(QQ^2)
True

Should that behavior change to 


sage: (ZZ^2).is_submodule(CC^2)
True
sage: (ZZ^2).is_submodule(QQ^2)
True
?

I would say yes:

Since
sage: (CC^2).has_coerce_map_from(ZZ^2)
True
we already view `ZZ^2` in a canonical(=coercible) way as a submodule of 
CC^2. 


Reasons against:
- Abstractly a complex vector space does not have a natural integral 
structure.
But then we are working with modules with a distinguished basis. Not sure 
about the conventions there ?

-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.