Dear all,
For parents in the category `Set`, sage has a method `construction`, which yields either None, or a functor F and a parent R, such that F(R) yields the original parent, see below for the docstring.
Many parents implement a method `change_ring`, which returns the parent with the base ring replaced. For example:
sage: R.<x> = QQ[]
sage: R.change_ring(ZZ)
Univariate Polynomial Ring in x over Integer Ring
What I wonder: shouldn't `change_ring` be also a parent method in some category, e.g. in Category_over_base_ring, which defaults to
def change_ring(self, R):
c = self.construction()
if c is None:
raise NotImplementedError
return c[0](R)
Martin
Signature: Sets.ParentMethods.construction(self)
Docstring:
Return a pair "(functor, parent)" such that "functor(parent)"
returns "self". If "self" does not have a functorial construction,
return "None".
EXAMPLES:
sage: QQ.construction()
(FractionField, Integer Ring)
sage: f, R = QQ['x'].construction()
sage: f
Poly[x]
sage: R
Rational Field
sage: f(R)
Univariate Polynomial Ring in x over Rational Field