This repository has been archived by the owner on Jan 30, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
src/sage/categories/finitely_enumerated_families.py: New
- Loading branch information
Matthias Koeppe
committed
Aug 19, 2022
1 parent
434932f
commit 7569a95
Showing
2 changed files
with
69 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
r""" | ||
Finitely enumerated families | ||
""" | ||
|
||
#***************************************************************************** | ||
# Copyright (C) 2022 Matthias Koeppe | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 2 of the License, or | ||
# (at your option) any later version. | ||
# https://www.gnu.org/licenses/ | ||
#***************************************************************************** | ||
|
||
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.finite_enumerated_sets import FiniteEnumeratedSets | ||
from sage.categories.enumerated_families import EnumeratedFamilies | ||
|
||
|
||
class FinitelyEnumeratedFamilies(Category_singleton): | ||
r""" | ||
The category of finitely enumerated families | ||
An *finitely enumerated family* is an enumerated family whose keys | ||
form a finite enumerated set; this implies that the family is a finite set. | ||
EXAMPLES:: | ||
sage: from sage.categories.enumerated_families import EnumeratedFamilies | ||
sage: from sage.categories.finitely_enumerated_families import FinitelyEnumeratedFamilies | ||
sage: FinitelyEnumeratedFamilies() | ||
Category of finitely enumerated families | ||
sage: FinitelyEnumeratedFamilies() == EnumeratedFamilies() & FiniteSets() | ||
False | ||
sage: F = Family(ZZ, lambda x: x % 7, is_injective=False, category=FiniteSets()) | ||
sage: F in EnumeratedFamilies() & FiniteSets() | ||
True | ||
sage: F in FinitelyEnumeratedFamilies() | ||
False | ||
""" | ||
|
||
def super_categories(self): | ||
r""" | ||
EXAMPLES:: | ||
sage: from sage.categories.finitely_enumerated_families import FinitelyEnumeratedFamilies | ||
sage: FinitelyEnumeratedFamilies().super_categories() | ||
[Category of enumerated families, Category of finite enumerated sets] | ||
""" | ||
return [EnumeratedFamilies(), FiniteEnumeratedSets()] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters