ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 05 Oct 2019 20:26:51 -0500subquotient of modulehttp://ask.sagemath.org/question/48198/subquotient-of-module/how can I take a quotient of a submodule? I was expecting the following to work:
<pre><code>sage: M = CombinatorialFreeModule(QQ, [1,2], prefix='x'); x = M.basis()
sage: A = M.submodule([x[2]])
sage: A.quotient_module(A)
Free module generated by {1} over Rational Field
</code></pre>
Which is clearly taking the quotient over the ambient space of `A` and not the image
<pre><code>sage: A.quotient_module(A) == M.quotient_module(A)
True</code></pre>
Replacing `A` with `A.lift.image()` is the same.
EDIT: well, reading now in `Modules.WithBasis.FiniteDimensional.ParentMethods.quotient_modules` this is simply a call to `QuotientModuleWithBasis(A,category)` which will infer the parent of `A`.
As a side observation, I find it disturbing that there is not even a check that `submodule` is indeed a submodule of `self` in that call.Sat, 05 Oct 2019 20:02:20 -0500http://ask.sagemath.org/question/48198/subquotient-of-module/Answer by heluani for <p>how can I take a quotient of a submodule? I was expecting the following to work:</p>
<pre><code>sage: M = CombinatorialFreeModule(QQ, [1,2], prefix='x'); x = M.basis()
sage: A = M.submodule([x[2]])
sage: A.quotient_module(A)
Free module generated by {1} over Rational Field
</code></pre>
<p>Which is clearly taking the quotient over the ambient space of <code>A</code> and not the image</p>
<pre><code>sage: A.quotient_module(A) == M.quotient_module(A)
True</code></pre>
<p>Replacing <code>A</code> with <code>A.lift.image()</code> is the same. </p>
<p>EDIT: well, reading now in <code>Modules.WithBasis.FiniteDimensional.ParentMethods.quotient_modules</code> this is simply a call to <code>QuotientModuleWithBasis(A,category)</code> which will infer the parent of <code>A</code>. </p>
<p>As a side observation, I find it disturbing that there is not even a check that <code>submodule</code> is indeed a submodule of <code>self</code> in that call.</p>
http://ask.sagemath.org/question/48198/subquotient-of-module/?answer=48200#post-id-48200Perhaps someone can explain me here a better way but the only way I found to to this now is as follows. Suppose we have two submodules with bases `A` and `B` of `M` defined by `M.submodule()`. Suppose moreover `B` is a submodule of `A` and both are of finite rank. Then we have to lift the basis of `B` as per (in this case `A` and `B` are the same)
<pre><code>sage: A.quotient_module([A.retract(b.lift()) for b in B.basis()])
Free module generated by {} over Rational Field
</code></pre>Sat, 05 Oct 2019 20:26:51 -0500http://ask.sagemath.org/question/48198/subquotient-of-module/?answer=48200#post-id-48200