Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Some cleanup in the category docstrings.
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis Scrimshaw committed Apr 19, 2016
1 parent 429b494 commit 376adfb
Showing 1 changed file with 31 additions and 15 deletions.
46 changes: 31 additions & 15 deletions src/sage/categories/finite_lattice_posets.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ class FiniteLatticePosets(CategoryWithAxiom):
sage: FiniteLatticePosets().example()
NotImplemented
.. seealso:: :class:`FinitePosets`, :class:`LatticePosets`,
:class:`LatticePoset`
.. SEEALSO::
:class:`FinitePosets`, :class:`LatticePosets`, :class:`LatticePoset`
TESTS::
Expand All @@ -52,13 +53,17 @@ def join_irreducibles(self):
sage: L.join_irreducibles()
[1, 2, 4]
.. seealso:: :meth:`meet_irreducibles`, :meth:`~sage.combinat.posets.lattices.FiniteLatticePoset.double_irreducibles`, :meth:`meet_irreducibles_poset`
.. SEEALSO::
:meth:`meet_irreducibles`,
:meth:`~sage.combinat.posets.lattices.FiniteLatticePoset.double_irreducibles`,
:meth:`meet_irreducibles_poset`
"""
return [x for x in self if len(self.lower_covers(x)) == 1]

def join_irreducibles_poset(self):
r"""
Returns the poset of join-irreducible elements of this finite lattice.
Return the poset of join-irreducible elements of this finite lattice.
A *join-irreducible element* of ``self`` is an element `x`
that is not minimal and can not be written as the join of two
Expand All @@ -70,7 +75,7 @@ def join_irreducibles_poset(self):
sage: L.join_irreducibles_poset()
Finite poset containing 3 elements
.. seealso:: :meth:`join_irreducibles`
.. SEEALSO:: :meth:`join_irreducibles`
"""
return self.subposet(self.join_irreducibles())

Expand All @@ -88,13 +93,17 @@ def meet_irreducibles(self):
sage: L.meet_irreducibles()
[1, 3, 4]
.. seealso:: :meth:`join_irreducibles`, :meth:`~sage.combinat.posets.lattices.FiniteLatticePoset.double_irreducibles`, :meth:`meet_irreducibles_poset`
.. SEEALSO::
:meth:`join_irreducibles`,
:meth:`~sage.combinat.posets.lattices.FiniteLatticePoset.double_irreducibles`,
:meth:`meet_irreducibles_poset`
"""
return [x for x in self if len(self.upper_covers(x)) == 1]

def meet_irreducibles_poset(self):
r"""
Returns the poset of join-irreducible elements of this finite lattice.
Return the poset of join-irreducible elements of this finite lattice.
A *meet-irreducible element* of ``self`` is an element `x`
that is not maximal and can not be written as the meet of two
Expand All @@ -106,7 +115,7 @@ def meet_irreducibles_poset(self):
sage: L.join_irreducibles_poset()
Finite poset containing 3 elements
.. seealso:: :meth:`meet_irreducibles`
.. SEEALSO:: :meth:`meet_irreducibles`
"""
return self.subposet(self.meet_irreducibles())

Expand All @@ -116,21 +125,27 @@ def meet_irreducibles_poset(self):

def is_lattice_morphism(self, f, codomain):
r"""
Return whether ``f`` is a morphism of posets from ``self``
to ``codomain``.
A map `f : P \to Q` is a poset morphism if
.. MATH::
x \leq y \Rightarrow f(x) \leq f(y)
for all `x,y \in P`.
INPUT:
- ``f`` -- a function from ``self`` to ``codomain``
- ``codomain`` -- a lattice
Returns whether `f` is a morphism of posets form ``self``
to ``codomain``, that is
.. math:: x\leq y \Rightarrow f(x) \leq f(y)
EXAMPLES:
We build the boolean lattice of `\{2,2,3\}` and the
lattice of divisors of `60`, and check that the map
`b \mapsto 5\prod_{x\in b} x` is a morphism of lattices::
`b \mapsto 5 \prod_{x\in b} x` is a morphism of lattices::
sage: D = LatticePoset((divisors(60), attrcall("divides")))
sage: B = LatticePoset((Subsets([2,2,3]), attrcall("issubset")))
Expand Down Expand Up @@ -163,7 +178,7 @@ def is_lattice_morphism(self, f, codomain):
sage: B.is_lattice_morphism(f, L)
False
.. seealso::
.. SEEALSO::
:meth:`~sage.categories.finite_posets.FinitePosets.ParentMethods.is_poset_morphism`
"""
Expand All @@ -178,3 +193,4 @@ def is_lattice_morphism(self, f, codomain):
if f(self.meet(x,y)) != codomain.meet(f(x), f(y)):
return False
return True

0 comments on commit 376adfb

Please sign in to comment.