Hi Nathann,

On 2014-05-27, Nathann Cohen <nathann.co...@gmail.com> wrote:
> I do not understand much about categories, but if we implement 
> multiplication by a positive integer for semigroups and multiplication by a 
> negative integer for semigroup with inverse, won't this automatically give 
> a ZZ-Module structure to any additive abelian group ?

If I am not mistaken, this is already the case.

> And more technically, 
> isn't it the case that every additive abelian parent in Sage will be 
> detected as a ZZ-Module ?

No, and I think the question/suggestion is how to add this feature.

Perhaps one could say that the difference between "X has an action by
ZZ" and "X is a ZZ-module" is the same as duck-typing versus typecheck.
If X happens to have an action by ZZ, then a duck-typist (and a
mathematician) would say that it is a ZZ-module.

  sage: P.<x> = GF(2)[]
  sage: P.get_action(ZZ, operator.mul)
  Right scalar multiplication by Integer Ring on Univariate Polynomial
  Ring in x over Finite Field of size 2 (using NTL)

However, Sage's category framework does not use the above duck typing of
modules. Instead, it asks whether P's category is a sub-category of the
category of ZZ-modules:

  sage: P.category().is_subcategory(Modules(ZZ))
  False

This is not the case, and hence "P not in Modules(ZZ)" in spite of the
existence of a ZZ-action.

Now, the point of the question/suggestion is this:

  sage: P.category().is_subcategory(CommutativeAdditiveGroups())
  True

Since CommutativeAdditiveGroups() and Modules(ZZ) are mathematically the
same, we should somehow identify these two categories, and then P would
be immediately recognised as ZZ-module.

Now, the question is how to implement this categorial identity.
Modules(R) already uses some black magic (overriding __new__!) in order
to achieve "Modules(QQ) is VectorSpaces(QQ)". Similarly, one might think
of making "Modules(ZZ)" return "CommutativeAdditiveGroups()".

Best regards,
Simon


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

Reply via email to