gap-system / gap

Main development repository for GAP - Groups, Algorithms, Programming, a System for Computational Discrete Algebra
https://www.gap-system.org
GNU General Public License v2.0
813 stars 161 forks source link

Quotient ring as a field #1842

Open pedritomelenas opened 7 years ago

pedritomelenas commented 7 years ago

This issue is a resurection of an old issue reported on bitbucket.

If one defines

gap> x:=Indeterminate(Rationals,"x");;
gap> R:=PolynomialRing(Rationals,[x]);;
gap> f:= x^2+1;;
gap> F:=R/Ideal(R,[f]);
<ring Rationals,(1),(x)>

then

gap> IsField(F);
false

The expected behavior should be either true or No method found .... At least for Euclidean domains this could be tested "easily".

IsField looks like

gap> IsField;
<Filter "((((((IsMagmaWithInversesIfNonzero and (((((IsNearAdditiveGroup and (IsNearA\
dditiveMagma and IsAdditivelyCommutative)) and IsExtLSet) and IsDistributiveLOpDSum) \
and ((((IsNearAdditiveGroup and (IsNearAdditiveMagma and IsAdditivelyCommutative)) an\
d IsMagma) and (IsLDistributive and IsRDistributive)) and IsMagmaWithOne)) and IsAsso\
ciativeLOpDProd)) and ((((((((IsNearAdditiveGroup and (IsNearAdditiveMagma and IsAddi\
tivelyCommutative)) and IsExtLSet) and IsDistributiveLOpDSum) and IsLeftActedOnByRing\
) and IsDistributiveLOpESum) and IsAssociativeLOpEProd) and IsTrivialLOpEOne) and IsL\
eftActedOnByDivisionRing)) and IsNonTrivial) and IsAssociative) and IsEuclideanRing) \
and IsCommutative)">

And IsMagmaWithInversesIfNonzero already returns false

gap> IsMagmaWithInversesIfNonzero(F);
false

Also

gap> IsMagmaWithOne(F);
false

and

gap> IsEuclideanRing(F);
false

The rest of the filters that compound IsField return true in this case.

I wonder if these many filters are needed or if they are the consequence of many InstallTrueMethods.

Thank you, Pedro

 ┌───────┐   GAP 4.8.7-4188-g6bf8a74 of today
 │  GAP  │   https://www.gap-system.org
 └───────┘   Architecture: x86_64-apple-darwin14.5.0-gcc-default64
 Configuration:  gmp 6.0.0, readline
 Loading the library and packages ...
 Components: trans 1.0, prim 3.0, small* 1.0, id* 1.0
 Packages:   GAPDoc 1.5.1, IO 4.4.6dev
 Try '??help' for help. See also '?copyright', '?cite' and '?authors'
ChrisJefferson commented 7 years ago

It is important to GAP's functioning that Filters always return true or false, because we can ask any GAP object if it satisfies any filter during method dispatch, even when the question might not make sense.

pedritomelenas commented 7 years ago

Good, but in this case it should return true, not false. The answer is misleading.

pedritomelenas commented 7 years ago

As explained by @markuspf and @fingolfin on slack, I now understand the meaning of Filter here (or at least I think I understand it). So I think I will close this issue... GAP treats F as a ring, not as a field. Probably a method for AsField(F) could be implemented...

pedritomelenas commented 7 years ago

As discussed with @markuspf I reopen this cause at least IsMagmaWithOne(F); should return true.

hulpke commented 7 years ago

How about a special routine for univariate pol ring/irreducible that dispatches to AlegebraicExtension ?

pedritomelenas commented 7 years ago

The problem here is that one wants to avoid testing if the ideal is irreducible. One could do what @hulpke suggests when AsField is called for R/I.

If R is polynomial ring is over a field K, then one takes p as the gcd of the generators of the ideal I, and AsField(R/I) could return AlgebraicExtension(K,p). Indeed, if one calls AlgebraicExtension, it checks if the polynomial is irreducible.