Infinite Enumerated Sets

AUTHORS:

  • Florent Hivert (2009-11): initial revision.
class sage.categories.infinite_enumerated_sets.InfiniteEnumeratedSets(s=None)

Bases: sage.categories.category_singleton.Category_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]
sage: InfiniteEnumeratedSets().all_super_categories()
[Category of infinite enumerated sets,
 Category of enumerated sets,
 Category of sets,
 Category of sets with partial maps,
 Category of objects]

TESTS:

sage: C = InfiniteEnumeratedSets()
sage: TestSuite(C).run()
class ParentMethods
cardinality()

Counts the elements of the enumerated set.

EXAMPLES:

sage: NN = InfiniteEnumeratedSets().example()
sage: NN.cardinality()
+Infinity
is_finite()

Returns False since self is not finite.

EXAMPLES:

sage: C = InfiniteEnumeratedSets().example()
sage: C.is_finite()
False
list()

Returns an error since self is an infinite enumerated set.

EXAMPLES:

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

Returns an error since 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?

InfiniteEnumeratedSets.super_categories()

EXAMPLES:

sage: InfiniteEnumeratedSets().super_categories()
[Category of enumerated sets]

Previous topic

Hopf algebras with basis

Next topic

Integral domains

This Page