Module BA <: BOOLEAN_ALGEBRA.
Definition t := canonTree.
Definition Ord (x y:canonTree) := shareTreeOrd (proj1_sig x) (proj1_sig y).
Definition lub (x y:canonTree) : canonTree :=
exist (fun t => canonicalTree t)
(mkCanon (union_tree (proj1_sig x) (proj1_sig y)))
(mkCanon_correct _).
Definition glb (x y:canonTree) : canonTree :=
exist (fun t => canonicalTree t)
(mkCanon (intersect_tree (proj1_sig x) (proj1_sig y)))
(mkCanon_correct _).
Definition top : canonTree := exist (fun t => canonicalTree t) (Leaf true) I.
Definition bot : canonTree := exist (fun t => canonicalTree t) (Leaf false) I.
Definition comp (x:canonTree) : canonTree :=
exist (fun t => canonicalTree t) (comp_tree (proj1_sig x))
(comp_canonical _ (proj2_sig x)).

Lemma glb_lower2 : forall x y, Ord (glb x y) y.