diff --git a/src/sage/categories/category_with_axiom.py b/src/sage/categories/category_with_axiom.py index 5a98b9e364b..f3d52b00507 100644 --- a/src/sage/categories/category_with_axiom.py +++ b/src/sage/categories/category_with_axiom.py @@ -1678,6 +1678,7 @@ class ``Sets.Finite``), or in a separate file (typically in a class "Differentiable", "Smooth", "Analytic", "AlmostComplex", "FinitelyGeneratedAsMagma", "WellGenerated", + "Bounded", "Facade", "Finite", "Infinite", "Enumerated", "Complete", "Nilpotent", diff --git a/src/sage/categories/finite_lattice_posets.py b/src/sage/categories/finite_lattice_posets.py index 6c3af10965f..42939236314 100644 --- a/src/sage/categories/finite_lattice_posets.py +++ b/src/sage/categories/finite_lattice_posets.py @@ -9,6 +9,8 @@ # ***************************************************************************** from sage.categories.category_with_axiom import CategoryWithAxiom +from sage.categories.lattice_posets import LatticePosets +from sage.misc.cachefunc import cached_method class FiniteLatticePosets(CategoryWithAxiom): @@ -21,7 +23,9 @@ class FiniteLatticePosets(CategoryWithAxiom): sage: FiniteLatticePosets() Category of finite 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 @@ -37,6 +41,19 @@ class FiniteLatticePosets(CategoryWithAxiom): True sage: TestSuite(C).run() """ + @cached_method + def extra_super_categories(self): + r""" + Implement the fact that a finite lattice is a bounded poset. + + EXAMPLES:: + + sage: FiniteLatticePosets().super_categories() + [Category of lattice posets, + Category of finite posets, + Category of bounded posets] + """ + return [LatticePosets().Bounded()] class ParentMethods: diff --git a/src/sage/categories/lattice_posets.py b/src/sage/categories/lattice_posets.py index 172e9f58748..f2d35a03e54 100644 --- a/src/sage/categories/lattice_posets.py +++ b/src/sage/categories/lattice_posets.py @@ -90,6 +90,7 @@ def join(self, x, y): """ class SubcategoryMethods: + def Stone(self): r""" A Stone lattice `(L, \vee, \wedge)` is a pseudo-complemented diff --git a/src/sage/categories/posets.py b/src/sage/categories/posets.py index 665bedc3bac..8de81685775 100644 --- a/src/sage/categories/posets.py +++ b/src/sage/categories/posets.py @@ -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 @@ -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