Macaulay2 / Macaulay2/M2

trim Ideal doesn't trim all the way

Open
#3,622 1 comment 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

From Nick Addington via Google groups:

I ran this code:

R = QQ[x,y,X,Y,Z, Degrees=>{1,1,0,0,0}]
I = ideal(y*X-x*Z,x*Y-y*Z,x^2,y^2,x*y,Z-1,X*Y-Z^2,X-1,Y-1)
trim I

The output was

ideal(Z-1,Y-1,X-1,x-y,y^2,x*y,x^2)

when I would have expected

ideal(Z-1,Y-1,X-1,x-y,y^2)

Bizarrely, if I run

J = ideal(Z-1,Y-1,X-1,x-y,y^2,x*y,x^2)
trim J

then I do get the expected output.

Is this a bug, or should I tweak my input somehow?

I believe this is a bug, both in the graded and non-graded case:

i1 : R = QQ[x,y,X,Y,Z];

i2 : I = ideal(y*X-x*Z,x*Y-y*Z,x^2,y^2,x*y,Z-1,X*Y-Z^2,X-1,Y-1);

i3 : trim oo

                                         2        2
o3 = ideal (Z - 1, Y - 1, X - 1, x - y, y , x*y, x )

i4 : trim oo

                                         2
o4 = ideal (Z - 1, Y - 1, X - 1, x - y, y )

i5 : isHomogeneous  I

o5 = false

i6 : R = QQ[x,y,X,Y,Z, Degrees=>{1,1,0,0,0}];

i7 : I = ideal(y*X-x*Z,x*Y-y*Z,x^2,y^2,x*y,Z-1,X*Y-Z^2,X-1,Y-1);

i8 : trim oo

                                         2        2
o8 = ideal (Z - 1, Y - 1, X - 1, x - y, y , x*y, x )

i9 : trim oo

                                         2
o9 = ideal (Z - 1, Y - 1, X - 1, x - y, y )

i10 : isHomogeneous I

o10 = true

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 two trim examples from the issue in Macaulay2, including both the graded and non-graded rings. Then locate the implementation of trim and determine why the first invocation retains redundant generators. Done means both examples produce the reduced ideal on the first invocation, with regression coverage for the reported inputs.

Written by the indexing model from the issue text.

Assessment

Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.