(* 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*{ extras :  restrict.v }%*)
Set Implicit Arguments.
Unset Strict Implicit.
Require Export const.
Require Export pointwise.
Require Export distinct.
(** - Restriction of a sequence to its prefixes... not used anywhere any more *)
Definition restricted_seq :
forall (S : Setoid) (N : Nat) (f : seq N S) (M : Nat) (leMN : M <= N),
seq M S.
intros.
simpl in |- *.
apply
(Build_Map
(Ap:=fun mM : fin M =>
f
match mM with
| Build_finiteT m ltmM =>
Build_finiteT (lt_le_trans _ _ _ ltmM leMN)
end)).
red in |- *.
intros.
destruct x.
destruct y.
apply Ap_comp; auto with algebra.
Defined.
intros.
simpl in |- *.
red in |- *.
simpl in |- *.
destruct x.
apply Ap_comp; auto with algebra.
Qed.
Hint Resolve restricted_comp: algebra.

Lemma const_map_restricted :
forall (n N : Nat) (H : n <= N) (Y : Setoid) (y : Y),
restricted_seq (const_seq N y) H =' const_seq n y in _.