On Friday, January 2, 2015 2:36:47 AM UTC-8, Jeroen Demeyer wrote:
>
> Currently in Sage one can do the following: 
>
> sage: M = (ZZ^2)*(1/2) 
> ...
> One sees that really two rings are involved: 
> (1) the ring ZZ which is the ring of scalars, the ring R such that we 
> have an R-module. 
> (2) the ring QQ from which the elements (the coefficients of the 
> vectors) come. 
>

The operation you apply to obtain the model isn't defined for a free module 
over a ring. Extra structure is required: M needs to be embedded in a 
module over a ring in which (1/2) exists. The fact that we have that 
operation, suggests that (ZZ^2) is not just an abstract free module over 
ZZ, but lives in a category with more structure. Indeed:

sage: A=(ZZ^2)
sage: M=A*(1/2)
sage: B=M.ambient_module()
sage: M.ambient_vector_space() #there is an attribute of a 
Vector space of dimension 2 over Rational Field
sage: A==B
True
sage: A.is_submodule(M)
True
sage: M.is_submodule(A)
False
sage: parent(A.basis()[0])
Ambient free module of rank 2 over the principal ideal domain Integer Ring
sage: C=parent(M.basis()[0])
sage: parent(C.basis()[0]) is C
True
sage: parent(A.basis()[0]) is A
True
sage: C
Free module of degree 2 and rank 2 over Integer Ring
Echelon basis matrix:
[1/2   0]
[  0 1/2]
sage: B.is_submodule(C)
True

As you can see, there is an attribute "ambient_vectorspace", so these 
modules M come with an embedding into M tensor_ZZ QQ, and as you can see in 
the examples above, for M,C these embeddings are not the standard ones.

I think that the "base ring" of these modules is unambiguous: it's ZZ. It 
just happens that their basis might not be represented using the base ring. 
The distinction between B and C comes probably from the fact that B is 
represented entirely relative to A, whereas C is a representation more 
directly tied to the ambient vector space.

When working with modules over a PID, it's probably fine to use this richer 
category. However, we should allow people to "just" work with ZZ-modules, 
so I'm -1 for changing the meaning of base_ring.

For someone considering purely ZZ-modules it is perhaps a surprise that A*c 
did not produce a submodule of A, but then the scalar c used wasn't in ZZ, 
so in just the category of ZZ-modules, the operation isn't defined. Note 
that for "ambient" modules the basis always seems to lie in the ambient 
module. It's just that the coefficients of the basis elements need not lie 
in ZZ, but that's just consistent. We have:

sage: parent(N.basis()[0][0])
Integer Ring
sage: parent(M.basis()[0][0])
Rational Field

so it's only when we constructed a module that really requires the 
embedding in a vector space that we see that the coefficients of the 
relative basis don't live in ZZ.

(what is implemented is really a "fractional module" over a PID, in analogy 
with fractional ideals)

-- 
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