22
22
from sage .rings .integer import Integer
23
23
from sage .structure .unique_representation import UniqueRepresentation
24
24
from sage .categories .sets_cat import Sets , EmptySetError
25
- from sage .categories .finite_monoids import FiniteMonoids
26
- from sage .categories .finite_enumerated_sets import FiniteEnumeratedSets
25
+ from sage .categories .monoids import Monoids
26
+ from sage .categories .enumerated_sets import EnumeratedSets
27
27
from sage .sets .finite_enumerated_set import FiniteEnumeratedSet
28
28
from sage .combinat .cartesian_product import CartesianProduct
29
29
from sage .sets .integer_range import IntegerRange
@@ -117,7 +117,7 @@ class FiniteSetMaps(UniqueRepresentation, Parent):
117
117
This makes `M` into a monoid::
118
118
119
119
sage: M.category()
120
- Category of finite monoids
120
+ Join of Category of finite monoids and Category of finite enumerated sets
121
121
sage: M.one()
122
122
map: 1 -> 1, 2 -> 2, 3 -> 3
123
123
@@ -216,7 +216,7 @@ class FiniteSetMaps_MN(FiniteSetMaps):
216
216
217
217
- ``category`` -- the category in which the sets of maps is
218
218
constructed. It must be a sub-category of
219
- ``FiniteEnumeratedSets ()`` which is the default value.
219
+ ``EnumeratedSets().Finite ()`` which is the default value.
220
220
"""
221
221
222
222
def __init__ (self , m , n , category = None ):
@@ -231,7 +231,7 @@ def __init__(self, m, n, category=None):
231
231
sage: TestSuite(M).run()
232
232
"""
233
233
Parent .__init__ (self ,
234
- category = FiniteEnumeratedSets ().or_subcategory (category ))
234
+ category = EnumeratedSets (). Finite ().or_subcategory (category ))
235
235
self ._m = Integer (m )
236
236
self ._n = Integer (n )
237
237
@@ -378,8 +378,8 @@ class FiniteSetMaps_Set(FiniteSetMaps_MN):
378
378
- ``codomain`` -- an object in the category ``FiniteSets()``.
379
379
380
380
- ``category`` -- the category in which the sets of maps is
381
- constructed. It must be a sub-category of ``FiniteEnumeratedSets()``
382
- which is the default value.
381
+ constructed. It must be a sub-category of
382
+ ``EnumeratedSets().Finite`` which is the default value.
383
383
"""
384
384
def __init__ (self , domain , codomain , category = None ):
385
385
"""
@@ -488,8 +488,8 @@ class FiniteSetEndoMaps_N(FiniteSetMaps_MN):
488
488
- ``n`` -- an integer.
489
489
490
490
- ``category`` -- the category in which the sets of maps is
491
- constructed. It must be a sub-category of ``FiniteMonoids ()``
492
- which is the default value.
491
+ constructed. It must be a sub-category of ``Monoids().Finite ()``
492
+ and ``EnumeratedSets().Finite()`` which is the default value.
493
493
"""
494
494
495
495
def __init__ (self , n , action , category = None ):
@@ -498,14 +498,13 @@ def __init__(self, n, action, category=None):
498
498
499
499
sage: M = FiniteSetMaps(3)
500
500
sage: M.category()
501
- Category of finite monoids
501
+ Join of Category of finite monoids and Category of finite enumerated sets
502
502
sage: M.__class__
503
503
<class 'sage.sets.finite_set_maps.FiniteSetEndoMaps_N_with_category'>
504
504
sage: TestSuite(M).run()
505
505
"""
506
- Parent .__init__ (self , category = FiniteMonoids ().or_subcategory (category ))
507
- self ._m = n
508
- self ._n = n
506
+ category = (EnumeratedSets () & Monoids ().Finite ()).or_subcategory (category )
507
+ FiniteSetMaps_MN .__init__ (self , n , n , category = category )
509
508
self ._action = action
510
509
511
510
@cached_method
@@ -554,22 +553,23 @@ class FiniteSetEndoMaps_Set(FiniteSetMaps_Set, FiniteSetEndoMaps_N):
554
553
- ``domain`` -- an object in the category ``FiniteSets()``.
555
554
556
555
- ``category`` -- the category in which the sets of maps is
557
- constructed. It must be a sub-category of ``FiniteMonoids ()``
558
- which is the default value.
556
+ constructed. It must be a sub-category of ``Monoids().Finite ()``
557
+ and ``EnumeratedSets().Finite()`` which is the default value.
559
558
"""
560
559
def __init__ (self , domain , action , category = None ):
561
560
"""
562
561
TESTS::
563
562
564
563
sage: M = FiniteSetMaps(["a", "b", "c"])
565
564
sage: M.category()
566
- Category of finite monoids
565
+ Join of Category of finite monoids and Category of finite enumerated sets
567
566
sage: M.__class__
568
567
<class 'sage.sets.finite_set_maps.FiniteSetEndoMaps_Set_with_category'>
569
568
sage: TestSuite(M).run()
570
569
"""
570
+ category = (EnumeratedSets () & Monoids ().Finite ()).or_subcategory (category )
571
571
FiniteSetMaps_MN .__init__ (self , domain .cardinality (), domain .cardinality (),
572
- category = FiniteMonoids (). or_subcategory ( category ) )
572
+ category = category )
573
573
574
574
self ._domain = domain
575
575
self ._codomain = domain
0 commit comments