(** ** Define [includes] *)

Definition includes (x y:RegExp) : Prop := (x || y) =R= y.Notation "x <= y" := (includes x y) (at level 70).Definition prop_eq (p q:Prop) : Prop := (p <-> q).

(* Specifications: *)
Lemma prop_eq_equiv : equiv Prop prop_eq.
Lemma includes_reflexive : reflexive RegExp includes.
Lemma includes_antisymmetric : forall x y, x <= y -> y <= x -> x =R= y.
Lemma includes_transitive : transitive RegExp includes.
Lemma Cat_least_upper_bound : forall x y, x <= (x || y) /\ y <= (x || y) /\ (forall z, x <= z -> y <= z -> (x || y) <= z).
Lemma includes_right_Or_monotone : forall x y z, x <= y -> (x || z) <= (y || z).
Lemma includes_left_Or_monotone : forall x y z, x <= y -> (z || x) <= (z || y).
Lemma includes_right_Cat_monotone : forall x y z, x <= y -> (x ++ z) <= (y ++ z).
Lemma includes_left_Cat_monotone : forall x y z, x <= y -> (z ++ x) <= (z ++ y).
Lemma includes_Star_monotone : forall x y, x <= y -> (Star x) <= (Star y).
Theorem Star_right : forall r, (Eps || (r ++ Star r)) <= Star r.
Theorem Star_left : forall r, (Eps || (Star r ++ r)) <= Star r.
Theorem Star_eq_left : forall a b x, (b || (a ++ x)) <= x -> ((Star a) ++ b) <= x.
Theorem Star_eq_right : forall a b x, (b || (x ++ a)) <= x -> (b ++ (Star a)) <= x.