(************************************************************************)
(*         *      The Rocq Prover / The Rocq Development Team           *)
(*  v      *         Copyright INRIA, CNRS and contributors             *)
(* <O___,, * (see version control and CREDITS file for authors & dates) *)
(*   \VV/  **************************************************************)
(*    //   *    This file is distributed under the terms of the         *)
(*         *     GNU Lesser General Public License Version 2.1          *)
(*         *     (see LICENSE file for the text of the license)         *)
(************************************************************************)
(** N.B.: Using this encoding of vectors is discouraged. See <https://github.com/coq/coq/blob/master/stdlib/theories/Vectors/Vector.v>. *)
Attributes warn(cats="stdlib vector", note="Using Vector.t is known to be technically difficult, see <https://github.com/coq/coq/blob/master/stdlib/theories/Vectors/Vector.v>.").
(** Proofs of specification for functions defined over Vector  Initial Author: Pierre Boutillier Institution: PPS, INRIA 12/2010 *)
#[local] Set Warnings "-stdlib-vector".
Require Fin List.
Definition cons_inj {A} {a1 a2} {n} {v1 v2 : t A n}
(eq : a1 :: v1 = a2 :: v2) : a1 = a2 /\ v1 = v2 :=
match eq in _ = x return caseS _ (fun a2' _ v2' => fun v1' => a1 = a2' /\ v1' = v2') x v1
with | eq_refl => conj eq_refl eq_refl
end.

Lemma nth_order_last A: forall n (v: t A (S n)) (H: n < S n),
nth_order v H = last v.