(* 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                                                     *)
(* Contribution to the Coq Library   V6.3 (July 1999)                    *)
(****************************************************************************)
(*                 The Calculus of Inductive Constructions                  *)
(*                                                                          *)
(*                                Projet Coq                                *)
(*                                                                          *)
(*                     INRIA                        ENS-CNRS                *)
(*              Rocquencourt                        Lyon                    *)
(*                                                                          *)
(*                                Coq V5.10                                 *)
(*                              Nov 25th 1994                               *)
(*                                                                          *)
(****************************************************************************)
(*                               fonctions.v                                *)
(****************************************************************************)
(*              Formal Language Theory                                      *)
(*                                                                          *)
(*              Judicael Courant - Jean-Christophe Filliatre                *)
(*                                                                          *)
(*              Developped in V5.8  June-July 1993                          *)
(*              Ported     to V5.10 October 1994                            *)
(****************************************************************************)
Hint Resolve dans_map_inv.
Hint Resolve dans_map.
Hint Resolve dans_add1.
Definition comp (f g : Elt -> Elt) (x : Elt) := f (g x).
intros f g.
simple induction E; simpl in |- *; auto.
Qed.
Definition comp_word (f g : Word -> Word) (x : Word) := f (g x).
Definition eg_f_W_W (f g : Word -> Word) := forall x : Word, f x = g x :>Word.
intros f g.
unfold eg_f_W_W, Word_ext, comp, comp_word in |- *.
simple induction x; simpl in |- *; auto.
Qed.
Hint Resolve comp_Word_ext.
Definition Id (E : Ensf) (f : Elt -> Elt) :=
forall x : Elt, dans x E -> f x = x :>Elt.
auto.
Qed.
Hint Unfold Id.
auto.
Qed.
intros E f.
elim E; unfold map in |- *.
auto.
intros a b Hyp_rec Id_a_b_f.
apply add_add.
auto.
apply Hyp_rec.
apply Id_inclus with (add a b); auto.
Qed.
Definition Id_words (E : Ensf) (f : Word -> Word) :=
forall x : Word, inmonoid E x -> f x = x :>Word.
auto.
Qed.
intros E F f inclus_F_E Id_E_f.
red in |- *.
intros x inmonoid_F_x.
apply Id_E_f.
apply inmonoid_inclus with F; assumption.
Qed.

Lemma extension_Id :
forall (E : Ensf) (f : Elt -> Elt), Id E f -> Id_words E (Word_ext f).