Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/sage/categories/category_with_axiom.py
Original file line number Diff line number Diff line change
Expand Up @@ -1689,6 +1689,7 @@ class ``Sets.Finite``), or in a separate file (typically in a class
"Commutative", "Cocommutative", "Associative",
"Inverse", "Unital", "Division", "NoZeroDivisors", "Cellular",
"AdditiveCommutative", "AdditiveAssociative", "AdditiveInverse", "AdditiveUnital",
"Bounded",
"Extremal", "Trim", "Semidistributive", "CongruenceUniform",
"Distributive", "Stone",
"Endset",
Expand Down
22 changes: 20 additions & 2 deletions src/sage/categories/finite_lattice_posets.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
# *****************************************************************************

from sage.categories.category_with_axiom import CategoryWithAxiom
from sage.categories.posets import Posets
from sage.misc.cachefunc import cached_method


class FiniteLatticePosets(CategoryWithAxiom):
Expand All @@ -19,9 +21,11 @@ class FiniteLatticePosets(CategoryWithAxiom):
EXAMPLES::

sage: FiniteLatticePosets()
Category of finite lattice posets
Category of finite bounded lattice posets
sage: FiniteLatticePosets().super_categories()
[Category of lattice posets, Category of finite posets]
[Category of lattice posets,
Category of finite posets,
Category of bounded posets]
sage: FiniteLatticePosets().example()
NotImplemented

Expand All @@ -37,6 +41,20 @@ class FiniteLatticePosets(CategoryWithAxiom):
True
sage: TestSuite(C).run()
"""
@cached_method
def extra_super_categories(self):
r"""
Return a list of the (immediate) super categories of
``self``, as per :meth:`Category.super_categories`.

EXAMPLES::

sage: FiniteLatticePosets().super_categories()
[Category of lattice posets,
Category of finite posets,
Category of bounded posets]
"""
return [Posets().Bounded()]

class ParentMethods:

Expand Down
32 changes: 16 additions & 16 deletions src/sage/categories/lattice_posets.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,10 @@ class Extremal(CategoryWithAxiom):
EXAMPLES::

sage: cat = FiniteLatticePosets().Extremal(); cat
Category of finite extremal lattice posets
Category of finite bounded extremal lattice posets

sage: cat.super_categories()
[Category of finite lattice posets,
[Category of finite bounded lattice posets,
Category of extremal lattice posets]
"""
class ParentMethods:
Expand All @@ -226,9 +226,9 @@ class Trim(CategoryWithAxiom):
EXAMPLES::

sage: cat = FiniteLatticePosets().Trim(); cat
Category of finite trim lattice posets
Category of finite bounded trim lattice posets
sage: cat.super_categories()
[Category of finite lattice posets,
[Category of finite bounded lattice posets,
Category of trim lattice posets]
"""
@cached_method
Expand All @@ -241,7 +241,7 @@ def extra_super_categories(self):
EXAMPLES::

sage: FiniteLatticePosets().Trim().super_categories()
[Category of finite lattice posets,
[Category of finite bounded lattice posets,
Category of trim lattice posets]
"""
return [LatticePosets().Extremal()]
Expand All @@ -265,10 +265,10 @@ class Semidistributive(CategoryWithAxiom):
EXAMPLES::

sage: cat = FiniteLatticePosets().Semidistributive(); cat
Category of finite semidistributive lattice posets
Category of finite bounded semidistributive lattice posets

sage: cat.super_categories()
[Category of finite lattice posets,
[Category of finite bounded lattice posets,
Category of semidistributive lattice posets]
"""
class ParentMethods:
Expand All @@ -290,9 +290,9 @@ class CongruenceUniform(CategoryWithAxiom):
EXAMPLES::

sage: cat = FiniteLatticePosets().CongruenceUniform(); cat
Category of finite congruence uniform lattice posets
Category of finite bounded congruence uniform lattice posets
sage: cat.super_categories()
[Category of finite lattice posets,
[Category of finite bounded lattice posets,
Category of congruence uniform lattice posets]
"""
@cached_method
Expand All @@ -305,7 +305,7 @@ def extra_super_categories(self):
EXAMPLES::

sage: FiniteLatticePosets().CongruenceUniform().super_categories()
[Category of finite lattice posets,
[Category of finite bounded lattice posets,
Category of congruence uniform lattice posets]
"""
return [LatticePosets().Semidistributive()]
Expand All @@ -329,10 +329,10 @@ class Distributive(CategoryWithAxiom):
EXAMPLES::

sage: cat = FiniteLatticePosets().Distributive(); cat
Category of finite distributive lattice posets
Category of finite bounded distributive lattice posets

sage: cat.super_categories()
[Category of finite lattice posets,
[Category of finite bounded lattice posets,
Category of distributive lattice posets]
"""
@cached_method
Expand All @@ -345,7 +345,7 @@ def extra_super_categories(self):
EXAMPLES::

sage: FiniteLatticePosets().Distributive().super_categories()
[Category of finite lattice posets,
[Category of finite bounded lattice posets,
Category of distributive lattice posets]
"""
return [LatticePosets().Trim(),
Expand All @@ -371,10 +371,10 @@ class Stone(CategoryWithAxiom):
EXAMPLES::

sage: cat = FiniteLatticePosets().Stone(); cat
Category of finite stone lattice posets
Category of finite bounded stone lattice posets

sage: cat.super_categories()
[Category of finite lattice posets,
[Category of finite bounded lattice posets,
Category of stone lattice posets]
"""
@cached_method
Expand All @@ -387,7 +387,7 @@ def extra_super_categories(self):
EXAMPLES::

sage: FiniteLatticePosets().Stone().super_categories()
[Category of finite lattice posets,
[Category of finite bounded lattice posets,
Category of stone lattice posets]
"""
return [LatticePosets().Distributive()]
Expand Down
39 changes: 39 additions & 0 deletions src/sage/categories/posets.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from sage.misc.abstract_method import abstract_method
from sage.misc.lazy_import import LazyImport
from sage.categories.category import Category
from sage.categories.category_with_axiom import CategoryWithAxiom
from sage.categories.sets_cat import Sets


Expand Down Expand Up @@ -719,3 +720,41 @@ class ElementMethods:
# sage: x <= y
# """
# return self.parent().le(self, other)

class SubcategoryMethods:
def Bounded(self):
r"""
A bounded poset is a poset with a unique maximal element
and a unique minimal element.
EXAMPLES::
sage: P = posets.DivisorLattice(24)
sage: P in Posets().Bounded()
True
"""
return self._with_axiom("Bounded")

class Bounded(CategoryWithAxiom):
"""
The category of bounded posets.
EXAMPLES::
sage: cat = Posets().Bounded(); cat
Category of bounded posets
sage: cat.super_categories()
[Category of posets]
"""
class ParentMethods:
def is_bounded(self):
"""
Return whether ``self`` is a bounded poset.
EXAMPLES::
sage: posets.TamariLattice(4).is_bounded()
True
"""
return True
2 changes: 1 addition & 1 deletion src/sage/combinat/alternating_sign_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -1048,7 +1048,7 @@ class AlternatingSignMatrices(UniqueRepresentation, Parent):
sage: L
Finite lattice containing 7 elements
sage: L.category()
Category of facade finite enumerated lattice posets
Category of facade finite enumerated bounded lattice posets
"""

def __init__(self, n):
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/posets/lattices.py
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ def LatticePoset(data=None, *args, **options):

sage: L = LatticePoset([[1,2],[3],[3]], facade = True)
sage: L.category()
Category of facade finite enumerated lattice posets
Category of facade finite enumerated bounded lattice posets
sage: parent(L[0])
Integer Ring
sage: TestSuite(L).run(skip = ['_test_an_element']) # is_parent_of is not yet implemented
Expand Down
Loading