(Semi-)lattices #
Semilattices are partially ordered sets with join (least upper bound, or sup) or meet (greatest
lower bound, or inf) operations. Lattices are posets that are both join-semilattices and
meet-semilattices.
Distributive lattices are lattices which satisfy any of four equivalent distributivity properties,
of sup over inf, on the left or on the right.
Main declarations #
SemilatticeSup: a type class for join semilatticesSemilatticeInf: a type class for meet semilatticesLattice: a type class for latticesDistribLattice: a type class for distributive lattices.
Notation #
a ⊔ b: the supremum or join ofaandba ⊓ b: the infimum or meet ofaandb
Tags #
semilattice, lattice
Semilattices #
A SemilatticeSup is a join-semilattice, that is, a partial order
with a join (a.k.a. lub / least upper bound, sup / supremum) operation
⊔ which is the least element larger than both factors.
- sup : α → α → α
The binary supremum, used to derive
Max α The supremum is an upper bound on the first argument
The supremum is an upper bound on the second argument
The supremum is the least upper bound
Instances
A SemilatticeInf is a meet-semilattice, that is, a partial order
with a meet (a.k.a. glb / greatest lower bound, inf / infimum) operation
⊓ which is the greatest element smaller than both factors.
- inf : α → α → α
The binary infimum, used to derive
Min α The infimum is a lower bound on the first argument
The infimum is a lower bound on the second argument
The infimum is the greatest lower bound
Instances
Equations
- SemilatticeSup.toMax = { max := fun (a b : α) => SemilatticeSup.sup a b }
Equations
- SemilatticeInf.toMin = { min := fun (a b : α) => SemilatticeInf.inf a b }
Alias of the forward direction of sup_eq_left.
Alias of the reverse direction of sup_eq_left.
Alias of the forward direction of sup_eq_right.
Alias of the reverse direction of sup_eq_right.
Alias of the reverse direction of inf_eq_right.
Alias of the reverse direction of inf_eq_left.
Alias of the forward direction of inf_eq_right.
Alias of the forward direction of inf_eq_left.
Lattices #
A lattice is a join-semilattice which is also a meet-semilattice.
Instances
Auxiliary constructor for to_dual.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Distributivity laws #
Distributive lattices #
A distributive lattice is a lattice that satisfies any of four
equivalent distributive properties (of sup over inf or inf over sup,
on the left or right).
The definition here chooses le_sup_inf: (x ⊔ y) ⊓ (x ⊔ z) ≤ x ⊔ (y ⊓ z). To prove distributivity
from the dual law, use DistribLattice.ofInfSupLe.
A classic example of a distributive lattice is the lattice of subsets of a set, and in fact this example is generic in the sense that every distributive lattice is realizable as a sublattice of a powerset lattice.
Instances
Prove distributivity of an existing lattice from the dual distributive law.
Equations
- DistribLattice.ofInfSupLe inf_sup_le = { toLattice := inst✝, le_sup_inf := ⋯ }