# Sage fails to check if NumberField is UFD

The field Q(sqrt(-5)) if not a unique factorization domain. Yet the code below:

K.<z> = NumberField( x^2+5 )
print( K.is_unique_factorization_domain(  ) )
print( K.is_euclidean_domain() )
print( K.class_group(proof=False) )


suggests that it is, but has the non-trivil ideal class group, which is a contradiction (K cannot be neither UFD or Euclidean domain if it is not the Principal ideal domain - but it isn't due to the nontrivial class group).

The output of the code is:

True
True
Class group of order 2 with structure C2 of Number Field in z with defining polynomial x^2 + 5


Am I doing it wrong? How do I check whether field is UFD correctly?

edit retag close merge delete

Sort by ยป oldest newest most voted

In a field there are no nonzero non-invertible elements.

Being "unique factorisation" or "euclidean" depends on properties of such elements.

Better ask such questions about the ring of integers of that field:

sage: OK = K.ring_of_integers()
sage: OK in UniqueFactorizationDomains
False
sage: OK in EuclideanDomains
False

more