(* 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 :  seq\_equality\_facts.v }%*)
Set Implicit Arguments.
Unset Strict Implicit.
Require Export seq_equality.
Require Export concat_facts.
Require Export omit.
Require Export Classical_Prop.
(** - Some useful lemmas concerning seq_equal *)
intros.
red in H.
apply NNPP; intro.
assert (n < m \/ m < n).
apply nat_total_order; auto with algebra.
inversion_clear H1.
generalize (H n); clear H; intro.
inversion_clear H.
inversion_clear H1.
apply (lt_irrefl n); auto with algebra.
inversion_clear H1.
apply (lt_not_le n m); auto with algebra.
generalize (H m); clear H; intro.
inversion_clear H.
inversion_clear H1.
inversion_clear H.
apply (lt_irrefl m); auto with algebra.
inversion_clear H1.
apply (le_not_lt n m); auto with algebra.
Qed.
Hint Resolve seq_equal_length_equal: algebra.

Lemma seq_equal_equal_elements :
forall (A : Setoid) (n m : Nat) (v : seq n A) (w : seq m A),
seq_equal v w ->
forall (i : fin n) (j : fin m), index i = index j -> v i =' w j in _.