Ticket #4528: krull.patch

File krull.patch, 3.5 KB (added by cremona, 14 years ago)
  • sage/rings/number_field/order.py

    # HG changeset patch
    # User John Cremona <john.cremona@gmail.com>
    # Date 1226767828 0
    # Node ID 4f6c26438fae4cb8b985f9cd51159464c2491f6d
    # Parent  5e45f3ee796ad08b6a3467a21f4809ba9e2d69dc
    Implement Krull dimension for orders in number fields
    
    diff -r 5e45f3ee796a -r 4f6c26438fae sage/rings/number_field/order.py
    a b  
    290290        """
    291291        return self.is_maximal()
    292292   
    293    
     293    def krull_dimension(self):
     294        """
     295        Return the Krull dimension of this order, which is 1.
     296
     297        EXAMPLES:
     298            sage: K.<a> = QuadraticField(5)
     299            sage: OK = K.maximal_order()
     300            sage: OK.krull_dimension()
     301            1
     302            sage: O2 = K.order(2*a)
     303            sage: O2.krull_dimension()
     304            1
     305        """
     306        return ZZ(1)
     307
    294308    def integral_closure(self):
    295309        """
    296310        Return the integral closure of this order.
  • sage/rings/ring.pyx

    diff -r 5e45f3ee796a -r 4f6c26438fae sage/rings/ring.pyx
    a b  
    740740            False
    741741        """
    742742        return True
    743    
     743
    744744    def krull_dimension(self):
    745745        """
    746         Return the Krull dimension if this commutative ring.
     746        Return the Krull dimension of this commutative ring.
    747747
    748748        The Krull dimension is the length of the longest ascending chain
    749749        of prime ideals.
     
    752752        \code{krull_dimension} is not implemented for generic commutative
    753753        rings. Fields and PIDs, with Krull dimension equal to 0 and 1,
    754754        respectively, have naive implementations of \code{krull_dimension}
     755        Orders in number fields also have Krull dimension 1.
    755756            sage: R = CommutativeRing(ZZ)
    756757            sage: R.krull_dimension()
    757758            Traceback (most recent call last):
     
    765766            <type 'sage.rings.ring.CommutativeRing'>
    766767            <class 'sage.rings.rational_field.RationalField'>
    767768            <type 'sage.rings.integer_ring.IntegerRing_class'>
     769
     770            All orders in number fields have Krull dimension 1,
     771            including non-maximal orders:           
     772            sage: K.<i> = QuadraticField(-1)
     773            sage: R = K.maximal_order(); R
     774            Maximal Order in Number Field in i with defining polynomial x^2 + 1
     775            sage: R.krull_dimension()
     776            1
     777            sage: R = K.order(2*i); R
     778            Order in Number Field in i with defining polynomial x^2 + 1
     779            sage: R.is_maximal()
     780            False
     781            sage: R.krull_dimension()
     782            1
    768783        """
    769784        raise NotImplementedError
    770785
     
    10191034            sage: K = NumberField(x^2 + 1, 's')
    10201035            sage: OK = K.ring_of_integers()
    10211036            sage: OK.krull_dimension()
    1022             Traceback (most recent call last):
    1023             ...
    1024             NotImplementedError
     1037            1
    10251038
    10261039        The following are not Dedekind domains but have
    10271040        a \code{krull_dimension} function.
     
    10351048            Multivariate Polynomial Ring in x, y, z over Integer Ring
    10361049            sage: U.krull_dimension()
    10371050            4
     1051
     1052            sage: K.<i> = QuadraticField(-1)
     1053            sage: R = K.order(2*i); R
     1054            Order in Number Field in i with defining polynomial x^2 + 1
     1055            sage: R.is_maximal()
     1056            False
     1057            sage: R.krull_dimension()
     1058            1
    10381059        """
    10391060        return 1
    10401061