# isUpperSemilattice -- determines if a poset is an upper (or join) semilattice

## Synopsis

• Usage:
i = isUpperSemilattice P
• Inputs:
• P, an instance of the type Poset,
• Outputs:
• i, , whether $P$ is an upper semilattice

## Description

The poset $P$ is an upper semilattice if every pair of vertices has a unique least upper bound (join).

Clearly, the $n$ chain and the $n$ booleanLattice are upper semilattices.

 i1 : n = 4; i2 : isUpperSemilattice chain n o2 = true i3 : B = booleanLattice n; i4 : isUpperSemilattice B o4 = true

The middle ranks of the $n$ booleanLattice are not upper semilattices.

 i5 : isUpperSemilattice flagPoset(B, {1,2,3}) o5 = false

However, the upper ranks of the $n$ booleanLattice are non-lattice upper semilattices.

 i6 : B' = flagPoset(B, {1,2,3,4}); i7 : isLattice B' o7 = false i8 : isUpperSemilattice B' o8 = true