Sage: Ticket #16247: Meaning of Modules(R) currently not very clear
https://trac.sagemath.org/ticket/16247
<p>
The doc of <code>class Modules</code> currently (<a class="closed ticket" href="https://trac.sagemath.org/ticket/10963" title="enhancement: Axioms and more functorial constructions (closed: fixed)">#10963</a>) says:
</p>
<pre class="wiki"> The category of all modules over a base ring `R`.
An `R`-module `M` is a left and right `R`-module over a
commutative ring `R` such that:
.. math:: r*(x*s) = (r*x)*s \qquad \forall r,s \in R \text{ and } x \in M
</pre><p>
This is not the notion of a module that mathematicians are used to, not even when R is commutative. Instead, this is the definition of an R-R-bimodule. I fear that this is destined to lead to confusion and subtle bugs. For instance, the <code>WithBasis</code> subcategory implements methods like "basis" and "support". But a left R-module basis of an R-R-bimodule might not be a right R-module basis, and even if it is, the supports of one and the same element with respect to it (one time as a left R-module basis, another time as a right one) might be different. I have not seen the <code>WithBasis</code> subcategory being used in problematic cases (i.e., in cases where the left and right structure are different), but I fear that this is bound to eventually happen.
</p>
<p>
I've run the (short) doctests of src/sage with a commit that adds a warning every time Modules(A) is called for A noncommutative. Here are the relevant results:
</p>
<p>
<a class="ext-link" href="https://www.dropbox.com/s/oieg1ig0dliz63s/noncomm.txt"><span class="icon"></span>https://www.dropbox.com/s/oieg1ig0dliz63s/noncomm.txt</a>
</p>
<p>
It seems that matrices over noncommutative rings are the main culprit here -- or, rather, matrix spaces being cast as modules over the base rings. I think they should be bimodules, since there is a <code>Bimodules(R, R)</code> category already.
</p>
<p>
Apparently people have been aware of this for a while; the following warning message is doctested for and not written by me:
</p>
<pre class="wiki"> doctest:...: UserWarning: You are constructing a free module
over a noncommutative ring. Sage does not have a concept
of left/right and both sided modules, so be careful.
It's also not guaranteed that all multiplications are
done from the right side.
</pre><p>
(We do have left/right/bi-modules now.)
</p>
<p>
There are some tracebacks I don't really understand... can it be that some methods in Sage construct matrices consisting of matrices? There's nothing wrong about that; I just think the constructor for the respective matrix spaces should pick the right category for that.
</p>
<p>
Here are some options:
</p>
<ul><li>Make <code>Modules</code> only support *symmetric* modules, i.e. modules M satisfying rx = xr for all r in R and x in M. This is useful almost only for commutative R (in fact, these modules are always modules over the abelianization of R).
</li></ul><ul><li>Make <code>Modules</code> only support R-R-bimodules which are direct sums of copies of the R-R-bimodule R. This allows for doing most things that can be done in the commutative case, and examples are polynomial rings over noncommutative rings, matrix spaces etc. -- I actually like this category. The only problem is that it is more of a "<a class="missing wiki">ModulesWithBasis?</a>" category than a "Modules" category.
</li></ul><ul><li>Make <code>Modules</code> only support R-R-bimodules which are sums (not necessarily direct) of copies of the R-R-bimodule R. This looks like a reasonable category but I know almost none of its properties.
</li></ul>en-usSagehttps://trac.sagemath.org/chrome/site/logo_sagemath_trac.png
https://trac.sagemath.org/ticket/16247
Trac 1.1.6darijSun, 27 Apr 2014 03:57:01 GMTkeywords, description changed; dependencies set
https://trac.sagemath.org/ticket/16247#comment:1
https://trac.sagemath.org/ticket/16247#comment:1
<ul>
<li><strong>keywords</strong>
<em>matrices</em> added; <em></em> removed
</li>
<li><strong>dependencies</strong>
set to <em>10963</em>
</li>
<li><strong>description</strong>
modified (<a href="/ticket/16247?action=diff&version=1">diff</a>)
</li>
</ul>
TicketdarijSun, 27 Apr 2014 03:57:30 GMTdescription changed
https://trac.sagemath.org/ticket/16247#comment:2
https://trac.sagemath.org/ticket/16247#comment:2
<ul>
<li><strong>description</strong>
modified (<a href="/ticket/16247?action=diff&version=2">diff</a>)
</li>
</ul>
TicketdarijSun, 27 Apr 2014 05:37:38 GMTdescription changed
https://trac.sagemath.org/ticket/16247#comment:3
https://trac.sagemath.org/ticket/16247#comment:3
<ul>
<li><strong>description</strong>
modified (<a href="/ticket/16247?action=diff&version=3">diff</a>)
</li>
</ul>
TicketnthierySun, 27 Apr 2014 07:08:33 GMT
https://trac.sagemath.org/ticket/16247#comment:4
https://trac.sagemath.org/ticket/16247#comment:4
<p>
Thanks for exploring how to clean this up.
</p>
<p>
Just for the record: we have had left/right/bimodules since 2009 and probably even before. Also, at this point, they are just categories over a base ring, not functorial constructions.
</p>
<p>
One thing to check is how this was handled in Axiom. MuPAD was roughly as here: on the lousy side in the non commutative case.
</p>
TicketdarijTue, 29 Apr 2014 02:22:14 GMTdependencies, description, summary changed
https://trac.sagemath.org/ticket/16247#comment:5
https://trac.sagemath.org/ticket/16247#comment:5
<ul>
<li><strong>dependencies</strong>
changed from <em>10963</em> to <em>#10963</em>
</li>
<li><strong>description</strong>
modified (<a href="/ticket/16247?action=diff&version=5">diff</a>)
</li>
<li><strong>summary</strong>
changed from <em>Abuse of Modules() for modules over noncommutative rings</em> to <em>Meaning of Modules(R) currently not very clear</em>
</li>
</ul>
Ticketvbraun_spamTue, 06 May 2014 15:20:58 GMTmilestone changed
https://trac.sagemath.org/ticket/16247#comment:6
https://trac.sagemath.org/ticket/16247#comment:6
<ul>
<li><strong>milestone</strong>
changed from <em>sage-6.2</em> to <em>sage-6.3</em>
</li>
</ul>
Ticketvbraun_spamSun, 10 Aug 2014 16:51:03 GMTmilestone changed
https://trac.sagemath.org/ticket/16247#comment:7
https://trac.sagemath.org/ticket/16247#comment:7
<ul>
<li><strong>milestone</strong>
changed from <em>sage-6.3</em> to <em>sage-6.4</em>
</li>
</ul>
Ticket