(* 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                                                     *)
(** %\subsection*{ support :  Map\_embed.v }%*)
Set Implicit Arguments.
Unset Strict Implicit.
Require Export concat.
(** - Any element of $A\subset E$ is of course also an element of $E$ itself. Map_embed takes setoid functions $X\to A$ to setoid functions $X\to E$ by embedding  %\label{Mapembed}% *)
Definition Map_embed :
forall (X E : Setoid) (A : part_set E) (f : Map X A), MAP X E.
intros.
apply (Build_Map (Ap:=fun n : X => A (f n))).
red in |- *.
intros x y.
case f.
intros.
red in Map_compatible_prf.
generalize Map_compatible_prf.
intro H0.
generalize (H0 x y).
intros.
simpl in |- *.
apply H1.
assumption.
Defined.

(* Specifications: *)
Lemma Map_embed_comp :
forall (X E : Setoid) (A : part_set E) (f g : Map X A),
f =' g in MAP _ _ -> Map_embed f =' Map_embed g in _.