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

Degree of zero element #234

Open
sebastianpos opened this issue Mar 6, 2019 · 2 comments
Open

Degree of zero element #234

sebastianpos opened this issue Mar 6, 2019 · 2 comments

Comments

@sebastianpos
Copy link
Member

There appears to be no consistent behaviour when we ask for the degree of the zero element in a graded ring. Here are some examples:

gap> S1 := GradedRing( HomalgFieldOfRationalsInSingular()*"x" );;
gap> SetWeightsOfIndeterminates( S1, [ 1 ] );;
gap> Degree( Zero( S1 ) );
-1

gap> S2 := GradedRing( HomalgFieldOfRationalsInSingular()*"x" );;
gap> SetWeightsOfIndeterminates( S2, [ -1 ] );;
gap> Degree( Zero( S2 ) );
1

gap> S3 := GradedRing( HomalgFieldOfRationalsInSingular()*"x,y" );;
gap> SetWeightsOfIndeterminates( S3, [ 1,-1 ] );;
gap> Degree( Zero( S3 ) );
-1

gap> S4 := GradedRing( HomalgFieldOfRationalsInSingular()*"x,y" );;
gap> SetWeightsOfIndeterminates( S4, [ [1,0],[0,1] ] );;
gap> Degree( Zero( S4 ) );
( -1, -1 )

gap> S5 := GradedRing( HomalgFieldOfRationalsInSingular()*"x,y" );;
gap> SetWeightsOfIndeterminates( S5, [ [-1,-1],[0,1] ] );;
gap> Degree( Zero( S5 ) );
( -1, -1 )

gap> S5 := GradedRing( HomalgFieldOfRationalsInSingular()*"x,y" );;
gap> SetWeightsOfIndeterminates( S5, [ [-1,0],[0,-1] ] );;
gap> Degree( Zero( S5 ) );
( -1, -1 )

or

gap> R := GradedRing( HomalgFieldOfRationalsInSingular()*"x,y,z" );;
gap> SetWeightsOfIndeterminates( R, [ 1,1,1 ] );;
gap> S := R/"x*y-z";
Q[x,y,z]/( x*y-z )
(weights: yet unset)
gap> WeightsOfIndeterminates( S );
[ 1, 1, 1 ]
gap> Degree( Zero( S ) );
-1
gap> Degree( "x*y-z"/S );
2

Is this intentional?

Mathematically, I would expect either an error when calling Degree of the zero element, or an extra symbol as an output like fail.

@mohamed-barakat
Copy link
Member

mohamed-barakat commented Mar 6, 2019

Back then I wanted to use something like -infinity which was introduced later to GAP:

gap> -infinity + 1000;
-infinity

But since we are now using multi-degrees we cannot use -infinity:

gap> -infinity + [1000,1000];
[ -infinity, -infinity ]

The option to use [ -infinity, -infinity ] is also problematic, since a (multi-)degree is a an element of an IsHomalgModule over HomalgRingOfIntegers().

The clean solution is to introduce a new symbol -inf and overload the + operation to behave as expected with homalg's degrees and multi-degrees.

One can also consider the overloading of + for -infinity and homalg's (multi-)degrees.

@fingolfin
Copy link
Member

If the multi degrees are custom objects, and in particular not lists, then I think it makes a lot of sense to overload addition of such a multidegree with -infinity. It should only require a 2-3 lines of code, too.

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

No branches or pull requests

3 participants