(** * Coq codes *)
(** ** Dependencies *)
Require Export RegExp.Utility.
Require Export RegExp.Definitions.
(** ** [Empty] *)
(** [Empty] corresponds to 0 in Kleene algebra. *)
(** ** [Eps] *)
(** [Eps] corresponds to 1 in Kleene algebra. *)
(** ** Boolean operations on [RegExp] are morphism. *)
(** [Or] corresponds to plus in Kleene algebra. *)
Add Parametric Morphism : Or with
signature re_eq ==> re_eq ==> re_eq as Or_morphism.
Add Parametric Morphism : And with
signature re_eq ==> re_eq ==> re_eq as And_morphism.
Add Parametric Morphism : Not with
signature re_eq ==> re_eq as Not_morphism.
(** [matches] is a homomorphism from [RegExp] to bool for [And], [Or], and [Not]. *)
(** ** Axioms for [Or] *)
(** Commutativity and associativity of [Or] and [And]. *)
(** [Empty] is the identity element 0 for [Or]. *)
intros.  setoid_rewrite Or_comm.
eapply Or_left_id.
Qed.

Corollary Or_right_id_s : forall s r, (r || Empty) ~= s = r ~= s.