summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTravis Scrimshaw <tscrimsh at umn.edu>2015-10-16 10:53:34 -0500
committerTravis Scrimshaw <tscrimsh at umn.edu>2015-10-16 10:53:34 -0500
commit375ff46221b7dcc101536774664b4bb935f99fba (patch)
treedf9b38fd829809e03a0aaa4a75d8d153e6941e7c
parentReworking the category of manifolds. (diff)
Fixing doctest failures and letting a few other rings know they are metric spaces.
-rw-r--r--src/doc/en/thematic_tutorials/coercion_and_categories.rst2
-rw-r--r--src/doc/en/tutorial/tour_coercion.rst1
-rw-r--r--src/doc/fr/tutorial/tour_coercion.rst1
-rw-r--r--src/doc/pt/tutorial/tour_coercion.rst4
-rw-r--r--src/sage/categories/bimodules.py14
-rw-r--r--src/sage/categories/category.py28
-rw-r--r--src/sage/categories/category_types.py8
-rw-r--r--src/sage/categories/homset.py18
-rw-r--r--src/sage/categories/lie_groups.py25
-rw-r--r--src/sage/categories/map.pyx8
-rw-r--r--src/sage/categories/primer.py8
-rw-r--r--src/sage/matrix/matrix_space.py8
-rw-r--r--src/sage/modules/free_module.py14
-rw-r--r--src/sage/modules/free_module_homspace.py8
-rw-r--r--src/sage/rings/complex_double.pyx15
-rw-r--r--src/sage/rings/complex_field.py2
-rw-r--r--src/sage/rings/integer_ring.pyx3
-rw-r--r--src/sage/rings/polynomial/polynomial_ring.py2
-rw-r--r--src/sage/rings/real_double.pyx15
-rw-r--r--src/sage/rings/ring.pyx9
-rw-r--r--src/sage/structure/category_object.pyx3
-rw-r--r--src/sage/structure/parent.pyx4
-rw-r--r--src/sage/tensor/modules/finite_rank_free_module.py5
-rw-r--r--src/sage/tests/french_book/domaines_doctest.py2
24 files changed, 135 insertions, 72 deletions
diff --git a/src/doc/en/thematic_tutorials/coercion_and_categories.rst b/src/doc/en/thematic_tutorials/coercion_and_categories.rst
index 058b9f4..b6f8e8b 100644
--- a/src/doc/en/thematic_tutorials/coercion_and_categories.rst
+++ b/src/doc/en/thematic_tutorials/coercion_and_categories.rst
@@ -878,7 +878,7 @@ The four axioms requested for coercions
rational field is a homomorphism of euclidean domains::
sage: QQ.coerce_map_from(ZZ).category_for()
- Category of euclidean domains
+ Join of Category of euclidean domains and Category of metric spaces
.. end of output
diff --git a/src/doc/en/tutorial/tour_coercion.rst b/src/doc/en/tutorial/tour_coercion.rst
index 2bbb25d..7f94a0c 100644
--- a/src/doc/en/tutorial/tour_coercion.rst
+++ b/src/doc/en/tutorial/tour_coercion.rst
@@ -118,6 +118,7 @@ implemented in Sage as well:
sage: ZZ.category()
Join of Category of euclidean domains
and Category of infinite enumerated sets
+ and Category of metric spaces
sage: ZZ.category().is_subcategory(Rings())
True
sage: ZZ in Rings()
diff --git a/src/doc/fr/tutorial/tour_coercion.rst b/src/doc/fr/tutorial/tour_coercion.rst
index a032be7..395493b 100644
--- a/src/doc/fr/tutorial/tour_coercion.rst
+++ b/src/doc/fr/tutorial/tour_coercion.rst
@@ -119,6 +119,7 @@ par ailleurs les catégories en tant que telles :
sage: ZZ.category()
Join of Category of euclidean domains
and Category of infinite enumerated sets
+ and Category of metric spaces
sage: ZZ.category().is_subcategory(Rings())
True
sage: ZZ in Rings()
diff --git a/src/doc/pt/tutorial/tour_coercion.rst b/src/doc/pt/tutorial/tour_coercion.rst
index 58ca430..569caee 100644
--- a/src/doc/pt/tutorial/tour_coercion.rst
+++ b/src/doc/pt/tutorial/tour_coercion.rst
@@ -121,7 +121,9 @@ categorias matemáticas também são implementadas no Sage:
sage: Rings()
Category of rings
sage: ZZ.category()
- Join of Category of euclidean domains and Category of infinite enumerated sets
+ Join of Category of euclidean domains
+ and Category of infinite enumerated sets
+ and Category of metric spaces
sage: ZZ.category().is_subcategory(Rings())
True
diff --git a/src/sage/categories/bimodules.py b/src/sage/categories/bimodules.py
index 7971135..f778479 100644
--- a/src/sage/categories/bimodules.py
+++ b/src/sage/categories/bimodules.py
@@ -70,15 +70,21 @@ class Bimodules(CategoryWithParameters):
EXAMPLES::
sage: Bimodules(QQ,ZZ)._make_named_class_key('parent_class')
- (Category of quotient fields,
- Join of Category of euclidean domains and Category of infinite enumerated sets)
+ (Join of Category of quotient fields and Category of metric spaces,
+ Join of Category of euclidean domains
+ and Category of infinite enumerated sets
+ and Category of metric spaces)
+
sage: Bimodules(Fields(), ZZ)._make_named_class_key('element_class')
(Category of fields,
- Join of Category of euclidean domains and Category of infinite enumerated sets)
+ Join of Category of euclidean domains
+ and Category of infinite enumerated sets
+ and Category of metric spaces)
sage: Bimodules(QQ, Rings())._make_named_class_key('element_class')
- (Category of quotient fields, Category of rings)
+ (Join of Category of quotient fields and Category of metric spaces,
+ Category of rings)
sage: Bimodules(Fields(), Rings())._make_named_class_key('element_class')
(Category of fields, Category of rings)
diff --git a/src/sage/categories/category.py b/src/sage/categories/category.py
index a43973e..9df89eb 100644
--- a/src/sage/categories/category.py
+++ b/src/sage/categories/category.py
@@ -35,7 +35,7 @@ Let's request the category of some objects::
sage: V = VectorSpace(RationalField(), 3)
sage: V.category()
- Category of vector spaces with basis over quotient fields
+ Category of vector spaces with basis over (quotient fields and metric spaces)
sage: G = SymmetricGroup(9)
sage: G.category()
Join of Category of finite permutation groups and Category of finite weyl groups
@@ -323,7 +323,8 @@ class Category(UniqueRepresentation, SageObject):
sage: Algebras(GF(5)).parent_class is Algebras(GF(7)).parent_class
True
- sage: Coalgebras(QQ).parent_class is Coalgebras(FractionField(QQ['x'])).parent_class
+ sage: F = FractionField(ZZ['t'])
+ sage: Coalgebras(F).parent_class is Coalgebras(FractionField(F['x'])).parent_class
True
We now construct a parent in the usual way::
@@ -2755,9 +2756,9 @@ class CategoryWithParameters(Category):
Similarly for ``QQ`` and ``RR``::
sage: QQ.category()
- Category of quotient fields
+ Join of Category of quotient fields and Category of metric spaces
sage: RR.category()
- Category of fields
+ Join of Category of fields and Category of complete metric spaces
sage: Modules(QQ).parent_class is Modules(RR).parent_class
False
@@ -2818,14 +2819,17 @@ class CategoryWithParameters(Category):
sage: Algebras(ZZ)._make_named_class_key("parent_class")
Join of Category of euclidean domains
- and Category of infinite enumerated sets
+ and Category of infinite enumerated sets
+ and Category of metric spaces
The morphism class of a bimodule depends only on the category
of the left and right base rings::
sage: Bimodules(QQ, ZZ)._make_named_class_key("morphism_class")
- (Category of quotient fields,
- Join of Category of euclidean domains and Category of infinite enumerated sets)
+ (Join of Category of quotient fields and Category of metric spaces,
+ Join of Category of euclidean domains
+ and Category of infinite enumerated sets
+ and Category of metric spaces)
The element class of a join category depends only on the
element class of its super categories::
@@ -2953,13 +2957,14 @@ class JoinCategory(CategoryWithParameters):
sage: Modules(ZZ)._make_named_class_key('element_class')
Join of Category of euclidean domains
- and Category of infinite enumerated sets
+ and Category of infinite enumerated sets
+ and Category of metric spaces
sage: Modules(QQ)._make_named_class_key('parent_class')
- Category of quotient fields
+ Join of Category of quotient fields and Category of metric spaces
sage: Schemes(Spec(ZZ))._make_named_class_key('parent_class')
Category of schemes
sage: ModularAbelianVarieties(QQ)._make_named_class_key('parent_class')
- Category of quotient fields
+ Join of Category of quotient fields and Category of metric spaces
"""
return tuple(getattr(cat, name) for cat in self._super_categories)
@@ -3005,7 +3010,8 @@ class JoinCategory(CategoryWithParameters):
EXAMPLE::
- sage: QQ['x'].category().is_subcategory(Category.join([Rings(), VectorSpaces(QuotientFields())])) # indirect doctest
+ sage: cat = Category.join([Rings(), VectorSpaces(QuotientFields().Metric())])
+ sage: QQ['x'].category().is_subcategory(cat) # indirect doctest
True
"""
return all(category.is_subcategory(X) for X in self._super_categories)
diff --git a/src/sage/categories/category_types.py b/src/sage/categories/category_types.py
index 21df7cb..08e6552 100644
--- a/src/sage/categories/category_types.py
+++ b/src/sage/categories/category_types.py
@@ -193,13 +193,15 @@ class Category_over_base(CategoryWithParameters):
EXAMPLES::
sage: Modules(ZZ)._make_named_class_key('element_class')
- Join of Category of euclidean domains and Category of infinite enumerated sets
+ Join of Category of euclidean domains
+ and Category of infinite enumerated sets
+ and Category of metric spaces
sage: Modules(QQ)._make_named_class_key('parent_class')
- Category of quotient fields
+ Join of Category of quotient fields and Category of metric spaces
sage: Schemes(Spec(ZZ))._make_named_class_key('parent_class')
Category of schemes
sage: ModularAbelianVarieties(QQ)._make_named_class_key('parent_class')
- Category of quotient fields
+ Join of Category of quotient fields and Category of metric spaces
sage: Algebras(Fields())._make_named_class_key('morphism_class')
Category of fields
"""
diff --git a/src/sage/categories/homset.py b/src/sage/categories/homset.py
index f73d29d..ec17a24 100644
--- a/src/sage/categories/homset.py
+++ b/src/sage/categories/homset.py
@@ -647,7 +647,7 @@ class Homset(Set_generic):
(<function Hom at ...>,
(Vector space of dimension 2 over Rational Field,
Vector space of dimension 3 over Rational Field,
- Category of vector spaces with basis over quotient fields,
+ Category of vector spaces with basis over (quotient fields and metric spaces),
False))
TESTS::
@@ -1164,18 +1164,18 @@ class Homset(Set_generic):
sage: H = Hom(ZZ^2, ZZ^3); H
Set of Morphisms from Ambient free module of rank 2 over
- the principal ideal domain Integer Ring to Ambient free
- module of rank 3 over the principal ideal domain Integer
- Ring in Category of modules with basis over (euclidean
- domains and infinite enumerated sets)
+ the principal ideal domain Integer Ring to Ambient free module
+ of rank 3 over the principal ideal domain Integer Ring
+ in Category of modules with basis over (euclidean domains and
+ infinite enumerated sets and metric spaces)
sage: type(H)
<class 'sage.modules.free_module_homspace.FreeModuleHomspace_with_category'>
sage: H.reversed()
Set of Morphisms from Ambient free module of rank 3 over
- the principal ideal domain Integer Ring to Ambient free
- module of rank 2 over the principal ideal domain Integer
- Ring in Category of modules with basis over (euclidean
- domains and infinite enumerated sets)
+ the principal ideal domain Integer Ring to Ambient free
+ module of rank 2 over the principal ideal domain Integer Ring
+ in Category of modules with basis over (euclidean domains and
+ infinite enumerated sets and metric spaces)
sage: type(H.reversed())
<class 'sage.modules.free_module_homspace.FreeModuleHomspace_with_category'>
"""
diff --git a/src/sage/categories/lie_groups.py b/src/sage/categories/lie_groups.py
index cbb6571..3883822 100644
--- a/src/sage/categories/lie_groups.py
+++ b/src/sage/categories/lie_groups.py
@@ -10,11 +10,11 @@ Lie Groups
#from sage.misc.abstract_method import abstract_method
from sage.misc.cachefunc import cached_method
-from sage.categories.category_singleton import Category_singleton
+from sage.categories.category_types import Category_over_base_ring
from sage.categories.groups import Groups
from sage.categories.manifolds import Manifolds
-class LieGroups(Category_singleton):
+class LieGroups(Category_over_base_ring):
r"""
The category of Lie groups.
@@ -23,12 +23,12 @@ class LieGroups(Category_singleton):
EXAMPLES::
sage: from sage.categories.lie_groups import LieGroups
- sage: C = LieGroups(); C
- Category of Lie groups
+ sage: C = LieGroups(QQ); C
+ Category of Lie groups over Rational Field
TESTS::
- sage: TestSuite(C).run()
+ sage: TestSuite(C).run(skip="_test_category_over_bases")
"""
@cached_method
def super_categories(self):
@@ -36,10 +36,11 @@ class LieGroups(Category_singleton):
EXAMPLES::
sage: from sage.categories.lie_groups import LieGroups
- sage: LieGroups().super_categories()
- [Category of topological groups, Category of smooth real manifolds]
+ sage: LieGroups(QQ).super_categories()
+ [Category of topological groups,
+ Category of smooth manifolds over Rational Field]
"""
- return [Groups().Topological(), Manifolds().Real().Smooth()]
+ return [Groups().Topological(), Manifolds(self.base()).Smooth()]
def additional_structure(self):
r"""
@@ -54,7 +55,7 @@ class LieGroups(Category_singleton):
EXAMPLES::
sage: from sage.categories.lie_groups import LieGroups
- sage: LieGroups().additional_structure()
+ sage: LieGroups(QQ).additional_structure()
"""
return None
@@ -64,8 +65,8 @@ class LieGroups(Category_singleton):
EXAMPLES::
sage: from sage.categories.lie_groups import LieGroups
- sage: LieGroups() # indirect doctest
- Category of Lie groups
+ sage: LieGroups(QQ) # indirect doctest
+ Category of Lie groups over Rational Field
"""
- return "Lie groups"
+ return "Lie groups over {}".format(self.base_ring())
diff --git a/src/sage/categories/map.pyx b/src/sage/categories/map.pyx
index 499b1b2..00fc6ec 100644
--- a/src/sage/categories/map.pyx
+++ b/src/sage/categories/map.pyx
@@ -628,9 +628,13 @@ cdef class Map(Element):
sage: R.<x,y> = QQ[]
sage: f = R.hom([x+y, x-y], R)
sage: f.category_for()
- Join of Category of unique factorization domains and Category of commutative algebras over quotient fields
+ Join of Category of unique factorization domains
+ and Category of commutative algebras over (quotient fields and metric spaces)
sage: f.category()
- Category of endsets of unital magmas and right modules over quotient fields and left modules over quotient fields
+ Category of endsets of unital magmas
+ and right modules over (quotient fields and metric spaces)
+ and left modules over (quotient fields and metric spaces)
+
FIXME: find a better name for this method
"""
diff --git a/src/sage/categories/primer.py b/src/sage/categories/primer.py
index b8c70db..5e32c54 100644
--- a/src/sage/categories/primer.py
+++ b/src/sage/categories/primer.py
@@ -348,9 +348,12 @@ categories and their super categories::
sage: ZZ.category()
Join of Category of euclidean domains
and Category of infinite enumerated sets
+ and Category of metric spaces
sage: ZZ.categories()
- [Join of Category of euclidean domains and Category of infinite enumerated sets,
+ [Join of Category of euclidean domains
+ and Category of infinite enumerated sets
+ and Category of metric spaces,
Category of euclidean domains, Category of principal ideal domains,
Category of unique factorization domains, Category of gcd domains,
Category of integral domains, Category of domains,
@@ -360,7 +363,8 @@ categories and their super categories::
Category of commutative magmas, Category of unital magmas, Category of magmas,
Category of commutative additive groups, ..., Category of additive magmas,
Category of infinite enumerated sets, Category of enumerated sets,
- Category of infinite sets, Category of sets,
+ Category of infinite sets, Category of metric spaces,
+ Category of topological spaces, Category of sets,
Category of sets with partial maps,
Category of objects]
diff --git a/src/sage/matrix/matrix_space.py b/src/sage/matrix/matrix_space.py
index 5856948..6336b8e 100644
--- a/src/sage/matrix/matrix_space.py
+++ b/src/sage/matrix/matrix_space.py
@@ -118,11 +118,13 @@ class MatrixSpace(UniqueRepresentation, parent_gens.ParentWithGens):
sage: MatrixSpace(ZZ,10,5)
Full MatrixSpace of 10 by 5 dense matrices over Integer Ring
sage: MatrixSpace(ZZ,10,5).category()
- Category of infinite modules over (euclidean domains and infinite enumerated sets)
+ Category of infinite modules over (euclidean domains
+ and infinite enumerated sets and metric spaces)
sage: MatrixSpace(ZZ,10,10).category()
- Category of infinite algebras over (euclidean domains and infinite enumerated sets)
+ Category of infinite algebras over (euclidean domains
+ and infinite enumerated sets and metric spaces)
sage: MatrixSpace(QQ,10).category()
- Category of infinite algebras over quotient fields
+ Category of infinite algebras over (quotient fields and metric spaces)
TESTS::
diff --git a/src/sage/modules/free_module.py b/src/sage/modules/free_module.py
index 85db5e9..c4c73db 100644
--- a/src/sage/modules/free_module.py
+++ b/src/sage/modules/free_module.py
@@ -686,14 +686,15 @@ class FreeModule_generic(Module):
Category of vector spaces with basis over (finite fields
and subquotients of monoids and quotients of semigroups)
sage: V = QQ^4; V.category()
- Category of vector spaces with basis over quotient fields
+ Category of vector spaces with basis over (quotient fields and metric spaces)
sage: V = GF(5)**20; V.category()
Category of vector spaces with basis over (finite fields
and subquotients of monoids and quotients of semigroups)
sage: FreeModule(ZZ,3).category()
- Category of modules with basis over (euclidean domains and infinite enumerated sets)
+ Category of modules with basis over (euclidean domains
+ and infinite enumerated sets and metric spaces)
sage: (QQ^0).category()
- Category of vector spaces with basis over quotient fields
+ Category of vector spaces with basis over (quotient fields and metric spaces)
TESTS::
@@ -3067,10 +3068,9 @@ class FreeModule_generic_field(FreeModule_generic_pid):
sage: type(H)
<class 'sage.modules.free_module_homspace.FreeModuleHomspace_with_category'>
sage: H
- Set of Morphisms from Vector space of dimension 2 over
- Rational Field to Ambient free module of rank 3 over the
- principal ideal domain Integer Ring in Category of vector
- spaces with basis over quotient fields
+ Set of Morphisms from Vector space of dimension 2 over Rational Field
+ to Ambient free module of rank 3 over the principal ideal domain Integer Ring
+ in Category of vector spaces with basis over (quotient fields and metric spaces)
"""
if Y.base_ring().is_field():
import vector_space_homspace
diff --git a/src/sage/modules/free_module_homspace.py b/src/sage/modules/free_module_homspace.py
index 5d674f3..4245f0c 100644
--- a/src/sage/modules/free_module_homspace.py
+++ b/src/sage/modules/free_module_homspace.py
@@ -28,10 +28,10 @@ compute a basis.
sage: H = Hom(V3,V2)
sage: H
Set of Morphisms from Ambient free module of rank 3 over the
- principal ideal domain Integer Ring to Ambient free module
- of rank 2 over the principal ideal domain Integer Ring in
- Category of modules with basis over (euclidean domains and
- infinite enumerated sets)
+ principal ideal domain Integer Ring to Ambient free module of rank 2
+ over the principal ideal domain Integer Ring in
+ Category of modules with basis over (euclidean domains
+ and infinite enumerated sets and metric spaces)
sage: B = H.basis()
sage: len(B)
6
diff --git a/src/sage/rings/complex_double.pyx b/src/sage/rings/complex_double.pyx
index 2dbd9b8..7454a54 100644
--- a/src/sage/rings/complex_double.pyx
+++ b/src/sage/rings/complex_double.pyx
@@ -151,7 +151,7 @@ cdef class ComplexDoubleField_class(sage.rings.ring.Field):
(-1.0, -1.0 + 1.2246...e-16*I, False)
"""
from sage.categories.fields import Fields
- ParentWithGens.__init__(self, self, ('I',), normalize=False, category = Fields())
+ ParentWithGens.__init__(self, self, ('I',), normalize=False, category=Fields().Metric().Complete())
self._populate_coercion_lists_()
def __reduce__(self):
@@ -199,6 +199,19 @@ cdef class ComplexDoubleField_class(sage.rings.ring.Field):
return 561162115
#return hash(self.str())
+ def dist(self, a, b):
+ """
+ Return the distance between ``a`` and ``b``.
+
+ EXAMPLES::
+
+ sage: CDF.dist(3, 2)
+ 1.0
+ sage: CDF.dist(-1, I)
+ 1.4142135623730951
+ """
+ return (self(a) - self(b)).abs()
+
def characteristic(self):
"""
Return the characteristic of the complex double field, which is 0.
diff --git a/src/sage/rings/complex_field.py b/src/sage/rings/complex_field.py
index 0f786b5..9f5765a 100644
--- a/src/sage/rings/complex_field.py
+++ b/src/sage/rings/complex_field.py
@@ -198,7 +198,7 @@ class ComplexField_class(ring.Field):
sage: C = ComplexField(200)
sage: C.category()
- Category of fields
+ Join of Category of fields and Category of complete metric spaces
sage: TestSuite(C).run()
"""
self._prec = int(prec)
diff --git a/src/sage/rings/integer_ring.pyx b/src/sage/rings/integer_ring.pyx
index bbafd60..6fed18f 100644
--- a/src/sage/rings/integer_ring.pyx
+++ b/src/sage/rings/integer_ring.pyx
@@ -122,7 +122,8 @@ cdef class IntegerRing_class(PrincipalIdealDomain):
False
sage: Z.category()
Join of Category of euclidean domains
- and Category of infinite enumerated sets
+ and Category of infinite enumerated sets
+ and Category of metric spaces
sage: Z(2^(2^5) + 1)
4294967297
diff --git a/src/sage/rings/polynomial/polynomial_ring.py b/src/sage/rings/polynomial/polynomial_ring.py
index e0d2d4f..9c469c9 100644
--- a/src/sage/rings/polynomial/polynomial_ring.py
+++ b/src/sage/rings/polynomial/polynomial_ring.py
@@ -268,7 +268,7 @@ class PolynomialRing_general(sage.algebras.algebra.Algebra):
sage: category(ZZ['x'])
Join of Category of unique factorization domains
and Category of commutative algebras over
- (euclidean domains and infinite enumerated sets)
+ (euclidean domains and infinite enumerated sets and metric spaces)
sage: category(GF(7)['x'])
Join of Category of euclidean domains and
Category of commutative algebras over (finite fields and
diff --git a/src/sage/rings/real_double.pyx b/src/sage/rings/real_double.pyx
index e6ec3df..8211108 100644
--- a/src/sage/rings/real_double.pyx
+++ b/src/sage/rings/real_double.pyx
@@ -140,7 +140,7 @@ cdef class RealDoubleField_class(Field):
sage: TestSuite(R).run()
"""
from sage.categories.fields import Fields
- Field.__init__(self, self, category = Fields())
+ Field.__init__(self, self, category=Fields().Metric().Complete())
self._populate_coercion_lists_(element_constructor=RealDoubleElement,
init_no_parent=True,
convert_method_name='_real_double_')
@@ -236,6 +236,19 @@ cdef class RealDoubleField_class(Field):
return 0
return cmp(type(self), type(x))
+ def dist(self, a, b):
+ """
+ Return the distance between ``a`` and ``b`` in ``self``.
+
+ EXAMPLES::
+
+ sage: RDF.dist(5, 1/2)
+ 4.5
+ sage: RDF.dist(-1, 1/2)
+ 1.5
+ """
+ return (self(a) - self(b)).abs()
+
def construction(self):
r"""
Returns the functorial construction of ``self``, namely, completion of
diff --git a/src/sage/rings/ring.pyx b/src/sage/rings/ring.pyx
index 7d84ca3..d3b779c 100644
--- a/src/sage/rings/ring.pyx
+++ b/src/sage/rings/ring.pyx
@@ -134,11 +134,14 @@ cdef class Ring(ParentWithGens):
Test agaings another bug fixed in :trac:`9944`::
sage: QQ['x'].category()
- Join of Category of euclidean domains and Category of commutative algebras over quotient fields
+ Join of Category of euclidean domains
+ and Category of commutative algebras over (quotient fields and metric spaces)
sage: QQ['x','y'].category()
- Join of Category of unique factorization domains and Category of commutative algebras over quotient fields
+ Join of Category of unique factorization domains
+ and Category of commutative algebras over (quotient fields and metric spaces)
sage: PolynomialRing(MatrixSpace(QQ,2),'x').category()
- Category of algebras over (algebras over quotient fields and infinite sets)
+ Category of algebras over (algebras over
+ (quotient fields and metric spaces) and infinite sets)
sage: PolynomialRing(SteenrodAlgebra(2),'x').category()
Category of algebras over graded hopf algebras with basis over Finite Field of size 2
diff --git a/src/sage/structure/category_object.pyx b/src/sage/structure/category_object.pyx
index be78efc..405ff0d 100644
--- a/src/sage/structure/category_object.pyx
+++ b/src/sage/structure/category_object.pyx
@@ -235,7 +235,8 @@ cdef class CategoryObject(sage_object.SageObject):
sage: ZZ.categories()
[Join of Category of euclidean domains
- and Category of infinite enumerated sets,
+ and Category of infinite enumerated sets
+ and Category of metric spaces,
Category of euclidean domains,
Category of principal ideal domains,
Category of unique factorization domains,
diff --git a/src/sage/structure/parent.pyx b/src/sage/structure/parent.pyx
index 1936d2b..fd20d2e 100644
--- a/src/sage/structure/parent.pyx
+++ b/src/sage/structure/parent.pyx
@@ -805,6 +805,7 @@ cdef class Parent(category_object.CategoryObject):
running ._test_eq() . . . pass
running ._test_euclidean_degree() . . . pass
running ._test_gcd_vs_xgcd() . . . pass
+ running ._test_metric() . . . pass
running ._test_not_implemented_methods() . . . pass
running ._test_one() . . . pass
running ._test_pickling() . . . pass
@@ -875,6 +876,7 @@ cdef class Parent(category_object.CategoryObject):
_test_eq
_test_euclidean_degree
_test_gcd_vs_xgcd
+ _test_metric
_test_not_implemented_methods
_test_one
_test_pickling
@@ -1117,7 +1119,7 @@ cdef class Parent(category_object.CategoryObject):
it is a ring, from the point of view of categories::
sage: MS.category()
- Category of infinite algebras over quotient fields
+ Category of infinite algebras over (quotient fields and metric spaces)
sage: MS in Rings()
True
diff --git a/src/sage/tensor/modules/finite_rank_free_module.py b/src/sage/tensor/modules/finite_rank_free_module.py
index 8fbe841..a06ec2b 100644
--- a/src/sage/tensor/modules/finite_rank_free_module.py
+++ b/src/sage/tensor/modules/finite_rank_free_module.py
@@ -243,7 +243,8 @@ This is also revealed by the category of each module::
sage: M.category()
Category of modules over Integer Ring
sage: N.category()
- Category of modules with basis over (euclidean domains and infinite enumerated sets)
+ Category of modules with basis over (euclidean domains
+ and infinite enumerated sets and metric spaces)
In other words, the module created by ``FreeModule`` is actually `\ZZ^3`,
while, in the absence of any distinguished basis, no *canonical* isomorphism
@@ -367,7 +368,7 @@ created by ``VectorSpace`` is actually a Cartesian power of the base field::
sage: V = VectorSpace(QQ,3) ; V
Vector space of dimension 3 over Rational Field
sage: V.category()
- Category of vector spaces with basis over quotient fields
+ Category of vector spaces with basis over (quotient fields and metric spaces)
sage: V is QQ^3
True
sage: V.basis()
diff --git a/src/sage/tests/french_book/domaines_doctest.py b/src/sage/tests/french_book/domaines_doctest.py
index f8a15b8..4628ffd 100644
--- a/src/sage/tests/french_book/domaines_doctest.py
+++ b/src/sage/tests/french_book/domaines_doctest.py
@@ -174,7 +174,7 @@ Sage example in ./domaines.tex, line 383::
Sage example in ./domaines.tex, line 415::
sage: QQ.category()
- Category of quotient fields
+ Join of Category of quotient fields and Category of metric spaces
Sage example in ./domaines.tex, line 421::