SemiLattices and Lattices

class sage.combinat.posets.lattices.FiniteJoinSemilattice(digraph, elements=None)

Bases: sage.combinat.posets.posets.FinitePoset

We assume that the argument passed to FiniteJoinSemilattice is the poset of a join-semilattice (i.e. a poset with least upper bound for each pair of elements).

TESTS:

sage: J = JoinSemilattice([[1,2],[3],[3]])
sage: J == loads(dumps(J))
True
sage: P = Poset([[1,2],[3],[3]])
sage: J = JoinSemilattice(P)
sage: J == loads(dumps(J))
True
join(x, y)

Return the join of self and other in the lattice.

EXAMPLES:

sage: D = Posets.DiamondPoset(5)
sage: D(1) + D(2)
4
sage: D(1) + D(1)
1
sage: D(1) + D(4)
4
sage: D(1) + D(0)
1
class sage.combinat.posets.lattices.FiniteLatticePoset(digraph, elements=None)

Bases: sage.combinat.posets.lattices.FiniteMeetSemilattice, sage.combinat.posets.lattices.FiniteJoinSemilattice

We assume that the argument passed to FiniteLatticePoset is the poset of a lattice (i.e. a poset with greatest lower bound and least upper bound for each pair of elements).

TESTS:

sage: L = LatticePoset([[1,2],[3],[3]])
sage: L == loads(dumps(L))
True
sage: P = Poset([[1,2],[3],[3]])
sage: L = LatticePoset(P)
sage: L == loads(dumps(L))
True
complements()

Returns a list of the elements of the lattice.

A complement of x is an element y such that the meet of x and y is the bottom element of self and the join of x and y is the top element of self.

EXAMPLES:

sage: L = LatticePoset({0:[1,2,3],1:[4],2:[4],3:[4]})
sage: L.complements()
[4, 3, 3, 2, 0]

sage: L = LatticePoset({0:[1,2],1:[3],2:[3],3:[4]})
sage: L.complements()
[4, None, None, None, 0]
is_complemented()

Returns True if self is a complemented lattice, and False otherwise.

EXAMPLES:

sage: L = LatticePoset({0:[1,2,3],1:[4],2:[4],3:[4]})
sage: L.is_complemented()
True

sage: L = LatticePoset({0:[1,2],1:[3],2:[3],3:[4]})
sage: L.is_complemented()
False
is_distributive()

Returns True if the lattice is distributive, and False otherwise.

EXAMPLES:

sage: L = LatticePoset({0:[1,2],1:[3],2:[3]})
sage: L.is_distributive()
True
sage: L = LatticePoset({0:[1,2,3],1:[4],2:[4],3:[4]})
sage: L.is_distributive()
False
class sage.combinat.posets.lattices.FiniteMeetSemilattice(digraph, elements=None)

Bases: sage.combinat.posets.posets.FinitePoset

..note::
We assume that the argument passed to MeetSemilattice is the poset of a meet-semilattice (i.e. a poset with greatest lower bound for each pair of elements).

TESTS:

sage: M = MeetSemilattice([[1,2],[3],[3]])
sage: M == loads(dumps(M))
True
sage: P = Poset([[1,2],[3],[3]])
sage: M = MeetSemilattice(P)
sage: M == loads(dumps(M))
True
meet(x, y)

Return the meet of self and other in the lattice.

EXAMPLES:

sage: D = Posets.DiamondPoset(5)
sage: D(1) * D(2)
0
sage: D(1) * D(1)
1
sage: D(1) * D(0)
0
sage: D(1) * D(4)
1
sage.combinat.posets.lattices.JoinSemilattice(data)

Construct a join semi-lattice from various forms of input data.

INPUT:

  • data - any data that defines a poset that is also a join semilattice. See the documentation for Poset.

EXAMPLES:

Using data that defines a poset:

sage: JoinSemilattice([[1,2],[3],[3]])
Finite join-semilattice containing 4 elements

Using a previously constructed poset:

sage: P = Poset([[1,2],[3],[3]])
sage: J = JoinSemilattice(P); J
Finite join-semilattice containing 4 elements
sage: type(J)
<class 'sage.combinat.posets.lattices.FiniteJoinSemilattice'>

If the data is not a lattice, then an error is raised:

sage: elms = [1,2,3,4,5,6,7]
sage: rels = [[1,2],[3,4],[4,5],[2,5]]
sage: JoinSemilattice((elms, rels))
...
ValueError: Not a join semilattice.
sage.combinat.posets.lattices.LatticePoset(data)

Construct a lattice from various forms of input data.

INPUT:

  • data - any data that defines a poset. See the documentation for Poset.

OUTPUT:

FiniteLatticePoset – an instance of FiniteLatticePoset

EXAMPLES:

Using data that defines a poset:

sage: LatticePoset([[1,2],[3],[3]])
Finite lattice containing 4 elements

Using a previously constructed poset:

sage: P = Poset([[1,2],[3],[3]])
sage: L = LatticePoset(P); L
Finite lattice containing 4 elements
sage: type(L)
<class 'sage.combinat.posets.lattices.FiniteLatticePoset'>

If the data is not a lattice, then an error is raised:

sage: elms = [1,2,3,4,5,6,7]
sage: rels = [[1,2],[3,4],[4,5],[2,5]]
sage: LatticePoset((elms, rels))
...
ValueError: Not a lattice.
sage.combinat.posets.lattices.MeetSemilattice(data)

Construct a meet semi-lattice from various forms of input data.

INPUT:

  • data - any data that defines a poset that is also a meet semilattice. See the documentation for Poset.

EXAMPLES:

Using data that defines a poset:

sage: MeetSemilattice([[1,2],[3],[3]])
Finite meet-semilattice containing 4 elements

Using a previously constructed poset:

sage: P = Poset([[1,2],[3],[3]])
sage: L = MeetSemilattice(P); L
Finite meet-semilattice containing 4 elements
sage: type(L)
<class 'sage.combinat.posets.lattices.FiniteMeetSemilattice'>

If the data is not a lattice, then an error is raised:

sage: elms = [1,2,3,4,5,6,7]
sage: rels = [[1,2],[3,4],[4,5],[2,5]]
sage: MeetSemilattice((elms, rels))
...
ValueError: Not a meet semilattice.

Previous topic

Elements of posets, lattices, semilattices, etc.

Next topic

Some examples of posets and lattices.

This Page