Section 10.1 Boolean Algebra
A Boolean algebra is a bounded lattice that is both complemented and distributive. Let’s define the
is_boolean_algebra()
function to determine whether a given poset is a Boolean algebra. The function accepts a finite partially ordered set as input and returns a tuple containing a boolean value and a message explaining the result. Run the following cell to define the function and call it in other cells.Let’s check if the following poset is a Boolean algebra.
When we pass
P
to the is_boolean_algebra()
function, LatticePoset()
raises an error because P
is not a lattice. The ValueError
provides more information about the absence of a top element. Therefore, P
is not a Boolean algebra.Let’s examine the divisor lattice of 30:
Now for the divisor lattice of 20:
Here is a classic example in the field of computer science: