# closedInterval -- computes the subposet contained between two points

## Synopsis

• Usage:
I = closedInterval(P, p, q)
• Inputs:
• P, an instance of the type Poset,
• p, , an element of the poset
• q, , an element of the poset
• Outputs:
• I, an instance of the type Poset, the closed interval in $P$ between $p$ and $q$

## Description

The closed interval between $p$ and $q$ is the subposet of $P$ induced by the elements $z$ such that $p \leq z \leq q$. If $p$ and $q$ are incomparable, then an error is thrown.

 i1 : P = booleanLattice 3; i2 : closedInterval(P, "001", "111") o2 = Relation Matrix: | 1 1 1 1 | | 0 1 0 1 | | 0 0 1 1 | | 0 0 0 1 | o2 : Poset