(** * Coq codes *)
(** ** Dependencies *)
Require Export RegExp.Utility.
Require Export RegExp.Definitions.
Require Export RegExp.Boolean.
Require Export RegExp.Concat.
Require Export RegExp.Star.
(** ** 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.
Add Parametric Morphism : includes with
signature re_eq ==> re_eq ==> prop_eq as includes_morphism.
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 implies_to_includes : forall x y, (forall s, x ~== s -> y ~== s) -> x <= y.
Lemma includes_to_implies : forall x y, x <= y -> (forall s, x ~== s -> y ~== s).
(** [x || y] is the least upper bound of [x] and [y] *)
Lemma Cat_least_upper_bound : forall x y, x <= (x || y) /\ y <= (x || y) /\
(forall z, x <= z -> y <= z -> (x || y) <= z).