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
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
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
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]
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
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
Bases: sage.combinat.posets.posets.FinitePoset
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
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
Construct a join semi-lattice from various forms of input data.
INPUT:
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.
Construct a lattice from various forms of input data.
INPUT:
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.
Construct a meet semi-lattice from various forms of input data.
INPUT:
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.