Infinite Enumerated Sets#

AUTHORS:

  • Florent Hivert (2009-11): initial revision.

class sage.categories.infinite_enumerated_sets.InfiniteEnumeratedSets(base_category)#

Bases: sage.categories.category_with_axiom.CategoryWithAxiom_singleton

The category of infinite enumerated sets

An infinite enumerated sets is a countable set together with a canonical enumeration of its elements.

EXAMPLES:

sage: InfiniteEnumeratedSets()
Category of infinite enumerated sets
sage: InfiniteEnumeratedSets().super_categories()
[Category of enumerated sets, Category of infinite sets]
sage: InfiniteEnumeratedSets().all_super_categories()
[Category of infinite enumerated sets,
 Category of enumerated sets,
 Category of infinite sets,
 Category of sets,
 Category of sets with partial maps,
 Category of objects]
class ParentMethods#

Bases: object

list()#

Raise an error because self is an infinite enumerated set.

EXAMPLES:

sage: NN = InfiniteEnumeratedSets().example()
sage: NN.list()
Traceback (most recent call last):
...
NotImplementedError: cannot list an infinite set
random_element()#

Raise an error because self is an infinite enumerated set.

EXAMPLES:

sage: NN = InfiniteEnumeratedSets().example()
sage: NN.random_element()
Traceback (most recent call last):
...
NotImplementedError: infinite set

TODO: should this be an optional abstract_method instead?

tuple()#

Raise an error because self is an infinite enumerated set.

EXAMPLES:

sage: NN = InfiniteEnumeratedSets().example()
sage: NN.tuple()
Traceback (most recent call last):
...
NotImplementedError: cannot list an infinite set