Finite lattice posets - Category Framework

Skip to content
Back to top
View this page
Edit this page

# Finite lattice posets

class sage.categories.finite_lattice_posets.FiniteLatticePosets(base_category)

  Bases: `CategoryWithAxiom`

  The category of finite lattices, i.e. finite partially ordered sets which are also lattices.

  EXAMPLES:

  Sage

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

  Python

      >>> from sage.all import *
      >>> FiniteLatticePosets()
      Category of finite lattice posets
      >>> FiniteLatticePosets().super_categories()
      [Category of lattice posets, Category of finite posets]
      >>> FiniteLatticePosets().example()
      NotImplemented

  See also

  `FinitePosets`, `LatticePosets`, `FiniteLatticePoset`

  class ParentMethods

    Bases: `object`

    irreducibles_poset()

      Return the poset of meet- or join-irreducibles of the lattice.

      A join-irreducible element of a lattice is an element with exactly one lower cover. Dually a meet-irreducible element has exactly one upper cover.

      This is the smallest poset with completion by cuts being isomorphic to the lattice. As a special case this returns one-element poset from one-element lattice.

      See also

      `completion_by_cuts()`.

      EXAMPLES:

      Sage

          sage: # needs sage.combinat sage.graphs sage.modules
          sage: L = LatticePoset({1: [2, 3, 4], 2: [5, 6], 3: [5],
          ....:                   4: [6], 5: [9, 7], 6: [9, 8], 7: [10],
          ....:                   8: [10], 9: [10], 10: [11]})
          sage: L_ = L.irreducibles_poset()
          sage: sorted(L_)
          [2, 3, 4, 7, 8, 9, 10, 11]
          sage: L_.completion_by_cuts().is_isomorphic(L)
          True

      Python

          >>> from sage.all import *
          >>> # needs sage.combinat sage.graphs sage.modules
          >>> L = LatticePoset({Integer(1): [Integer(2), Integer(3), Integer(4)], Integer(2): [Integer(5), Integer(6)], Integer(3): [Integer(5)],
          ...                   Integer(4): [Integer(6)], Integer(5): [Integer(9), Integer(7)], Integer(6): [Integer(9), Integer(8)], Integer(7): [Integer(10)],
          ...                   Integer(8): [Integer(10)], Integer(9): [Integer(10)], Integer(10): [Integer(11)]})
          >>> L_ = L.irreducibles_poset()
          >>> sorted(L_)
          [2, 3, 4, 7, 8, 9, 10, 11]
          >>> L_.completion_by_cuts().is_isomorphic(L)
          True

    is_lattice_morphism(f, codomain)

      Return whether `f` is a morphism of posets from `self` to `codomain`.

      A map \(f : P \to Q\) is a poset morphism if

      \[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

      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:

      Sage

          sage: D = LatticePoset((divisors(60), attrcall("divides")))             # needs sage.graphs sage.modules
          sage: B = LatticePoset((Subsets([2,2,3]), attrcall("issubset")))        # needs sage.graphs sage.modules
          sage: def f(b): return D(5*prod(b))
          sage: B.is_lattice_morphism(f, D)                                       # needs sage.graphs sage.modules
          True

      Python

          >>> from sage.all import *
          >>> D = LatticePoset((divisors(Integer(60)), attrcall("divides")))             # needs sage.graphs sage.modules
          >>> B = LatticePoset((Subsets([Integer(2),Integer(2),Integer(3)]), attrcall("issubset")))        # needs sage.graphs sage.modules
          >>> def f(b): return D(Integer(5)*prod(b))
          >>> B.is_lattice_morphism(f, D)                                       # needs sage.graphs sage.modules
          True

      We construct the boolean lattice \(B_2\):

      Sage

          sage: B = posets.BooleanLattice(2)                                      # needs sage.graphs
          sage: B.cover_relations()                                               # needs sage.graphs
          [[0, 1], [0, 2], [1, 3], [2, 3]]

      [Python]

          >>> from sage.all import *
          >>> B = posets.BooleanLattice(Integer(2))                                      # needs sage.graphs
          >>> B.cover_relations()                                               # needs sage.graphs
          [[0, 1], [0, 2], [1, 3], [2, 3]]

      And the same lattice with new top and bottom elements numbered respectively \(-1\) and \(3\):

      Sage

          sage: G = DiGraph({-1:[0], 0:[1,2], 1:[3], 2:[3], 3:[4]})               # needs sage.graphs
          sage: L = LatticePoset(G)                                               # needs sage.graphs sage.modules
          sage: L.cover_relations()                                               # needs sage.graphs sage.modules
          [[-1, 0], [0, 1], [0, 2], [1, 3], [2, 3], [3, 4]]

          sage: f = {B(0): L(0), B(1): L(1), B(2): L(2), B(3): L(3)}.__getitem__  # needs sage.graphs sage.modules
          sage: B.is_lattice_morphism(f, L)                                       # needs sage.graphs sage.modules
          True

          sage: f = {B(0): L(-1),B(1): L(1), B(2): L(2), B(3): L(3)}.__getitem__  # needs sage.graphs sage.modules
          sage: B.is_lattice_morphism(f, L)                                       # needs sage.graphs sage.modules
          False

          sage: f = {B(0): L(0), B(1): L(1), B(2): L(2), B(3): L(4)}.__getitem__  # needs sage.graphs sage.modules
          sage: B.is_lattice_morphism(f, L)                                       # needs sage.graphs sage.modules
          False

      Python

          >>> from sage.all import *
          >>> G = DiGraph({-Integer(1):[Integer(0)], Integer(0):[Integer(1),Integer(2)], Integer(1):[Integer(3)], Integer(2):[Integer(3)], Integer(3):[Integer(4)]})               # needs sage.graphs
          >>> L = LatticePoset(G)                                               # needs sage.graphs sage.modules
          >>> L.cover_relations()                                               # needs sage.graphs sage.modules
          [[-1, 0], [0, 1], [0, 2], [1, 3], [2, 3], [3, 4]]

          >>> f = {B(Integer(0)): L(Integer(0)), B(Integer(1)): L(Integer(1)), B(Integer(2)): L(Integer(2)), B(Integer(3)): L(Integer(3))}.__getitem__  # needs sage.graphs sage.modules
          >>> B.is_lattice_morphism(f, L)                                       # needs sage.graphs sage.modules
          True

          >>> f = {B(Integer(0)): L(-Integer(1)),B(Integer(1)): L(Integer(1)), B(Integer(2)): L(Integer(2)), B(Integer(3)): L(Integer(3))}.__getitem__  # needs sage.graphs sage.modules
          >>> B.is_lattice_morphism(f, L)                                       # needs sage.graphs sage.modules
          False

          >>> f = {B(Integer(0)): L(Integer(0)), B(Integer(1)): L(Integer(1)), B(Integer(2)): L(Integer(2)), B(Integer(3)): L(Integer(4))}.__getitem__  # needs sage.graphs sage.modules
          >>> B.is_lattice_morphism(f, L)                                       # needs sage.graphs sage.modules
          False

      See also

      `is_poset_morphism()`

    join_irreducibles()

      Return the join-irreducible elements of this finite lattice.

      A join-irreducible element of `self` is an element \(x\) that is not minimal and that can not be written as the join of two elements different from \(x\).

      EXAMPLES:

      Sage

          sage: L = LatticePoset({0:[1,2],1:[3],2:[3,4],3:[5],4:[5]})             # needs sage.graphs sage.modules
          sage: L.join_irreducibles()                                             # needs sage.graphs sage.modules
          [1, 2, 4]

      Python

          >>> from sage.all import *
          >>> L = LatticePoset({Integer(0):[Integer(1),Integer(2)],Integer(1):[Integer(3)],Integer(2):[Integer(3),Integer(4)],Integer(3):[Integer(5)],Integer(4):[Integer(5)]})             # needs sage.graphs sage.modules
          >>> L.join_irreducibles()                                             # needs sage.graphs sage.modules
          [1, 2, 4]

      See also

      - Dual function: `meet_irreducibles()`

      - Other: `double_irreducibles()`, `join_irreducibles_poset()`

    join_irreducibles_poset()

      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 elements different from \(x\).

      EXAMPLES:

      Sage

          sage: L = LatticePoset({0:[1,2,3],1:[4],2:[4],3:[4]})                   # needs sage.graphs sage.modules
          sage: L.join_irreducibles_poset()                                       # needs sage.graphs sage.modules
          Finite poset containing 3 elements

      Python

          >>> from sage.all import *
          >>> L = LatticePoset({Integer(0):[Integer(1),Integer(2),Integer(3)],Integer(1):[Integer(4)],Integer(2):[Integer(4)],Integer(3):[Integer(4)]})                   # needs sage.graphs sage.modules
          >>> L.join_irreducibles_poset()                                       # needs sage.graphs sage.modules
          Finite poset containing 3 elements

      See also

      - Dual function: `meet_irreducibles_poset()`

      - Other: `join_irreducibles()`

    meet_irreducibles()

      Return the meet-irreducible elements of this finite lattice.

      A meet-irreducible element of `self` is an element \(x\) that is not maximal and that can not be written as the meet of two elements different from \(x\).

      EXAMPLES:

      Sage

          sage: L = LatticePoset({0:[1,2],1:[3],2:[3,4],3:[5],4:[5]})             # needs sage.graphs sage.modules
          sage: L.meet_irreducibles()                                             # needs sage.graphs sage.modules
          [1, 3, 4]

      Python

          >>> from sage.all import *
          >>> L = LatticePoset({Integer(0):[Integer(1),Integer(2)],Integer(1):[Integer(3)],Integer(2):[Integer(3),Integer(4)],Integer(3):[Integer(5)],Integer(4):[Integer(5)]})             # needs sage.graphs sage.modules
          >>> L.meet_irreducibles()                                             # needs sage.graphs sage.modules
          [1, 3, 4]

      See also

      - Dual function: `join_irreducibles()`

      - Other: `double_irreducibles()`, `meet_irreducibles_poset()`

    meet_irreducibles_poset()

      Return the poset of join-irreducible elements of the 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 elements different from \(x\).

      EXAMPLES:

      Sage

          sage: L = LatticePoset({0:[1,2,3],1:[4],2:[4],3:[4]})                   # needs sage.graphs sage.modules
          sage: L.meet_irreducibles_poset()                                       # needs sage.graphs sage.modules
          Finite poset containing 3 elements

      Python

          >>> from sage.all import *
          >>> L = LatticePoset({Integer(0):[Integer(1),Integer(2),Integer(3)],Integer(1):[Integer(4)],Integer(2):[Integer(4)],Integer(3):[Integer(4)]})                   # needs sage.graphs sage.modules
          >>> L.meet_irreducibles_poset()                                       # needs sage.graphs sage.modules
          Finite poset containing 3 elements

      See also

      - Dual function: `join_irreducibles_poset()`

      - Other: `meet_irreducibles()`