Macaulay2 / Macaulay2/M2

equality of elements of submodules of the same module

Open
#3,881 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Core
Dominant language
Macaulay2
Stars
435
Forks
297
Avg merge
4d 20h
Merged PRs (30d)
11

Description

Given two submodules M and N in a free module F, if I have elements m in M and n in N, what should m == n check? Currently, this is automatically false if M and N are not the same, but I think given that both are submodules of the same free module F, they should be equal, no? Here is an example:
```m2
R = kk[x,y]
M = image matrix {{x,0}, {0,y}}
N = image matrix {{0,x}, {y,0}}

-- As vectors:
M_0 == N_1 -- false, but I think this should be true
M_0 === N_1 -- false, which is fine

-- As matrices:
M_{0} == N_{1} -- true
M_{0} === N_{1} -- false, which is fine
```

If these vectors are considered equal, this would also be true:
```m2
debug needsPackage "FGLM"
I = cyclic(5)
M = module I
N = module ideal random I_*
S1 = set M_*
S2 = set N_*
S1 == S2 -- false

L1 = set apply(5, i -> image N_{i})
L2 = set apply(5, i -> image M_{i})
L1 == L2 -- true
```

---

Unrelated, but GC just crashed my M2 while I was comparing two vectors above:
```m2
i183 : M = image matrix {{x,0}, {0,y}}

o183 = image | x 0 |
| 0 y |

2
o183 : R-module, submodule of R

i184 : N = image matrix {{0,x}, {y,0}}

o184 = image | 0 x |
| y 0 |

2
o184 : R-module, submodule of R

i185 : M_0 == N_1

o185 = false

i186 : M_0 === N_1 -- M2 got stuck here so I interrupted it after a second
C-c C-c C-c C-c
Exit (y=yes/n=no/a=abort/b=backtrace)? b
-* stack trace, pid: 628252
0# profiler_stacktrace(std::ostream&, int) at /home/mahrud/Projects/M2/quickfix/M2/Macaulay2/bin/main.cpp:131
1# interrupt_handler at /home/mahrud/Projects/M2/quickfix/M2/Macaulay2/bin/main.cpp:285
2# 0x0000000000019C30 in /lib64/libc.so.6
3# GC_mark_from in /home/linuxbrew/.linuxbrew/opt/bdw-gc/lib/libgc.so.1
4# GC_mark_local in /home/linuxbrew/.linuxbrew/opt/bdw-gc/lib/libgc.so.1
5# GC_mark_some in /home/linuxbrew/.linuxbrew/opt/bdw-gc/lib/libgc.so.1
6# GC_stopped_mark in /home/linuxbrew/.linuxbrew/opt/bdw-gc/lib/libgc.so.1
7# GC_try_to_collect_inner in /home/linuxbrew/.linuxbrew/opt/bdw-gc/lib/libgc.so.1
8# GC_grow_table in /home/linuxbrew/.linuxbrew/opt/bdw-gc/lib/libgc.so.1
9# GC_register_finalizer_inner in /home/linuxbrew/.linuxbrew/opt/bdw-gc/lib/libgc.so.1
10# pthread0_newThreadRWLock at /home/mahrud/Projects/M2/quickfix/M2/Macaulay2/d/pthread0.d:50
11# hashtables_copy at /home/mahrud/Projects/M2/quickfix/M2/Macaulay2/d/hashtables.dd:298
12# override_2 at /home/mahrud/Projects/M2/quickfix/M2/Macaulay2/d/actors3.d:82
13# evaluate_evalraw at /home/mahrud/Projects/M2/quickfix/M2/Macaulay2/d/evaluate.d:1435
14# evaluate_evalSequence at /home/mahrud/Projects/M2/quickfix/M2/Macaulay2/d/evaluate.d:461
```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the M and N equality examples first, then inspect the reported stack trace through main.cpp, pthread0.d, hashtables.dd, actors3.d, and evaluate.d. Determine the intended distinction between == and === for elements of submodules, and verify that the equality checks complete without the reported GC hang.

Written by the indexing model from the issue text.

Assessment

Domain
tooling
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.