# 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
|
|
290 | 290 | """ |
291 | 291 | return self.is_maximal() |
292 | 292 | |
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 | |
294 | 308 | def integral_closure(self): |
295 | 309 | """ |
296 | 310 | Return the integral closure of this order. |
diff -r 5e45f3ee796a -r 4f6c26438fae sage/rings/ring.pyx
a
|
b
|
|
740 | 740 | False |
741 | 741 | """ |
742 | 742 | return True |
743 | | |
| 743 | |
744 | 744 | def krull_dimension(self): |
745 | 745 | """ |
746 | | Return the Krull dimension if this commutative ring. |
| 746 | Return the Krull dimension of this commutative ring. |
747 | 747 | |
748 | 748 | The Krull dimension is the length of the longest ascending chain |
749 | 749 | of prime ideals. |
… |
… |
|
752 | 752 | \code{krull_dimension} is not implemented for generic commutative |
753 | 753 | rings. Fields and PIDs, with Krull dimension equal to 0 and 1, |
754 | 754 | respectively, have naive implementations of \code{krull_dimension} |
| 755 | Orders in number fields also have Krull dimension 1. |
755 | 756 | sage: R = CommutativeRing(ZZ) |
756 | 757 | sage: R.krull_dimension() |
757 | 758 | Traceback (most recent call last): |
… |
… |
|
765 | 766 | <type 'sage.rings.ring.CommutativeRing'> |
766 | 767 | <class 'sage.rings.rational_field.RationalField'> |
767 | 768 | <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 |
768 | 783 | """ |
769 | 784 | raise NotImplementedError |
770 | 785 | |
… |
… |
|
1019 | 1034 | sage: K = NumberField(x^2 + 1, 's') |
1020 | 1035 | sage: OK = K.ring_of_integers() |
1021 | 1036 | sage: OK.krull_dimension() |
1022 | | Traceback (most recent call last): |
1023 | | ... |
1024 | | NotImplementedError |
| 1037 | 1 |
1025 | 1038 | |
1026 | 1039 | The following are not Dedekind domains but have |
1027 | 1040 | a \code{krull_dimension} function. |
… |
… |
|
1035 | 1048 | Multivariate Polynomial Ring in x, y, z over Integer Ring |
1036 | 1049 | sage: U.krull_dimension() |
1037 | 1050 | 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 |
1038 | 1059 | """ |
1039 | 1060 | return 1 |
1040 | 1061 | |