# Ticket #9821: trace_9821-replacement.patch

File trace_9821-replacement.patch, 3.5 KB (added by fwclarke, 11 years ago)

replaces previous patch

• ## sage/rings/polynomial/infinite_polynomial_ring.py

```# HG changeset patch
# User Francis Clarke <F.Clarke@Swansea.ac.uk>
# Date 1283285886 -3600
# Node ID 190abf64d492cccba5bec07b63b2ac8c852c1650
# Parent  5b338f2e484f2065d3d30d47bc204d6e9ed13d12
#9821: fix is_field and is_integral_domain for infinite polynomial rings

diff -r 5b338f2e484f -r 190abf64d492 sage/rings/polynomial/infinite_polynomial_ring.py```
 a """ return False def is_field(self,**kwds): """ Since Infinite Polynomial Rings must have at least one generator, they have infinitely many variables and thus never are fields. TESTS:: sage: R = InfinitePolynomialRing(GF(2)) sage: R Infinite polynomial ring in x over Finite Field of size 2 sage: R.is_field() False """ return False ## Auxiliary function for variable comparison def varname_cmp(self,x,y): """ """ return self._base.characteristic() def is_field(self): def is_field(self, proof=True): """ Return ``False``, since an infinite polynomial ring has at least one generator, hence, infinitely many variables. """ return False def is_integral_domain(self): def is_integral_domain(self, proof=True): """ An infinite polynomial ring is an integral domain if and only if the base ring is. sage: R. = InfinitePolynomialRing(QQ) sage: R.is_integral_domain() True The proof parameter is passed to the base ring:: sage: R. = ZZ[] sage: InfinitePolynomialRing(R.quo(a)).is_integral_domain() Traceback (most recent call last): ... NotImplementedError sage: InfinitePolynomialRing(R.quo(a)).is_integral_domain(proof=False) False """ return self._base.is_integral_domain() return self._base.is_integral_domain(proof=proof) def is_noetherian(self): """
• ## sage/rings/quotient_ring.py

`diff -r 5b338f2e484f -r 190abf64d492 sage/rings/quotient_ring.py`
 a domain, of if Sage is unable to determine the answer. EXAMPLES:: sage: R = Integers(8) sage: R.is_integral_domain() False sage: R. = QQ[] sage: R.quo(x^2 - y).is_integral_domain() True sage: R. = ZZ['a','b','c'] sage: I = R.ideal(a,b) sage: Q = R.quotient_ring(I) Traceback (most recent call last): ... NotImplementedError sage: Q.is_integral_domain(proof=False) False """ if proof: return self.defining_ideal().is_prime() else: try: return self.defining_ideal.is_prime() return self.defining_ideal().is_prime() except AttributeError: return False except NotImplementedError: