(* Demonstrate that union and intersection are congruences WRT the shareTreeEq relation. *)

(* Specifications: *)
Lemma Node_Eq : forall x x' y y',
shareTreeEq x x' ->
shareTreeEq y y' ->
shareTreeEq (Node x y) (Node x' y').
Lemma intersect_cong0 : forall y x x',
shareTreeOrd x x' ->
shareTreeOrd
(intersect_tree x  y)
(intersect_tree x' y).
Lemma union_cong0 : forall y x x',
shareTreeOrd x x' ->
shareTreeOrd
(union_tree x  y)
(union_tree x' y).
Lemma intersect_cong1 : forall x x' y,
shareTreeEq x x' ->
shareTreeEq
(intersect_tree x  y)
(intersect_tree x' y).
Lemma union_cong1 : forall x x' y,
shareTreeEq x x' ->
shareTreeEq
(union_tree x  y)
(union_tree x' y).
Lemma intersect_cong : forall x x' y y',
shareTreeEq x x' ->
shareTreeEq y y' ->
shareTreeEq
(intersect_tree x y)
(intersect_tree x' y').
Lemma union_cong : forall x x' y y',
shareTreeEq x x' ->
shareTreeEq y y' ->
shareTreeEq
(union_tree x y)
(union_tree x' y').
Lemma comp_cong0 : forall x x',
shareTreeOrd x x' ->
shareTreeOrd (comp_tree x') (comp_tree x).
Lemma comp_cong : forall x x',
shareTreeEq x x' ->
shareTreeEq (comp_tree x') (comp_tree x).
Lemma tree_comp1 : forall x,
shareTreeOrd (Leaf true) (union_tree x (comp_tree x)).
Lemma tree_comp2 : forall x,
shareTreeOrd (intersect_tree x (comp_tree x)) (Leaf false).
(* Show that two isomorphic canonical trees are identical. *)
Lemma canonicalUnique : forall c1 c2,
shareTreeEq c1 c2 ->
canonicalTree c1 ->
canonicalTree c2 ->
c1 = c2.
Lemma mkCanon_test2 : forall x y,
shareTreeEq x y ->
mkCanon x = mkCanon y.