(* 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                                                     *)


(*****************************************************************************)
(*          Projet Formel - Calculus of Inductive Constructions V5.10        *)
(*****************************************************************************)
(*									     *)
(*	               Forgetful Functor : MON -> SET                        *)
(*									     *)
(*****************************************************************************)
(*									     *)
(*                     A. SAIBI	  May 95                  		     *)
(*									     *)
(*****************************************************************************)

Require Export MON.
Require Export Functor.

Set Implicit Arguments.
Unset Strict Implicit.

(* Foncteur d'oubli *)

Section forget_map_def.

Variable m1 m2 : Monoid.

Lemma FunForget_map_law : Map_law (MonMap (m1:=m1) (m2:=m2)).
Proof.
(* Goal: @Map_law (MonMor_setoid m1 m2) (Map_setoid (Mcarrier m1) (Mcarrier m2)) (@MonMap m1 m2) *)
unfold Map_law in |- *; simpl in |- *.
(* Goal: forall (x y : MonMor m1 m2) (_ : @Equal_MonMor m1 m2 x y), @Ext (Mcarrier m1) (Mcarrier m2) (@MonMap m1 m2 x) (@MonMap m1 m2 y) *)
unfold Equal_MonMor in |- *; trivial.
Qed.

Canonical Structure FunForget_map := Build_Map FunForget_map_law.

End forget_map_def.

Lemma FunForget_fcomp_law : Fcomp_law FunForget_map.
Proof.
(* Goal: @Fcomp_law MON SET Mcarrier FunForget_map *)
unfold Fcomp_law in |- *; simpl in |- *.
(* Goal: forall (a b c : Monoid) (f : MonMor a b) (g : MonMor b c), @Ext (Mcarrier a) (Mcarrier c) (@Comp_MonMor_map a b c f g) (@Comp SET (Mcarrier a) (Mcarrier b) (Mcarrier c) (@MonMap a b f) (@MonMap b c g)) *)
unfold Comp_MonMor_map, Ext in |- *.
(* Goal: forall (a b c : Monoid) (f : MonMor a b) (g : MonMor b c) (x : Carrier (Mcarrier a)), @Equal (Mcarrier c) (@Ap (Mcarrier a) (Mcarrier c) (@Comp_map (Mcarrier a) (Mcarrier b) (Mcarrier c) (@MonMap a b f) (@MonMap b c g)) x) (@Ap (Mcarrier a) (Mcarrier c) (@Comp SET (Mcarrier a) (Mcarrier b) (Mcarrier c) (@MonMap a b f) (@MonMap b c g)) x) *)
intros m1 m2 m3 f g x; apply Refl.
Qed.

Lemma FunForget_fid_law : Fid_law FunForget_map.
Proof.
(* Goal: @Fid_law MON SET Mcarrier FunForget_map *)
unfold Fid_law in |- *; simpl in |- *.
(* Goal: forall a : Monoid, @Ext (Mcarrier a) (Mcarrier a) (Id_MON_map a) (Id_SET (Mcarrier a)) *)
unfold Id_MON_map, Ext in |- *.
(* Goal: forall (a : Monoid) (x : Carrier (Mcarrier a)), @Equal (Mcarrier a) (@Ap (Mcarrier a) (Mcarrier a) (Id_SET (Mcarrier a)) x) (@Ap (Mcarrier a) (Mcarrier a) (Id_SET (Mcarrier a)) x) *)
intros m x; apply Refl.
Qed.

Canonical Structure FunForget :=
  Build_Functor FunForget_fcomp_law FunForget_fid_law.