(* 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.
Section Free_monoid_def.
Variable V : SET.

Inductive FM : Type :=
  | Var : V -> FM
  | Law : FM -> FM -> FM
  | Unit : FM.

Inductive eqFM : FM -> FM -> Prop :=
  | eqFM_Var : forall x y : V, Equal x y -> (eqFM (Var x) (Var y):Prop)
  | eqFM_law :
      forall x x' y y' : FM,
      eqFM x x' -> eqFM y y' -> (eqFM (Law x y) (Law x' y'):Prop)
  | eqFM_law_assoc :
      forall x y z : FM, eqFM (Law (Law x y) z) (Law x (Law y z)):Prop
  | eqFM_law0r : forall x : FM, eqFM (Law x Unit) x:Prop
  | eqFM_law0l : forall x : FM, eqFM (Law Unit x) x:Prop
  | eqFM_refl : forall x : FM, eqFM x x:Prop
  | eqFM_sym : forall x y : FM, eqFM x y -> (eqFM y x:Prop)
  | eqFM_trans : forall x y z : FM, eqFM x y -> eqFM y z -> (eqFM x z:Prop).
Hint Resolve eqFM_Var eqFM_law eqFM_law_assoc eqFM_law0r eqFM_law0l
  eqFM_refl: algebra.
Hint Immediate eqFM_sym: algebra.

Lemma eqFM_Equiv : equivalence eqFM.
(* Goal: @Map_eq V (sgroup_set (monoid_sgroup M)) f (@comp_hom SET V FM_set (sgroup_set (monoid_sgroup M)) (@f2 FreeMonoid M FM_lift_fun (fun (x y : FM) (H' : eqFM x y) => @eqFM_ind (fun x0 y0 : FM => @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0)) (fun (x0 y0 : Carrier V) (H : @Equal V x0 y0) => @Ap_comp V (sgroup_set (monoid_sgroup M)) f f x0 y0 H (@Refl (MAP V (sgroup_set (monoid_sgroup M))) f)) (fun (x0 x' y0 y' : FM) (_ : eqFM x0 x') (H0 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun x')) (_ : eqFM y0 y') (H2 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun y0) (FM_lift_fun y')) => @SGROUP_comp (monoid_sgroup M) (FM_lift_fun x0) (FM_lift_fun x') (FM_lift_fun y0) (FM_lift_fun y') H0 H2) (fun x0 y0 z : FM => @SGROUP_assoc (monoid_sgroup M) (FM_lift_fun x0) (FM_lift_fun y0) (FM_lift_fun z)) (fun x0 : FM => @MONOID_unit_r M (FM_lift_fun x0)) (fun x0 : FM => @MONOID_unit_l M (FM_lift_fun x0)) (fun x0 : FM => @Refl (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0)) (fun (x0 y0 : FM) (_ : eqFM x0 y0) (H0 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0)) => @Sym (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0) H0) (fun (x0 y0 z : FM) (_ : eqFM x0 y0) (H'1 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0)) (_ : eqFM y0 z) (H'3 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun y0) (FM_lift_fun z)) => @Trans (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0) (FM_lift_fun z) H'1 H'3) x y H')) FM_var) *)
red in |- *.
(* Goal: and (@transitive FM eqFM) (@symmetric FM eqFM) *)
split; [ try assumption | idtac ].
(* Goal: @reflexive FM eqFM *)
(* Goal: @partial_equivalence FM eqFM *)
exact eqFM_refl.
(* Goal: @Map_eq V (sgroup_set (monoid_sgroup M)) f (@comp_hom SET V FM_set (sgroup_set (monoid_sgroup M)) (@f2 FreeMonoid M FM_lift_fun (fun (x y : FM) (H' : eqFM x y) => @eqFM_ind (fun x0 y0 : FM => @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0)) (fun (x0 y0 : Carrier V) (H : @Equal V x0 y0) => @Ap_comp V (sgroup_set (monoid_sgroup M)) f f x0 y0 H (@Refl (MAP V (sgroup_set (monoid_sgroup M))) f)) (fun (x0 x' y0 y' : FM) (_ : eqFM x0 x') (H0 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun x')) (_ : eqFM y0 y') (H2 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun y0) (FM_lift_fun y')) => @SGROUP_comp (monoid_sgroup M) (FM_lift_fun x0) (FM_lift_fun x') (FM_lift_fun y0) (FM_lift_fun y') H0 H2) (fun x0 y0 z : FM => @SGROUP_assoc (monoid_sgroup M) (FM_lift_fun x0) (FM_lift_fun y0) (FM_lift_fun z)) (fun x0 : FM => @MONOID_unit_r M (FM_lift_fun x0)) (fun x0 : FM => @MONOID_unit_l M (FM_lift_fun x0)) (fun x0 : FM => @Refl (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0)) (fun (x0 y0 : FM) (_ : eqFM x0 y0) (H0 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0)) => @Sym (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0) H0) (fun (x0 y0 z : FM) (_ : eqFM x0 y0) (H'1 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0)) (_ : eqFM y0 z) (H'3 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun y0) (FM_lift_fun z)) => @Trans (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0) (FM_lift_fun z) H'1 H'3) x y H')) FM_var) *)
red in |- *.
(* Goal: and (@transitive FM eqFM) (@symmetric FM eqFM) *)
split; [ try assumption | idtac ].
(* Goal: @transitive FM eqFM *)
(* Goal: @symmetric FM eqFM *)
exact eqFM_trans.
(* Goal: @symmetric FM eqFM *)
exact eqFM_sym.
Qed.

Definition FM_set := Build_Setoid eqFM_Equiv.

Definition FreeMonoid : MONOID.
(* Goal: Ob MONOID *)
apply (BUILD_MONOID (E:=FM_set) (genlaw:=Law) (e:=Unit)).
(* Goal: forall (x x' y y' : Carrier FM_set) (_ : @Equal FM_set x x') (_ : @Equal FM_set y y'), @Equal FM_set (Law x y) (Law x' y') *)
(* Goal: forall x y z : Carrier FM_set, @Equal FM_set (Law (Law x y) z) (Law x (Law y z)) *)
(* Goal: forall x : Carrier FM_set, @Equal FM_set (Law x Unit) x *)
(* Goal: forall x : Carrier FM_set, @Equal FM_set (Law Unit x) x *)
exact eqFM_law.
(* Goal: forall x y z : Carrier FM_set, @Equal FM_set (Law (Law x y) z) (Law x (Law y z)) *)
(* Goal: forall x : Carrier FM_set, @Equal FM_set (Law x Unit) x *)
(* Goal: forall x : Carrier FM_set, @Equal FM_set (Law Unit x) x *)
exact eqFM_law_assoc.
(* Goal: forall x : Carrier FM_set, @Equal FM_set (Law x Unit) x *)
(* Goal: forall x : Carrier FM_set, @Equal FM_set (Law Unit x) x *)
exact eqFM_law0r.
(* Goal: forall x : Carrier FM_set, @Equal FM_set (Law Unit x) x *)
exact eqFM_law0l.
Defined.
Section Universal_prop.
Variable M : MONOID.
Variable f : Hom V M.

Fixpoint FM_lift_fun (p : FreeMonoid) : M :=
  match p with
  | Var v => f v
  | Law p1 p2 => sgroup_law _ (FM_lift_fun p1) (FM_lift_fun p2)
  | Unit => monoid_unit M
  end.

Definition FM_lift : Hom FreeMonoid M.
(* Goal: Carrier (@Hom MONOID FreeMonoid M) *)
apply (BUILD_HOM_MONOID (G:=FreeMonoid) (G':=M) (ff:=FM_lift_fun)).
(* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup FreeMonoid))) (_ : @Equal (sgroup_set (monoid_sgroup FreeMonoid)) x y), @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x) (FM_lift_fun y) *)
(* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup FreeMonoid)), @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun (sgroup_law (monoid_sgroup FreeMonoid) x y)) (sgroup_law (monoid_sgroup M) (FM_lift_fun x) (FM_lift_fun y)) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun (@monoid_unit (monoid_sgroup FreeMonoid) (monoid_on_def FreeMonoid))) (@monoid_unit (monoid_sgroup M) (monoid_on_def M)) *)
intros x y H'; try assumption.
(* Goal: @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x) (FM_lift_fun y) *)
(* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup FreeMonoid)), @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun (sgroup_law (monoid_sgroup FreeMonoid) x y)) (sgroup_law (monoid_sgroup M) (FM_lift_fun x) (FM_lift_fun y)) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun (@monoid_unit (monoid_sgroup FreeMonoid) (monoid_on_def FreeMonoid))) (@monoid_unit (monoid_sgroup M) (monoid_on_def M)) *)
elim H'; simpl in |- *; auto with algebra.
(* Goal: forall (x y z : FM) (_ : eqFM x y) (_ : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x) (FM_lift_fun y)) (_ : eqFM y z) (_ : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun y) (FM_lift_fun z)), @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x) (FM_lift_fun z) *)
(* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup FreeMonoid)), @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun (sgroup_law (monoid_sgroup FreeMonoid) x y)) (sgroup_law (monoid_sgroup M) (FM_lift_fun x) (FM_lift_fun y)) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun (@monoid_unit (monoid_sgroup FreeMonoid) (monoid_on_def FreeMonoid))) (@monoid_unit (monoid_sgroup M) (monoid_on_def M)) *)
intros x0 y0 z H'0 H'1 H'2 H'3; try assumption.
(* Goal: @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun z) *)
(* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup FreeMonoid)), @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun (sgroup_law (monoid_sgroup FreeMonoid) x y)) (sgroup_law (monoid_sgroup M) (FM_lift_fun x) (FM_lift_fun y)) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun (@monoid_unit (monoid_sgroup FreeMonoid) (monoid_on_def FreeMonoid))) (@monoid_unit (monoid_sgroup M) (monoid_on_def M)) *)
apply Trans with (FM_lift_fun y0); auto with algebra.
(* Goal: forall (x y : Carrier V) (_ : @Equal V x y), @Equal (sgroup_set (monoid_sgroup FreeMonoid)) (Var x) (Var y) *)
simpl in |- *; auto with algebra.
(* Goal: forall (x y : Carrier V) (_ : @Equal V x y), @Equal (sgroup_set (monoid_sgroup FreeMonoid)) (Var x) (Var y) *)
simpl in |- *; auto with algebra.
Defined.

Definition FM_var : Hom V FreeMonoid.
(* Goal: Carrier (@Hom SET V (sgroup_set (monoid_sgroup FreeMonoid))) *)
apply (Build_Map (A:=V) (B:=FreeMonoid) (Ap:=Var)).
(* Goal: @Map_eq V (sgroup_set (monoid_sgroup M)) f (@comp_hom SET V FM_set (sgroup_set (monoid_sgroup M)) (@f2 FreeMonoid M FM_lift_fun (fun (x y : FM) (H' : eqFM x y) => @eqFM_ind (fun x0 y0 : FM => @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0)) (fun (x0 y0 : Carrier V) (H : @Equal V x0 y0) => @Ap_comp V (sgroup_set (monoid_sgroup M)) f f x0 y0 H (@Refl (MAP V (sgroup_set (monoid_sgroup M))) f)) (fun (x0 x' y0 y' : FM) (_ : eqFM x0 x') (H0 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun x')) (_ : eqFM y0 y') (H2 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun y0) (FM_lift_fun y')) => @SGROUP_comp (monoid_sgroup M) (FM_lift_fun x0) (FM_lift_fun x') (FM_lift_fun y0) (FM_lift_fun y') H0 H2) (fun x0 y0 z : FM => @SGROUP_assoc (monoid_sgroup M) (FM_lift_fun x0) (FM_lift_fun y0) (FM_lift_fun z)) (fun x0 : FM => @MONOID_unit_r M (FM_lift_fun x0)) (fun x0 : FM => @MONOID_unit_l M (FM_lift_fun x0)) (fun x0 : FM => @Refl (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0)) (fun (x0 y0 : FM) (_ : eqFM x0 y0) (H0 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0)) => @Sym (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0) H0) (fun (x0 y0 z : FM) (_ : eqFM x0 y0) (H'1 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0)) (_ : eqFM y0 z) (H'3 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun y0) (FM_lift_fun z)) => @Trans (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0) (FM_lift_fun z) H'1 H'3) x y H')) FM_var) *)
red in |- *.
(* Goal: forall (x y : Carrier V) (_ : @Equal V x y), @Equal (sgroup_set (monoid_sgroup FreeMonoid)) (Var x) (Var y) *)
simpl in |- *; auto with algebra.
Defined.

Lemma FM_comp_prop :
 Equal f (comp_hom (FM_lift:Hom (FreeMonoid:SET) M) FM_var).
(* Goal: forall x : Carrier V, @Equal (sgroup_set (monoid_sgroup M)) (@Ap V (sgroup_set (monoid_sgroup M)) f x) (@Ap V (sgroup_set (monoid_sgroup M)) (@comp_hom SET V FM_set (sgroup_set (monoid_sgroup M)) (@f2 FreeMonoid M FM_lift_fun (fun (x0 y : FM) (H' : eqFM x0 y) => @eqFM_ind (fun x1 y0 : FM => @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x1) (FM_lift_fun y0)) (fun (x1 y0 : Carrier V) (H : @Equal V x1 y0) => @Ap_comp V (sgroup_set (monoid_sgroup M)) f f x1 y0 H (@Refl (MAP V (sgroup_set (monoid_sgroup M))) f)) (fun (x1 x' y0 y' : FM) (_ : eqFM x1 x') (H0 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x1) (FM_lift_fun x')) (_ : eqFM y0 y') (H2 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun y0) (FM_lift_fun y')) => @SGROUP_comp (monoid_sgroup M) (FM_lift_fun x1) (FM_lift_fun x') (FM_lift_fun y0) (FM_lift_fun y') H0 H2) (fun x1 y0 z : FM => @SGROUP_assoc (monoid_sgroup M) (FM_lift_fun x1) (FM_lift_fun y0) (FM_lift_fun z)) (fun x1 : FM => @MONOID_unit_r M (FM_lift_fun x1)) (fun x1 : FM => @MONOID_unit_l M (FM_lift_fun x1)) (fun x1 : FM => @Refl (sgroup_set (monoid_sgroup M)) (FM_lift_fun x1)) (fun (x1 y0 : FM) (_ : eqFM x1 y0) (H0 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x1) (FM_lift_fun y0)) => @Sym (sgroup_set (monoid_sgroup M)) (FM_lift_fun x1) (FM_lift_fun y0) H0) (fun (x1 y0 z : FM) (_ : eqFM x1 y0) (H'1 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x1) (FM_lift_fun y0)) (_ : eqFM y0 z) (H'3 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun y0) (FM_lift_fun z)) => @Trans (sgroup_set (monoid_sgroup M)) (FM_lift_fun x1) (FM_lift_fun y0) (FM_lift_fun z) H'1 H'3) x0 y H')) FM_var) x) *)
simpl in |- *.
(* Goal: @Map_eq V (sgroup_set (monoid_sgroup M)) f (@comp_hom SET V FM_set (sgroup_set (monoid_sgroup M)) (@f2 FreeMonoid M FM_lift_fun (fun (x y : FM) (H' : eqFM x y) => @eqFM_ind (fun x0 y0 : FM => @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0)) (fun (x0 y0 : Carrier V) (H : @Equal V x0 y0) => @Ap_comp V (sgroup_set (monoid_sgroup M)) f f x0 y0 H (@Refl (MAP V (sgroup_set (monoid_sgroup M))) f)) (fun (x0 x' y0 y' : FM) (_ : eqFM x0 x') (H0 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun x')) (_ : eqFM y0 y') (H2 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun y0) (FM_lift_fun y')) => @SGROUP_comp (monoid_sgroup M) (FM_lift_fun x0) (FM_lift_fun x') (FM_lift_fun y0) (FM_lift_fun y') H0 H2) (fun x0 y0 z : FM => @SGROUP_assoc (monoid_sgroup M) (FM_lift_fun x0) (FM_lift_fun y0) (FM_lift_fun z)) (fun x0 : FM => @MONOID_unit_r M (FM_lift_fun x0)) (fun x0 : FM => @MONOID_unit_l M (FM_lift_fun x0)) (fun x0 : FM => @Refl (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0)) (fun (x0 y0 : FM) (_ : eqFM x0 y0) (H0 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0)) => @Sym (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0) H0) (fun (x0 y0 z : FM) (_ : eqFM x0 y0) (H'1 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0)) (_ : eqFM y0 z) (H'3 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun y0) (FM_lift_fun z)) => @Trans (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0) (FM_lift_fun z) H'1 H'3) x y H')) FM_var) *)
red in |- *.
(* Goal: forall x : Carrier V, @Equal (sgroup_set (monoid_sgroup M)) (@Ap V (sgroup_set (monoid_sgroup M)) f x) (@Ap V (sgroup_set (monoid_sgroup M)) (@comp_hom SET V FM_set (sgroup_set (monoid_sgroup M)) (@f2 FreeMonoid M FM_lift_fun (fun (x0 y : FM) (H' : eqFM x0 y) => @eqFM_ind (fun x1 y0 : FM => @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x1) (FM_lift_fun y0)) (fun (x1 y0 : Carrier V) (H : @Equal V x1 y0) => @Ap_comp V (sgroup_set (monoid_sgroup M)) f f x1 y0 H (@Refl (MAP V (sgroup_set (monoid_sgroup M))) f)) (fun (x1 x' y0 y' : FM) (_ : eqFM x1 x') (H0 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x1) (FM_lift_fun x')) (_ : eqFM y0 y') (H2 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun y0) (FM_lift_fun y')) => @SGROUP_comp (monoid_sgroup M) (FM_lift_fun x1) (FM_lift_fun x') (FM_lift_fun y0) (FM_lift_fun y') H0 H2) (fun x1 y0 z : FM => @SGROUP_assoc (monoid_sgroup M) (FM_lift_fun x1) (FM_lift_fun y0) (FM_lift_fun z)) (fun x1 : FM => @MONOID_unit_r M (FM_lift_fun x1)) (fun x1 : FM => @MONOID_unit_l M (FM_lift_fun x1)) (fun x1 : FM => @Refl (sgroup_set (monoid_sgroup M)) (FM_lift_fun x1)) (fun (x1 y0 : FM) (_ : eqFM x1 y0) (H0 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x1) (FM_lift_fun y0)) => @Sym (sgroup_set (monoid_sgroup M)) (FM_lift_fun x1) (FM_lift_fun y0) H0) (fun (x1 y0 z : FM) (_ : eqFM x1 y0) (H'1 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x1) (FM_lift_fun y0)) (_ : eqFM y0 z) (H'3 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun y0) (FM_lift_fun z)) => @Trans (sgroup_set (monoid_sgroup M)) (FM_lift_fun x1) (FM_lift_fun y0) (FM_lift_fun z) H'1 H'3) x0 y H')) FM_var) x) *)
simpl in |- *.
(* Goal: forall x : Carrier V, @Equal (sgroup_set (monoid_sgroup M)) (@Ap V (sgroup_set (monoid_sgroup M)) f x) (@Ap V (sgroup_set (monoid_sgroup M)) f x) *)
auto with algebra.
Qed.
End Universal_prop.
End Free_monoid_def.
Hint Resolve FM_comp_prop: algebra.