Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 7ebd25ac536d248d499a3ce2acda963a > files > 5033

Macaulay2-1.3.1-8.fc15.i686.rpm

<?xml version="1.0" encoding="utf-8" ?>  <!-- for emacs: -*- coding: utf-8 -*- -->
<!-- Apache may like this line in the file .htaccess: AddCharset utf-8 .html -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"	 "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg-flat.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head><title>right modules or left modules?</title>
<link rel="stylesheet" type="text/css" href="../../../../Macaulay2/Style/doc.css"/>
</head>
<body>
<table class="buttons">
  <tr>
    <td><div><a href="___Hilbert_spfunctions_spand_spfree_spresolutions.html">next</a> | <a href="_module_sphomomorphisms.html">previous</a> | <a href="___Hilbert_spfunctions_spand_spfree_spresolutions.html">forward</a> | <a href="_module_sphomomorphisms.html">backward</a> | <a href="_modules.html">up</a> | <a href="index.html">top</a> | <a href="master.html">index</a> | <a href="toc.html">toc</a> | <a href="http://www.math.uiuc.edu/Macaulay2/">Macaulay2 web site</a></div>

    </td>
  </tr>
</table>
<div><a href="index.html" title="">Macaulay2Doc</a> > <a href="_modules.html" title="">modules</a> > <a href="_right_spmodules_spor_spleft_spmodules_qu.html" title="">right modules or left modules?</a></div>
<hr/>
<div><h1>right modules or left modules?</h1>
<div>Macaulay2 can handle non-commutative rings, and for such rings there is a difference between left modules and right modules.  In Macaulay2, all the modules are left modules, but matrices act on the left, too.  The usual convention would be to have the matrices act on the right, so the homomorphism rule (<tt>f(av)=af(v)</tt>) becomes a consequence of associativity of matrix-vector-scalar multiplication (<tt>(av)f=a(vf)</tt>).  Macaulay2 makes things come out okay in the end -- a left <tt>R</tt>-module can be regarded naturally as a right <tt>R'</tt>-module, where <tt>R'</tt> is the opposite ring of <tt>R</tt>, obtained from the ring <tt>R</tt> by reversing the multiplication.  Thus matrices over <tt>R'</tt> can act on <tt>R</tt>-modules from the left.  Matrices over <tt>R</tt> in Macaulay2 are <em>really</em> matrices over <tt>R'</tt>.<p/>
We illustrate this state of affairs with an example over a (noncommutative) Weyl algebra.  First observe the noncommutativity.<table class="examples"><tr><td><pre>i1 : R = QQ[x,dx,WeylAlgebra=>{x=>dx}]

o1 = R

o1 : PolynomialRing</pre>
</td></tr>
<tr><td><pre>i2 : x*dx

o2 = x*dx

o2 : R</pre>
</td></tr>
<tr><td><pre>i3 : dx*x

o3 = x*dx + 1

o3 : R</pre>
</td></tr>
</table>
Now verify the module is a left module by checking associativity.<table class="examples"><tr><td><pre>i4 : M = R^2

      2
o4 = R

o4 : R-module, free</pre>
</td></tr>
<tr><td><pre>i5 : v = M_0

o5 = | 1 |
     | 0 |

      2
o5 : R</pre>
</td></tr>
<tr><td><pre>i6 : dx*v

o6 = | dx |
     | 0  |

      2
o6 : R</pre>
</td></tr>
<tr><td><pre>i7 : x*(dx*v)

o7 = | xdx |
     | 0   |

      2
o7 : R</pre>
</td></tr>
<tr><td><pre>i8 : (x*dx)*v

o8 = | xdx |
     | 0   |

      2
o8 : R</pre>
</td></tr>
<tr><td><pre>i9 : x*(dx*v) == (x*dx)*v

o9 = true</pre>
</td></tr>
</table>
Now make a matrix and check that left multiplication by it is a homomorphism from <tt>M</tt> to <tt>M</tt>.<table class="examples"><tr><td><pre>i10 : f = dx * id_M

o10 = | dx 0  |
      | 0  dx |

              2       2
o10 : Matrix R  &lt;--- R</pre>
</td></tr>
<tr><td><pre>i11 : f*(x*v)

o11 = | xdx |
      | 0   |

       2
o11 : R</pre>
</td></tr>
<tr><td><pre>i12 : x*(f*v)

o12 = | xdx |
      | 0   |

       2
o12 : R</pre>
</td></tr>
<tr><td><pre>i13 : f*(x*v) == x*(f*v)

o13 = true</pre>
</td></tr>
</table>
Now we make another matrix and check that matrix multiplication treats the entries of the matrices as residing in the opposite ring, <tt>R'</tt>.<table class="examples"><tr><td><pre>i14 : g = x * id_M

o14 = | x 0 |
      | 0 x |

              2       2
o14 : Matrix R  &lt;--- R</pre>
</td></tr>
<tr><td><pre>i15 : f*g

o15 = | xdx 0   |
      | 0   xdx |

              2       2
o15 : Matrix R  &lt;--- R</pre>
</td></tr>
<tr><td><pre>i16 : f*g == (x*dx) * id_M

o16 = true</pre>
</td></tr>
<tr><td><pre>i17 : (dx * id_M)*(x * id_M) == (x*dx) * id_M

o17 = true</pre>
</td></tr>
</table>
Here we check that multiplication of a scalar times a matrix is compatible with multiplication of a scalar times a vector.<table class="examples"><tr><td><pre>i18 : x * ( (dx * id_M) * v )

o18 = | xdx |
      | 0   |

       2
o18 : R</pre>
</td></tr>
<tr><td><pre>i19 : (x *  (dx * id_M) ) * v

o19 = | xdx |
      | 0   |

       2
o19 : R</pre>
</td></tr>
<tr><td><pre>i20 : (x *  (dx * id_M) ) * v == x * ( (dx * id_M) * v )      

o20 = true</pre>
</td></tr>
</table>
One desirable associativity rule does <em>not</em> hold, the one for <em>RingElement * Matrix * Matrix</em>, as we see in this example.<table class="examples"><tr><td><pre>i21 : x * ( id_M * ( dx * id_M ) )

o21 = | xdx 0   |
      | 0   xdx |

              2       2
o21 : Matrix R  &lt;--- R</pre>
</td></tr>
<tr><td><pre>i22 : (x * id_M) * ( dx * id_M )

o22 = | xdx+1 0     |
      | 0     xdx+1 |

              2       2
o22 : Matrix R  &lt;--- R</pre>
</td></tr>
<tr><td><pre>i23 : x * ( id_M * ( dx * id_M ) ) == (x * id_M) * ( dx * id_M )

o23 = false</pre>
</td></tr>
</table>
The reason for this discrepancy is that, as explained above, matrix multiplication is done over <tt>R'</tt>, not over <tt>R</tt>.<p/>
Currently, tensor product of a module <tt>M</tt> by a ring <tt>R</tt> works on either side and does the same thing.  In other words, you can write <tt>R**M</tt> or <tt>M**R</tt>.  That may change in the future.</div>
</div>
</body>
</html>