Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Free module equality, comparisons #11579

Closed
rbeezer mannequin opened this issue Jul 6, 2011 · 7 comments
Closed

Free module equality, comparisons #11579

rbeezer mannequin opened this issue Jul 6, 2011 · 7 comments

Comments

@rbeezer
Copy link
Mannequin

rbeezer mannequin commented Jul 6, 2011

On #11553, mmarco gives an example that can be distilled to:

sage: R = PolynomialRing(QQ, 'a')
sage: x = vector(R, [1, 0])
sage: y = vector(R, [0, 1])
sage: z = vector(R, [0,-1])
sage: A = (R^2).span([x, y])
sage: B = (R^2).span([x, z])
sage: A == B
False
sage: A.is_submodule(B)
True
sage: B.is_submodule(A)
True

Root cause looks like an assumption that echelon form (Hermite form) over PIDs is unique, which may be insurmountable in general.

sage: S = matrix([x, y])
sage: S._echelon_form_PID()[1]
[1 0]
[0 1]
sage: T = matrix([x, z])
sage: T._echelon_form_PID()[1]
[ 1  0]
[ 0 -1]

This also affects the ordering of free modules via the __cmp__ method.

Informative discussion at:
http://groups.google.com/group/sage-devel/browse_thread/thread/eda6f3ebc118b8b

CC: @sagetrac-fwclarke

Component: linear algebra

Stopgaps: todo

Issue created by migration from https://trac.sagemath.org/ticket/11579

@rbeezer rbeezer mannequin added this to the sage-5.11 milestone Jul 6, 2011
@rbeezer rbeezer mannequin added c: linear algebra labels Jul 6, 2011
@rbeezer rbeezer mannequin assigned jasongrout and williamstein Jul 6, 2011
@rbeezer
Copy link
Mannequin Author

rbeezer mannequin commented Jul 6, 2011

comment:1

One suggestion for a fix:

(a) make comparisons raise a NotImplementedError for rings that are not fields and not ZZ - though I have not checked to see how important an ordering on free modules is.

(b) use a pair of calls to .is_submodule() to test equality.

I don't plan to pursue this one much further, but could review a fix.

@rbeezer

This comment has been minimized.

@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@sagetrac-jakobkroeker
Copy link
Mannequin

sagetrac-jakobkroeker mannequin commented Aug 25, 2015

Stopgaps: todo

@simonbrandhorst
Copy link

comment:9

Be aware of #23978 Rich comparison for Modules

@simonbrandhorst
Copy link

comment:10
sage: sage: R = PolynomialRing(QQ, 'a')
....: sage: x = vector(R, [1, 0])
....: sage: y = vector(R, [0, 1])
....: sage: z = vector(R, [0,-1])
....: sage: A = (R^2).span([x, y])
....: sage: B = (R^2).span([x, z])
....: sage: A == B
....: 
True
sage: A.is_submodule(B)
True
sage: B.is_submodule(A)
True

Looks fixed to me.
Close?

@fchapoton
Copy link
Contributor

comment:13

let us close

@fchapoton fchapoton removed this from the sage-8.2 milestone Apr 7, 2018
@videlec
Copy link
Contributor

videlec commented May 18, 2018

comment:14

closing positively reviewed duplicates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants