Opened 11 years ago

Closed 11 years ago

#11552 closed defect (fixed)

Fix surjectivity testing for free module morphisms

Reported by: Rob Beezer Owned by: jason, was
Priority: major Milestone: sage-4.7.2
Component: linear algebra Keywords:
Cc: Simon King, Robert Bradshaw, Miguel Marco Merged in: sage-4.7.2.alpha2
Authors: Rob Beezer Reviewers: John Palmieri
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by Rob Beezer)

Testing for surjectivity of a free module homorphism is probably just fine for vector spaces, but seems to be broken for modules.

sage: V = ZZ^2
sage: m = matrix(ZZ, [[1,2],[0,2]])
sage: phi = V.hom(m, V)
sage: phi.lift(vector(ZZ, [0, 1]))
ValueError                                Traceback (most recent call last)

/sage/dev/devel/sage-main/<ipython console> in <module>()

/sage/dev/local/lib/python2.6/site-packages/sage/modules/free_module_morphism.pyc in lift(self, x)
    375             t = self.domain().linear_combination_of_basis(C)
    376         except TypeError:
--> 377             raise ValueError, "element is not in the image"
    378         assert self(t) == x
    379         return t

ValueError: element is not in the image
sage: phi.is_surjective()


  1. trac_11552-module-morphism-surjectivity-v2.patch

Attachments (1)

trac_11552-module-morphism-surjectivity-v2.patch (2.4 KB) - added by Rob Beezer 11 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 11 years ago by Rob Beezer

Authors: Rob Beezer
Cc: Simon King Robert Bradshaw added
Description: modified (diff)
Status: newneeds_review

comment:2 Changed 11 years ago by Rob Beezer

Description: modified (diff)

comment:3 Changed 11 years ago by Rob Beezer

Passes all long tests for me on 4.7.1.alpha3 and patchbot is green-lighting it at the moment.

Changed 11 years ago by Rob Beezer

comment:4 Changed 11 years ago by Rob Beezer

Cc: Miguel Marco added
Description: modified (diff)

Version 2 patch tests if a morphism is surjective with the .is_submodule() method. Slower, I guess, but a greater chance of being correct. An example from mmarco has been added to illustrate the non-unique echelon basis for the image. The necessity of these changes is detailed on #11579 (and perhaps, see #11553).

comment:5 Changed 11 years ago by John Palmieri

Reviewers: John Palmieri
Status: needs_reviewpositive_review

Looks good to me.

comment:6 in reply to:  5 Changed 11 years ago by Rob Beezer

Replying to jhpalmieri:

Looks good to me.

Thanks, John - appreciate you taking the time to look at this. - Rob

comment:7 Changed 11 years ago by Jeroen Demeyer

Merged in: sage-4.7.2.alpha2
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.