(* This program is free software; you can redistribute it and/or      *)
(* modify it under the terms of the GNU Lesser General Public License *)
(* as published by the Free Software Foundation; either version 2.1   *)
(* of the License, or (at your option) any later version.             *)
(*                                                                    *)
(* This program is distributed in the hope that it will be useful,    *)
(* but WITHOUT ANY WARRANTY; without even the implied warranty of     *)
(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the      *)
(* GNU General Public License for more details.                       *)
(*                                                                    *)
(* You should have received a copy of the GNU Lesser General Public   *)
(* License along with this program; if not, write to the Free         *)
(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *)
(* 02110-1301 USA                                                     *)
Set Implicit Arguments.
Unset Strict Implicit.
Require Export Monoid_cat.
Require Export Sgroup_facts.
Require Export Monoid_facts.
Require Export Monoid_util.
Require Export Abelian_group_facts.
Section Free_abelian_monoid_def.
Variable V : SET.
Inductive FaM : Type :=
| Var : V -> FaM
| Law : FaM -> FaM -> FaM
| Unit : FaM.
Inductive eqFaM : FaM -> FaM -> Prop :=
| eqFaM_Var : forall x y : V, Equal x y -> (eqFaM (Var x) (Var y):Prop)
| eqFaM_law :
forall x x' y y' : FaM,
eqFaM x x' -> eqFaM y y' -> (eqFaM (Law x y) (Law x' y'):Prop)
| eqFaM_law_assoc :
forall x y z : FaM, eqFaM (Law (Law x y) z) (Law x (Law y z)):Prop
| eqFaM_law0r : forall x : FaM, eqFaM (Law x Unit) x:Prop
| eqFaM_law0l : forall x : FaM, eqFaM (Law Unit x) x:Prop
| eqFaM_refl : forall x : FaM, eqFaM x x:Prop
| eqFaM_sym : forall x y : FaM, eqFaM x y -> (eqFaM y x:Prop)
| eqFaM_trans :
forall x y z : FaM, eqFaM x y -> eqFaM y z -> (eqFaM x z:Prop)
| eqFaM_com : forall x y : FaM, eqFaM (Law x y) (Law y x).
Hint Resolve eqFaM_Var eqFaM_law eqFaM_law_assoc eqFaM_law0r eqFaM_law0l
eqFaM_refl eqFaM_com: algebra.
Hint Immediate eqFaM_sym: algebra.

Lemma eqFaM_Equiv : equivalence eqFaM.
red in |- *.