Unfortunately there is no useful functionality for modules over a polynomial
ring directly in Sage, even over k[x] where k is a field, since nobody
contributed an implementation of Hermite Normal Form in that context yet.
Here's what you would do to create a module over a polynomial ring
then a submodule:
sage: R.<x> = QQ[]
sage: W = R^5; W
Ambient free module of rank 5 over the principal ideal domain
Univariate Polynomial Ring in x over Rational Field
sage: V = W.span([[x,0,0,2,1], [0,x,1,1,1]])
However, I just noticed that somebody (I think malb recently) appears
to have defined "echelon form"
for matrices over a polynomial ring (it should be Hermite Normal
Form), so instead
of getting NotImplementedErrors, a bunch of functions for modules over
polynomial
rings return False answers:
sage: V # wrong
Free module of degree 5 and rank 2 over Univariate Polynomial Ring in
x over Rational Field
Echelon basis matrix:
[ 1 0 0 2/x 1/x]
[ 0 1 1/x 1/x 1/x]
sage: [x,0,0,2,1] in V # wrong
False
Here's what you "would" do for a module over a poly ring in several variables.
At least this doesn't work:
sage: R.<x,y> = QQ[]
sage: W = R^5; W
Ambient free module of rank 5 over the integral domain Multivariate
Polynomial Ring in x, y over Rational Field
sage: V = W.span([[x,0,0,2,1], [0,x,1,1,y]]); V
---------------------------------------------------------------------------
<type 'exceptions.AttributeError'> Traceback (most recent call last)
/Users/was/<ipython console> in <module>()
<type 'exceptions.AttributeError'>: 'FreeModule_ambient_domain' object
has no attribute 'span'
http://trac.sagemath.org/sage_trac/ticket/2075
-- William
There is no such method yet. Implement it and send me a patch.
> 2. Are there Sage tutorials that i should add to my bookmarks (in
> addition to those listed on http://modular.math.washington.edu/sage/doc/html/index.html)?
Not well organized. There should be. Get one of your students to write one :-)
> 3. What is a "category" in Sage, and (if it resembles the categories
> in "Category Theory") how can it be used?
A category is to a ring or module (or ?) as a ring or module is to an
element, e.g.,:
sage: V = QQ^5
sage: V
Vector space of dimension 5 over Rational Field
sage: x = V.0
sage: C = V.category()
sage: x in V
True
sage: V in C
True
sage: W = ZZ^5
sage: C(W)
Vector space of dimension 5 over Rational Field
Categories are mainly relevant for constructing homsets and generally
organizing things. They are _not_ used nearly as much as they might
be in Sage, which may or may not be a good thing.
-- William