Opened 10 years ago

Closed 3 years ago

#11579 closed defect (wontfix)

Free module equality, comparisons

Reported by: rbeezer Owned by: jason, was
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: linear algebra Keywords:
Cc: fwclarke Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps: todo

Status badges

Description (last modified by rbeezer)

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

Change History (14)

comment:1 Changed 10 years ago by rbeezer

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.

comment:2 Changed 10 years ago by fwclarke

  • Cc fwclarke added

comment:3 Changed 10 years ago by rbeezer

  • Description modified (diff)

comment:4 Changed 8 years ago by jdemeyer

  • Milestone changed from sage-5.11 to sage-5.12

comment:5 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:6 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:7 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4

comment:8 Changed 6 years ago by jakobkroeker

  • Stopgaps set to todo

comment:9 Changed 4 years ago by sbrandhorst

Be aware of #23978 Rich comparison for Modules

comment:10 Changed 3 years ago by sbrandhorst

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?

comment:11 Changed 3 years ago by sbrandhorst

  • Status changed from new to needs_review

comment:12 Changed 3 years ago by sbrandhorst

  • Milestone changed from sage-6.4 to sage-8.2

comment:13 Changed 3 years ago by chapoton

  • Milestone changed from sage-8.2 to sage-duplicate/invalid/wontfix
  • Status changed from needs_review to positive_review

let us close

comment:14 Changed 3 years ago by vdelecroix

  • Resolution set to wontfix
  • Status changed from positive_review to closed

closing positively reviewed duplicates

Note: See TracTickets for help on using tickets.