Opened 14 years ago

Closed 13 years ago

# minus for modules/ideals

Reported by: Owned by: Oleksandr hannes major 3-1-1 singular-kernel 3-0-5 module, -, +, subtraction

### Description

Dear Colleagues,

please let me remind about the inconsistence between "+" and "-" for modules/ideals in the example below. It seems that conceptually different meanings/definitions for "+" and "-" may lead a newbie into a deep despair.

Therefore i propose to disable subtraction between modules/ideals as it is now. For a user it would simply mean/require an explicit conversion of a module/ideal into a matrix where needed.

```minus.tst  45. ring r;

minus.tst  47. module M = gen(1);

//////////////////// M = UNIT MODULE ///////////////////////////

minus.tst  48> Test(M);
::Test   0. parameter def M;

::Test   2.   typeof(  M ); // module / ideal
module

::Test   4.   typeof( -M ); // matrix!
matrix

::Test   6.   -M; // matrix: _[1,1]=-1 (-x)
_[1,1]=-1

::Test   8.   M + M; // module : _[1]=gen(1) / ideal: _[1]= x
_[1]=gen(1)

::Test  10.   M - M; // zero matrix: _[1,1]=0 !!!
_[1,1]=0

::Test  12.   M + (- M); // module(!): _[1]=gen(1) /  _[1]= x*gen(1)
_[1]=gen(1)

::Test  14.   M + (M - M); // module(!): _[1]=gen(1) /  _[1]= x*gen(1)
_[1]=gen(1)

::Test  16.   (M + M) - M; // zero matrix: _[1,1]=0
_[1,1]=0

::Test  18.   M + M - M; // zero matrix: _[1,1]=0 !!!
_[1,1]=0

::Test  20.   M - M + M; // module(!): _[1]=gen(1) /  _[1]= x*gen(1)
_[1]=gen(1)

minus.tst  51. ideal M = var(1);

/////////////////// SAME FOR IDEAL <x> /////////////////////////

minus.tst  52> Test(M);
::Test   0. parameter def M;

::Test   2.   typeof(  M ); // module / ideal
ideal

::Test   4.   typeof( -M ); // matrix!
matrix

::Test   6.   -M; // matrix: _[1,1]=-1 (-x)
_[1,1]=-x

::Test   8.   M + M; // module : _[1]=gen(1) / ideal: _[1]= x
_[1]=x

::Test  10.   M - M; // zero matrix: _[1,1]=0 !!!
_[1,1]=0

::Test  12.   M + (- M); // module(!): _[1]=gen(1) /  _[1]= x*gen(1)
_[1]=x*gen(1)

::Test  14.   M + (M - M); // module(!): _[1]=gen(1) /  _[1]= x*gen(1)
_[1]=x*gen(1)

::Test  16.   (M + M) - M; // zero matrix: _[1,1]=0
_[1,1]=0

::Test  18.   M + M - M; // zero matrix: _[1,1]=0 !!!
_[1,1]=0

::Test  20.   M - M + M; // module(!): _[1]=gen(1) /  _[1]= x*gen(1)
_[1]=x*gen(1)
```

What do you think?

my tests

### comment:1 Changed 14 years ago by Oleksandr

Type: defect → enhancement

### comment:2 Changed 14 years ago by seelisch

Milestone: → Releases 3-1-1 and higher

### comment:3 Changed 13 years ago by hannes

Resolution: → fixed new → closed

we give it a try - I do not know if this is better.

Note: See TracTickets for help on using tickets.